From b981cd66096bfdb86d9f059006187ca8509c0bd7 Mon Sep 17 00:00:00 2001 From: Alexandre Roux Date: Thu, 10 Aug 2023 20:53:55 +0200 Subject: [PATCH 1/4] ci bump android/windows (10mn) and macos build time (20mn) --- sqflite_support/test/workflow_build_test.dart | 2 +- sqflite_test_app/test/macos_build_test.dart | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sqflite_support/test/workflow_build_test.dart b/sqflite_support/test/workflow_build_test.dart index 887e6c04..b44cfc98 100644 --- a/sqflite_support/test/workflow_build_test.dart +++ b/sqflite_support/test/workflow_build_test.dart @@ -78,7 +78,7 @@ void workflow({bool noBuild = false}) { test('build android', () async { await ensureCreate(); await androidBuild(); - }, timeout: const Timeout(Duration(minutes: 5))); + }, timeout: Timeout(Duration(minutes: Platform.isWindows ? 10 : 5))); test('add sqflite', () async { await ensureCreate(); if (await pathPubspecAddDependency(dir, 'sqflite')) { diff --git a/sqflite_test_app/test/macos_build_test.dart b/sqflite_test_app/test/macos_build_test.dart index fa1c14a4..2ce004e6 100644 --- a/sqflite_test_app/test/macos_build_test.dart +++ b/sqflite_test_app/test/macos_build_test.dart @@ -31,5 +31,5 @@ Future main() async { var runAppShell = Shell(environment: env, workingDirectory: exeDir); // We run the generated exe, not the copy as it does not work await runAppShell.run(shellArgument(join(binSubDir, 'sqflite_test_app'))); - }, skip: !platformIsMacOS, timeout: const Timeout(Duration(minutes: 10))); + }, skip: !platformIsMacOS, timeout: const Timeout(Duration(minutes: 20))); } From 35219decf75d436a2602b24e3e1cf1dfde4b3206 Mon Sep 17 00:00:00 2001 From: Alexandre Roux Date: Wed, 6 Sep 2023 16:53:45 +0200 Subject: [PATCH 2/4] more lints --- .../sqflite_common_ffi_web/analysis_options.yaml | 8 ++++++++ .../sqflite_common_ffi_web_test/analysis_options.yaml | 8 ++++++++ sqflite/analysis_options.yaml | 10 ++++++++++ sqflite/example/analysis_options.yaml | 9 +++++++++ sqflite/lib/src/sqflite_import.dart | 2 ++ sqflite_common/analysis_options.yaml | 8 ++++++++ sqflite_common/lib/src/database_mixin.dart | 10 +++++----- sqflite_common/lib/src/mixin.dart | 2 ++ sqflite_common/lib/src/mixin/import_mixin.dart | 2 ++ sqflite_common/lib/src/sqflite_import.dart | 2 ++ sqflite_common_ffi/analysis_options.yaml | 8 ++++++++ sqflite_common_ffi/lib/src/mixin/handler_mixin.dart | 2 ++ sqflite_common_test/analysis_options.yaml | 8 ++++++++ sqflite_support/analysis_options.yaml | 8 ++++++++ sqflite_test_app/analysis_options.yaml | 9 +++++++++ 15 files changed, 91 insertions(+), 5 deletions(-) diff --git a/packages_web/sqflite_common_ffi_web/analysis_options.yaml b/packages_web/sqflite_common_ffi_web/analysis_options.yaml index 32dc2ea1..ffd5c500 100644 --- a/packages_web/sqflite_common_ffi_web/analysis_options.yaml +++ b/packages_web/sqflite_common_ffi_web/analysis_options.yaml @@ -99,5 +99,13 @@ linter: - unnecessary_null_in_if_null_operators - use_rethrow_when_possible + - dangling_library_doc_comments + - deprecated_member_use_from_same_package + - implicit_reopen + - invalid_case_patterns + - no_literal_bool_comparisons + - no_self_assignments + - no_wildcard_variable_uses + - type_literal_in_constant_pattern # === doc rules === - public_member_api_docs diff --git a/packages_web/sqflite_common_ffi_web_test/analysis_options.yaml b/packages_web/sqflite_common_ffi_web_test/analysis_options.yaml index acb5c9c8..a4ceb53a 100644 --- a/packages_web/sqflite_common_ffi_web_test/analysis_options.yaml +++ b/packages_web/sqflite_common_ffi_web_test/analysis_options.yaml @@ -96,5 +96,13 @@ linter: - unnecessary_null_in_if_null_operators - use_rethrow_when_possible + - dangling_library_doc_comments + - deprecated_member_use_from_same_package + - implicit_reopen + - invalid_case_patterns + - no_literal_bool_comparisons + - no_self_assignments + - no_wildcard_variable_uses + - type_literal_in_constant_pattern # === doc rules === # - public_member_api_docs diff --git a/sqflite/analysis_options.yaml b/sqflite/analysis_options.yaml index 7773ddc2..c305362e 100644 --- a/sqflite/analysis_options.yaml +++ b/sqflite/analysis_options.yaml @@ -93,6 +93,16 @@ linter: - unnecessary_new - unnecessary_null_in_if_null_operators - use_rethrow_when_possible + + - dangling_library_doc_comments + - deprecated_member_use_from_same_package + - implicit_reopen + - invalid_case_patterns + - no_literal_bool_comparisons + - no_self_assignments + - no_wildcard_variable_uses + - type_literal_in_constant_pattern + # === doc rules === - public_member_api_docs # diff --git a/sqflite/example/analysis_options.yaml b/sqflite/example/analysis_options.yaml index 2be3bca3..22eb36ca 100644 --- a/sqflite/example/analysis_options.yaml +++ b/sqflite/example/analysis_options.yaml @@ -93,6 +93,15 @@ linter: - unnecessary_new - unnecessary_null_in_if_null_operators - use_rethrow_when_possible + + - dangling_library_doc_comments + - deprecated_member_use_from_same_package + - implicit_reopen + - invalid_case_patterns + - no_literal_bool_comparisons + - no_self_assignments + - no_wildcard_variable_uses + - type_literal_in_constant_pattern # === doc rules === - public_member_api_docs # diff --git a/sqflite/lib/src/sqflite_import.dart b/sqflite/lib/src/sqflite_import.dart index 9a99f72d..609e586a 100644 --- a/sqflite/lib/src/sqflite_import.dart +++ b/sqflite/lib/src/sqflite_import.dart @@ -1,6 +1,8 @@ /// /// Export for implementation: sqflite, sqflite_common_ffi /// +library; + export 'package:sqflite_common/src/compat.dart' show SqfliteOptions; // ignore: deprecated_member_use /// Explicit list of needed private import diff --git a/sqflite_common/analysis_options.yaml b/sqflite_common/analysis_options.yaml index cbbe118c..c751173b 100644 --- a/sqflite_common/analysis_options.yaml +++ b/sqflite_common/analysis_options.yaml @@ -107,5 +107,13 @@ linter: - unnecessary_null_in_if_null_operators - use_rethrow_when_possible + - dangling_library_doc_comments + - deprecated_member_use_from_same_package + - implicit_reopen + - invalid_case_patterns + - no_literal_bool_comparisons + - no_self_assignments + - no_wildcard_variable_uses + - type_literal_in_constant_pattern # === doc rules === - public_member_api_docs diff --git a/sqflite_common/lib/src/database_mixin.dart b/sqflite_common/lib/src/database_mixin.dart index 9fd02ce9..d4e932b2 100644 --- a/sqflite_common/lib/src/database_mixin.dart +++ b/sqflite_common/lib/src/database_mixin.dart @@ -348,7 +348,7 @@ extension SqfliteDatabaseMixinExt on SqfliteDatabase { {bool? exclusive}) async { Object? response; // never create transaction in read-only mode - if (readOnly != true) { + if (!readOnly) { if (exclusive == true) { response = await txnExecute(txn, 'BEGIN EXCLUSIVE', null, beginTransaction: true); @@ -723,7 +723,7 @@ mixin SqfliteDatabaseMixin implements SqfliteDatabase { @override Future endTransaction(SqfliteTransaction txn) async { // never commit transaction in read-only mode - if (readOnly != true) { + if (!readOnly) { if (txn.successful == true) { await txnExecute(txn, 'COMMIT', null); } else { @@ -759,7 +759,7 @@ mixin SqfliteDatabaseMixin implements SqfliteDatabase { /// id does not run any callback calls Future openDatabase() async { final params = {paramPath: path}; - if (readOnly == true) { + if (readOnly) { params[paramReadOnly] = true; } // Single instance? never for standard inMemoryDatabase @@ -786,7 +786,7 @@ mixin SqfliteDatabaseMixin implements SqfliteDatabase { // was in progress. This catches hot-restart scenario if (recoveredInTransaction) { // Don't do it for read-only - if (readOnly != true) { + if (!readOnly) { // We are not yet open so invoke the plugin directly try { await safeInvokeMethod(methodExecute, { @@ -818,7 +818,7 @@ mixin SqfliteDatabaseMixin implements SqfliteDatabase { // Mark as closed now isClosed = true; - if (readOnly != true && inTransaction) { + if (!readOnly && inTransaction) { // Grab lock to prevent future access // At least we know no other request will be ran try { diff --git a/sqflite_common/lib/src/mixin.dart b/sqflite_common/lib/src/mixin.dart index 4eb3798c..d13215b9 100644 --- a/sqflite_common/lib/src/mixin.dart +++ b/sqflite_common/lib/src/mixin.dart @@ -1,5 +1,7 @@ /// Sqflite mixins /// /// Warning the API here are exposed to external implementation +library; + export 'database_mixin.dart'; export 'factory_mixin.dart'; diff --git a/sqflite_common/lib/src/mixin/import_mixin.dart b/sqflite_common/lib/src/mixin/import_mixin.dart index c76b8f9a..024059a0 100644 --- a/sqflite_common/lib/src/mixin/import_mixin.dart +++ b/sqflite_common/lib/src/mixin/import_mixin.dart @@ -1,6 +1,8 @@ /// /// Export for implementation: sqflite, sqflite_common_ffi /// +library; + export 'package:sqflite_common/src/compat.dart' show SqfliteOptions; // ignore: deprecated_member_use, deprecated_member_use_from_same_package diff --git a/sqflite_common/lib/src/sqflite_import.dart b/sqflite_common/lib/src/sqflite_import.dart index ec970424..3562dc0b 100644 --- a/sqflite_common/lib/src/sqflite_import.dart +++ b/sqflite_common/lib/src/sqflite_import.dart @@ -1,6 +1,8 @@ /// /// Export for implementation: sqflite, sqflite_common_ffi /// +library; + export 'package:sqflite_common/src/compat.dart' show SqfliteOptions; // ignore: deprecated_member_use_from_same_package /// Explicit list of needed private import diff --git a/sqflite_common_ffi/analysis_options.yaml b/sqflite_common_ffi/analysis_options.yaml index 6e8f4c40..22a35b6f 100644 --- a/sqflite_common_ffi/analysis_options.yaml +++ b/sqflite_common_ffi/analysis_options.yaml @@ -97,5 +97,13 @@ linter: - unnecessary_null_in_if_null_operators - use_rethrow_when_possible + - dangling_library_doc_comments + - deprecated_member_use_from_same_package + - implicit_reopen + - invalid_case_patterns + - no_literal_bool_comparisons + - no_self_assignments + - no_wildcard_variable_uses + - type_literal_in_constant_pattern # === doc rules === - public_member_api_docs diff --git a/sqflite_common_ffi/lib/src/mixin/handler_mixin.dart b/sqflite_common_ffi/lib/src/mixin/handler_mixin.dart index 2980050d..935d889e 100644 --- a/sqflite_common_ffi/lib/src/mixin/handler_mixin.dart +++ b/sqflite_common_ffi/lib/src/mixin/handler_mixin.dart @@ -1,4 +1,6 @@ /// Exported for implementation +library; + export 'package:sqflite_common_ffi/src/database_factory_ffi.dart' show ffiMethodCallhandleInIsolate; export 'package:sqflite_common_ffi/src/method_call.dart' show FfiMethodCall; diff --git a/sqflite_common_test/analysis_options.yaml b/sqflite_common_test/analysis_options.yaml index a4fd1a8f..98163569 100644 --- a/sqflite_common_test/analysis_options.yaml +++ b/sqflite_common_test/analysis_options.yaml @@ -96,5 +96,13 @@ linter: - unnecessary_null_in_if_null_operators - use_rethrow_when_possible + - dangling_library_doc_comments + - deprecated_member_use_from_same_package + - implicit_reopen + - invalid_case_patterns + - no_literal_bool_comparisons + - no_self_assignments + - no_wildcard_variable_uses + - type_literal_in_constant_pattern # === doc rules === - public_member_api_docs diff --git a/sqflite_support/analysis_options.yaml b/sqflite_support/analysis_options.yaml index a4fd1a8f..98163569 100644 --- a/sqflite_support/analysis_options.yaml +++ b/sqflite_support/analysis_options.yaml @@ -96,5 +96,13 @@ linter: - unnecessary_null_in_if_null_operators - use_rethrow_when_possible + - dangling_library_doc_comments + - deprecated_member_use_from_same_package + - implicit_reopen + - invalid_case_patterns + - no_literal_bool_comparisons + - no_self_assignments + - no_wildcard_variable_uses + - type_literal_in_constant_pattern # === doc rules === - public_member_api_docs diff --git a/sqflite_test_app/analysis_options.yaml b/sqflite_test_app/analysis_options.yaml index 2be3bca3..22eb36ca 100644 --- a/sqflite_test_app/analysis_options.yaml +++ b/sqflite_test_app/analysis_options.yaml @@ -93,6 +93,15 @@ linter: - unnecessary_new - unnecessary_null_in_if_null_operators - use_rethrow_when_possible + + - dangling_library_doc_comments + - deprecated_member_use_from_same_package + - implicit_reopen + - invalid_case_patterns + - no_literal_bool_comparisons + - no_self_assignments + - no_wildcard_variable_uses + - type_literal_in_constant_pattern # === doc rules === - public_member_api_docs # From 8b5b287b5f02d524c4e3ff896adf5e9294113e8b Mon Sep 17 00:00:00 2001 From: Alexandre Roux Date: Wed, 6 Sep 2023 16:53:55 +0200 Subject: [PATCH 3/4] add topics --- packages_web/sqflite_common_ffi_web/pubspec.yaml | 8 ++++++++ sqflite/pubspec.yaml | 11 +++++++++++ sqflite_common_ffi/pubspec.yaml | 10 ++++++++++ 3 files changed, 29 insertions(+) diff --git a/packages_web/sqflite_common_ffi_web/pubspec.yaml b/packages_web/sqflite_common_ffi_web/pubspec.yaml index f159b96b..bb3f7658 100644 --- a/packages_web/sqflite_common_ffi_web/pubspec.yaml +++ b/packages_web/sqflite_common_ffi_web/pubspec.yaml @@ -5,6 +5,14 @@ version: 0.4.0 funding: - https://github.com/sponsors/alextekartik +# This package supports all platforms listed below. +platforms: + web: + +topics: + - sql + - database + environment: sdk: '>=3.0.0 <4.0.0' diff --git a/sqflite/pubspec.yaml b/sqflite/pubspec.yaml index c1a0c085..886d7128 100644 --- a/sqflite/pubspec.yaml +++ b/sqflite/pubspec.yaml @@ -4,6 +4,17 @@ issue_tracker: https://github.com/tekartik/sqflite/issues description: Flutter plugin for SQLite, a self-contained, high-reliability, embedded, SQL database engine. version: 2.3.0 + +# This package supports all platforms listed below. +platforms: + android: + ios: + macos: + +topics: + - sql + - database + funding: - https://github.com/sponsors/alextekartik diff --git a/sqflite_common_ffi/pubspec.yaml b/sqflite_common_ffi/pubspec.yaml index 4de6ffe4..1b615959 100644 --- a/sqflite_common_ffi/pubspec.yaml +++ b/sqflite_common_ffi/pubspec.yaml @@ -5,6 +5,16 @@ version: 2.3.0+2 funding: - https://github.com/sponsors/alextekartik +# This package supports all platforms listed below. +platforms: + linux: + macos: + windows: + +topics: + - sql + - database + environment: sdk: '>=3.0.0 <4.0.0' From cdd45e1b4de5153b05f2803e3502f2376a1a788a Mon Sep 17 00:00:00 2001 From: Alexandre Roux Date: Thu, 14 Sep 2023 18:59:54 +0200 Subject: [PATCH 4/4] test: ci downgrade analysis --- .../run_ci_flutter_downgrade_analyze.yml | 32 +++++++++++++++++++ sqflite/example/pubspec.yaml | 2 +- sqflite_common_ffi/pubspec.yaml | 4 +-- sqflite_support/pubspec.yaml | 2 +- sqflite_test_app/pubspec.yaml | 2 +- 5 files changed, 37 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/run_ci_flutter_downgrade_analyze.yml diff --git a/.github/workflows/run_ci_flutter_downgrade_analyze.yml b/.github/workflows/run_ci_flutter_downgrade_analyze.yml new file mode 100644 index 00000000..ce35f3fb --- /dev/null +++ b/.github/workflows/run_ci_flutter_downgrade_analyze.yml @@ -0,0 +1,32 @@ +name: Run CI +on: + push: + workflow_dispatch: + schedule: + - cron: '0 0 * * 0' # every sunday at midnight + +jobs: + test: + name: Test on ${{ matrix.os }} / ${{ matrix.flutter }} + runs-on: ${{ matrix.os }} + defaults: + run: + working-directory: . + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest] + flutter: [stable] + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: '12.x' + - uses: subosito/flutter-action@v2 + with: + channel: ${{ matrix.flutter }} + - run: dart --version + - run: flutter --version + - run: dart pub global activate dev_test + - run: dart pub global run dev_test:run_ci --pub-downgrade --analyze --no-override --recursive \ No newline at end of file diff --git a/sqflite/example/pubspec.yaml b/sqflite/example/pubspec.yaml index 51827cfa..714b4b4f 100644 --- a/sqflite/example/pubspec.yaml +++ b/sqflite/example/pubspec.yaml @@ -17,7 +17,7 @@ dependencies: matcher: meta: dev_dependencies: - flutter_lints: + flutter_lints: '>=2.0.0' flutter_test: sdk: flutter integration_test: diff --git a/sqflite_common_ffi/pubspec.yaml b/sqflite_common_ffi/pubspec.yaml index 1b615959..23e6ff89 100644 --- a/sqflite_common_ffi/pubspec.yaml +++ b/sqflite_common_ffi/pubspec.yaml @@ -26,9 +26,9 @@ dependencies: meta: '>=1.3.0 <3.0.0' dev_dependencies: - lints: + lints: '>=2.1.1' test: '>=1.16.2' process_run: '>=0.12.0' pub_semver: '>=2.0.0' - archive: + archive: '>=3.3.9' http: diff --git a/sqflite_support/pubspec.yaml b/sqflite_support/pubspec.yaml index 44453d70..a84eab02 100644 --- a/sqflite_support/pubspec.yaml +++ b/sqflite_support/pubspec.yaml @@ -10,7 +10,7 @@ environment: dev_dependencies: lints: '>=1.0.0' process_run: '>=0.11.0+2' - dev_test: '>=0.13.4-dev.2' + dev_test: '>=0.16.2' test: path: pub_semver: diff --git a/sqflite_test_app/pubspec.yaml b/sqflite_test_app/pubspec.yaml index 210fefa0..d9b84420 100644 --- a/sqflite_test_app/pubspec.yaml +++ b/sqflite_test_app/pubspec.yaml @@ -39,7 +39,7 @@ dependencies: sqflite_common_ffi_web: dev_dependencies: - flutter_lints: + flutter_lints: '>=2.0.3' flutter_test: sdk: flutter flutter_driver: