Skip to content

Commit

Permalink
Merge pull request #1046 from tekartik/dart3a
Browse files Browse the repository at this point in the history
Dart3a
  • Loading branch information
alextekartik authored Sep 14, 2023
2 parents 0cda463 + cdd45e1 commit 6e7e461
Show file tree
Hide file tree
Showing 24 changed files with 159 additions and 12 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/run_ci_flutter_downgrade_analyze.yml
Original file line number Diff line number Diff line change
@@ -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
8 changes: 8 additions & 0 deletions packages_web/sqflite_common_ffi_web/analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 8 additions & 0 deletions packages_web/sqflite_common_ffi_web/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 10 additions & 0 deletions sqflite/analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
#
Expand Down
9 changes: 9 additions & 0 deletions sqflite/example/analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
#
Expand Down
2 changes: 1 addition & 1 deletion sqflite/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ dependencies:
matcher:
meta:
dev_dependencies:
flutter_lints:
flutter_lints: '>=2.0.0'
flutter_test:
sdk: flutter
integration_test:
Expand Down
2 changes: 2 additions & 0 deletions sqflite/lib/src/sqflite_import.dart
Original file line number Diff line number Diff line change
@@ -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
Expand Down
11 changes: 11 additions & 0 deletions sqflite/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 8 additions & 0 deletions sqflite_common/analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 5 additions & 5 deletions sqflite_common/lib/src/database_mixin.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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<dynamic>(txn, 'BEGIN EXCLUSIVE', null,
beginTransaction: true);
Expand Down Expand Up @@ -723,7 +723,7 @@ mixin SqfliteDatabaseMixin implements SqfliteDatabase {
@override
Future<void> endTransaction(SqfliteTransaction txn) async {
// never commit transaction in read-only mode
if (readOnly != true) {
if (!readOnly) {
if (txn.successful == true) {
await txnExecute<dynamic>(txn, 'COMMIT', null);
} else {
Expand Down Expand Up @@ -759,7 +759,7 @@ mixin SqfliteDatabaseMixin implements SqfliteDatabase {
/// id does not run any callback calls
Future<int> openDatabase() async {
final params = <String, Object?>{paramPath: path};
if (readOnly == true) {
if (readOnly) {
params[paramReadOnly] = true;
}
// Single instance? never for standard inMemoryDatabase
Expand All @@ -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<Object?>(methodExecute, <String, Object?>{
Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 2 additions & 0 deletions sqflite_common/lib/src/mixin.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/// Sqflite mixins
///
/// Warning the API here are exposed to external implementation
library;

export 'database_mixin.dart';
export 'factory_mixin.dart';
2 changes: 2 additions & 0 deletions sqflite_common/lib/src/mixin/import_mixin.dart
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 2 additions & 0 deletions sqflite_common/lib/src/sqflite_import.dart
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 8 additions & 0 deletions sqflite_common_ffi/analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions sqflite_common_ffi/lib/src/mixin/handler_mixin.dart
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
14 changes: 12 additions & 2 deletions sqflite_common_ffi/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand All @@ -16,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:
8 changes: 8 additions & 0 deletions sqflite_common_test/analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 8 additions & 0 deletions sqflite_support/analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion sqflite_support/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion sqflite_support/test/workflow_build_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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')) {
Expand Down
9 changes: 9 additions & 0 deletions sqflite_test_app/analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
#
Expand Down
2 changes: 1 addition & 1 deletion sqflite_test_app/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ dependencies:
sqflite_common_ffi_web:

dev_dependencies:
flutter_lints:
flutter_lints: '>=2.0.3'
flutter_test:
sdk: flutter
flutter_driver:
Expand Down
2 changes: 1 addition & 1 deletion sqflite_test_app/test/macos_build_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ Future<void> 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)));
}

0 comments on commit 6e7e461

Please sign in to comment.