diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d1275368..c736eb9e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -15,8 +15,8 @@ jobs: name: Compile sqlite3 for ${{ matrix.os }} runs-on: ${{ matrix.os }} env: - SQLITE_YEAR: "2023" - SQLITE_VERSION: "3420000" + SQLITE_YEAR: "2024" + SQLITE_VERSION: "3470200" steps: - uses: actions/cache@v4 @@ -84,7 +84,7 @@ jobs: needs: [compile_sqlite3] strategy: matrix: - package: [sqlite3] + package: [sqlite3, sqlite3_test] dart: [stable] name: Analyze on Dart ${{ matrix.dart }} @@ -182,12 +182,13 @@ jobs: - name: Test sqlite3_test package run: | dart pub get - dart test -P ci - working-directory: sqlite3/ + dart test + working-directory: sqlite3_test/ - name: Web tests run: | - curl https://storage.googleapis.com/simon-public-euw3/assets/sqlite3/wasm/2.4.6/sqlite3.wasm -o example/web/sqlite3.wasm + curl https://simon-public.fsn1.your-objectstorage.com/assets/sqlite3/2.6.0/sqlite3.wasm -o example/web/sqlite3.wasm + curl https://simon-public.fsn1.your-objectstorage.com/assets/sqlite3/2.6.0/sqlite3mc.wasm -o example/web/sqlite3mc.wasm dart test -P web -r expanded # If browsers behave differently on different platforms, surely that's not our fault... # So, only run browser tests on Linux to be faster. diff --git a/integration_tests/flutter_libs/.gitignore b/integration_tests/flutter_libs/.gitignore index 24476c5d..6c319542 100644 --- a/integration_tests/flutter_libs/.gitignore +++ b/integration_tests/flutter_libs/.gitignore @@ -5,9 +5,11 @@ *.swp .DS_Store .atom/ +.build/ .buildlog/ .history .svn/ +.swiftpm/ migrate_working_dir/ # IntelliJ related diff --git a/integration_tests/flutter_libs/ios/Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage/Package.swift b/integration_tests/flutter_libs/ios/Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage/Package.swift new file mode 100644 index 00000000..85b0662b --- /dev/null +++ b/integration_tests/flutter_libs/ios/Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage/Package.swift @@ -0,0 +1,30 @@ +// swift-tools-version: 5.9 +// The swift-tools-version declares the minimum version of Swift required to build this package. +// +// Generated file. Do not edit. +// + +import PackageDescription + +let package = Package( + name: "FlutterGeneratedPluginSwiftPackage", + platforms: [ + .iOS("12.0") + ], + products: [ + .library(name: "FlutterGeneratedPluginSwiftPackage", type: .static, targets: ["FlutterGeneratedPluginSwiftPackage"]) + ], + dependencies: [ + .package(name: "integration_test", path: "/Users/simon/fvm/versions/master/packages/integration_test/ios/integration_test"), + .package(name: "sqlite3_flutter_libs", path: "/Users/simon/src/sqlite3.dart/sqlite3_flutter_libs/darwin/sqlite3_flutter_libs") + ], + targets: [ + .target( + name: "FlutterGeneratedPluginSwiftPackage", + dependencies: [ + .product(name: "integration-test", package: "integration_test"), + .product(name: "sqlite3-flutter-libs", package: "sqlite3_flutter_libs") + ] + ) + ] +) diff --git a/integration_tests/flutter_libs/ios/Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage/Sources/FlutterGeneratedPluginSwiftPackage/FlutterGeneratedPluginSwiftPackage.swift b/integration_tests/flutter_libs/ios/Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage/Sources/FlutterGeneratedPluginSwiftPackage/FlutterGeneratedPluginSwiftPackage.swift new file mode 100644 index 00000000..62e7b11a --- /dev/null +++ b/integration_tests/flutter_libs/ios/Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage/Sources/FlutterGeneratedPluginSwiftPackage/FlutterGeneratedPluginSwiftPackage.swift @@ -0,0 +1,3 @@ +// +// Generated file. Do not edit. +// diff --git a/integration_tests/flutter_libs/macos/Podfile.lock b/integration_tests/flutter_libs/macos/Podfile.lock index eadbb3f0..54819e8a 100644 --- a/integration_tests/flutter_libs/macos/Podfile.lock +++ b/integration_tests/flutter_libs/macos/Podfile.lock @@ -1,19 +1,23 @@ PODS: - FlutterMacOS (1.0.0) - - sqlite3 (3.44.0): - - sqlite3/common (= 3.44.0) - - sqlite3/common (3.44.0) - - sqlite3/fts5 (3.44.0): + - sqlite3 (3.47.0): + - sqlite3/common (= 3.47.0) + - sqlite3/common (3.47.0) + - sqlite3/dbstatvtab (3.47.0): - sqlite3/common - - sqlite3/perf-threadsafe (3.44.0): + - sqlite3/fts5 (3.47.0): - sqlite3/common - - sqlite3/rtree (3.44.0): + - sqlite3/perf-threadsafe (3.47.0): - sqlite3/common - - sqlite3/spellfix1 (3.44.0): + - sqlite3/rtree (3.47.0): + - sqlite3/common + - sqlite3/spellfix1 (3.47.0): - sqlite3/common - sqlite3_flutter_libs (0.0.1): + - Flutter - FlutterMacOS - - sqlite3 (~> 3.44.0) + - sqlite3 (~> 3.47.0) + - sqlite3/dbstatvtab - sqlite3/fts5 - sqlite3/perf-threadsafe - sqlite3/rtree @@ -21,7 +25,7 @@ PODS: DEPENDENCIES: - FlutterMacOS (from `Flutter/ephemeral`) - sqlite3/spellfix1 - - sqlite3_flutter_libs (from `Flutter/ephemeral/.symlinks/plugins/sqlite3_flutter_libs/macos`) + - sqlite3_flutter_libs (from `Flutter/ephemeral/.symlinks/plugins/sqlite3_flutter_libs/darwin`) SPEC REPOS: trunk: @@ -31,13 +35,13 @@ EXTERNAL SOURCES: FlutterMacOS: :path: Flutter/ephemeral sqlite3_flutter_libs: - :path: Flutter/ephemeral/.symlinks/plugins/sqlite3_flutter_libs/macos + :path: Flutter/ephemeral/.symlinks/plugins/sqlite3_flutter_libs/darwin SPEC CHECKSUMS: FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24 - sqlite3: 6e2d4a4879854d0ec86b476bf3c3e30870bac273 - sqlite3_flutter_libs: a25f3a0f522fdcd8fef6a4a50a3d681dd43d8dea + sqlite3: 0aa20658a9b238a3b1ff7175eb7bdd863b0ab4fd + sqlite3_flutter_libs: 4ed45d66960c84b1616c887c9818c832d4289092 PODFILE CHECKSUM: 61e9fedf3423d4f00828847139028f442a455364 -COCOAPODS: 1.14.2 +COCOAPODS: 1.14.3 diff --git a/integration_tests/flutter_libs/macos/Runner.xcodeproj/project.pbxproj b/integration_tests/flutter_libs/macos/Runner.xcodeproj/project.pbxproj index beb3aa62..3bbfbb29 100644 --- a/integration_tests/flutter_libs/macos/Runner.xcodeproj/project.pbxproj +++ b/integration_tests/flutter_libs/macos/Runner.xcodeproj/project.pbxproj @@ -27,6 +27,7 @@ 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; }; 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; }; C13042E460707A005C110913 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 91E41AE44FFF9BE5EAFC9EF5 /* Pods_Runner.framework */; }; + 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */ = {isa = PBXBuildFile; productRef = 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -80,6 +81,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */, C13042E460707A005C110913 /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -175,6 +177,9 @@ /* Begin PBXNativeTarget section */ 33CC10EC2044A3C60003C045 /* Runner */ = { + packageProductDependencies = ( + 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */, + ); isa = PBXNativeTarget; buildConfigurationList = 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( @@ -200,10 +205,13 @@ /* Begin PBXProject section */ 33CC10E52044A3C60003C045 /* Project object */ = { + packageReferences = ( + 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage" */, + ); isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0920; - LastUpgradeCheck = 1430; + LastUpgradeCheck = 1510; ORGANIZATIONNAME = ""; TargetAttributes = { 33CC10EC2044A3C60003C045 = { @@ -628,6 +636,18 @@ defaultConfigurationName = Release; }; /* End XCConfigurationList section */ +/* Begin XCLocalSwiftPackageReference section */ + 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage" */ = { + isa = XCLocalSwiftPackageReference; + relativePath = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; + }; +/* End XCLocalSwiftPackageReference section */ +/* Begin XCSwiftPackageProductDependency section */ + 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */ = { + isa = XCSwiftPackageProductDependency; + productName = FlutterGeneratedPluginSwiftPackage; + }; +/* End XCSwiftPackageProductDependency section */ }; rootObject = 33CC10E52044A3C60003C045 /* Project object */; } diff --git a/integration_tests/flutter_libs/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/integration_tests/flutter_libs/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved new file mode 100644 index 00000000..3a9ccda9 --- /dev/null +++ b/integration_tests/flutter_libs/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -0,0 +1,15 @@ +{ + "originHash" : "f753fb27fa26d31d71ae095b813ee3082cbd650203f170450c96e6158cc8e4cb", + "pins" : [ + { + "identity" : "csqlite", + "kind" : "remoteSourceControl", + "location" : "https://github.com/sbooth/CSQLite.git", + "state" : { + "revision" : "f9bc82fd757667a5d1819db4fbb073c97488eb85", + "version" : "3.47.1" + } + } + ], + "version" : 3 +} diff --git a/integration_tests/flutter_libs/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/integration_tests/flutter_libs/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index 8a26b65a..71b2615d 100644 --- a/integration_tests/flutter_libs/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/integration_tests/flutter_libs/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,10 +1,28 @@ + + + + + + + + + + diff --git a/integration_tests/flutter_libs/macos/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved b/integration_tests/flutter_libs/macos/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved new file mode 100644 index 00000000..3a9ccda9 --- /dev/null +++ b/integration_tests/flutter_libs/macos/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -0,0 +1,15 @@ +{ + "originHash" : "f753fb27fa26d31d71ae095b813ee3082cbd650203f170450c96e6158cc8e4cb", + "pins" : [ + { + "identity" : "csqlite", + "kind" : "remoteSourceControl", + "location" : "https://github.com/sbooth/CSQLite.git", + "state" : { + "revision" : "f9bc82fd757667a5d1819db4fbb073c97488eb85", + "version" : "3.47.1" + } + } + ], + "version" : 3 +} diff --git a/integration_tests/flutter_libs/macos/Runner/AppDelegate.swift b/integration_tests/flutter_libs/macos/Runner/AppDelegate.swift index d53ef643..b3c17614 100644 --- a/integration_tests/flutter_libs/macos/Runner/AppDelegate.swift +++ b/integration_tests/flutter_libs/macos/Runner/AppDelegate.swift @@ -1,9 +1,13 @@ import Cocoa import FlutterMacOS -@NSApplicationMain +@main class AppDelegate: FlutterAppDelegate { override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { return true } + + override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool { + return true + } } diff --git a/integration_tests/flutter_libs/pubspec.yaml b/integration_tests/flutter_libs/pubspec.yaml index c1397d33..0850849c 100644 --- a/integration_tests/flutter_libs/pubspec.yaml +++ b/integration_tests/flutter_libs/pubspec.yaml @@ -4,8 +4,12 @@ description: Integration tests for the sqlite3_flutter_libs package publish_to: 'none' version: 1.0.0+1 +flutter: + disable-swift-package-manager: true + environment: sdk: ^3.5.0 + flutter: ^3.24.0 dependencies: sqlite3_flutter_libs: diff --git a/integration_tests/flutter_libs_swiftpm/.gitignore b/integration_tests/flutter_libs_swiftpm/.gitignore new file mode 100644 index 00000000..79c113f9 --- /dev/null +++ b/integration_tests/flutter_libs_swiftpm/.gitignore @@ -0,0 +1,45 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.build/ +.buildlog/ +.history +.svn/ +.swiftpm/ +migrate_working_dir/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +**/doc/api/ +**/ios/Flutter/.last_build_id +.dart_tool/ +.flutter-plugins +.flutter-plugins-dependencies +.pub-cache/ +.pub/ +/build/ + +# Symbolication related +app.*.symbols + +# Obfuscation related +app.*.map.json + +# Android Studio will place build artifacts here +/android/app/debug +/android/app/profile +/android/app/release diff --git a/integration_tests/flutter_libs_swiftpm/.metadata b/integration_tests/flutter_libs_swiftpm/.metadata new file mode 100644 index 00000000..f9f60b24 --- /dev/null +++ b/integration_tests/flutter_libs_swiftpm/.metadata @@ -0,0 +1,45 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: "03aeaf158a7bb4b6b51fe8730a673829d64a517c" + channel: "master" + +project_type: app + +# Tracks metadata for the flutter migrate command +migration: + platforms: + - platform: root + create_revision: 03aeaf158a7bb4b6b51fe8730a673829d64a517c + base_revision: 03aeaf158a7bb4b6b51fe8730a673829d64a517c + - platform: android + create_revision: 03aeaf158a7bb4b6b51fe8730a673829d64a517c + base_revision: 03aeaf158a7bb4b6b51fe8730a673829d64a517c + - platform: ios + create_revision: 03aeaf158a7bb4b6b51fe8730a673829d64a517c + base_revision: 03aeaf158a7bb4b6b51fe8730a673829d64a517c + - platform: linux + create_revision: 03aeaf158a7bb4b6b51fe8730a673829d64a517c + base_revision: 03aeaf158a7bb4b6b51fe8730a673829d64a517c + - platform: macos + create_revision: 03aeaf158a7bb4b6b51fe8730a673829d64a517c + base_revision: 03aeaf158a7bb4b6b51fe8730a673829d64a517c + - platform: web + create_revision: 03aeaf158a7bb4b6b51fe8730a673829d64a517c + base_revision: 03aeaf158a7bb4b6b51fe8730a673829d64a517c + - platform: windows + create_revision: 03aeaf158a7bb4b6b51fe8730a673829d64a517c + base_revision: 03aeaf158a7bb4b6b51fe8730a673829d64a517c + + # User provided section + + # List of Local paths (relative to this file) that should be + # ignored by the migrate tool. + # + # Files that are not part of the templates will be ignored by default. + unmanaged_files: + - 'lib/main.dart' + - 'ios/Runner.xcodeproj/project.pbxproj' diff --git a/integration_tests/flutter_libs_swiftpm/README.md b/integration_tests/flutter_libs_swiftpm/README.md new file mode 100644 index 00000000..3d20349b --- /dev/null +++ b/integration_tests/flutter_libs_swiftpm/README.md @@ -0,0 +1,16 @@ +# flutter_libs_swiftpm + +A new Flutter project. + +## Getting Started + +This project is a starting point for a Flutter application. + +A few resources to get you started if this is your first Flutter project: + +- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab) +- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook) + +For help getting started with Flutter development, view the +[online documentation](https://docs.flutter.dev/), which offers tutorials, +samples, guidance on mobile development, and a full API reference. diff --git a/integration_tests/flutter_libs_swiftpm/analysis_options.yaml b/integration_tests/flutter_libs_swiftpm/analysis_options.yaml new file mode 100644 index 00000000..0d290213 --- /dev/null +++ b/integration_tests/flutter_libs_swiftpm/analysis_options.yaml @@ -0,0 +1,28 @@ +# This file configures the analyzer, which statically analyzes Dart code to +# check for errors, warnings, and lints. +# +# The issues identified by the analyzer are surfaced in the UI of Dart-enabled +# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be +# invoked from the command line by running `flutter analyze`. + +# The following line activates a set of recommended lints for Flutter apps, +# packages, and plugins designed to encourage good coding practices. +include: package:flutter_lints/flutter.yaml + +linter: + # The lint rules applied to this project can be customized in the + # section below to disable rules from the `package:flutter_lints/flutter.yaml` + # included above or to enable additional rules. A list of all available lints + # and their documentation is published at https://dart.dev/lints. + # + # Instead of disabling a lint rule for the entire project in the + # section below, it can also be suppressed for a single line of code + # or a specific dart file by using the `// ignore: name_of_lint` and + # `// ignore_for_file: name_of_lint` syntax on the line or in the file + # producing the lint. + rules: + # avoid_print: false # Uncomment to disable the `avoid_print` rule + # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule + +# Additional information about this file can be found at +# https://dart.dev/guides/language/analysis-options diff --git a/integration_tests/flutter_libs_swiftpm/integration_test/integration_test.dart b/integration_tests/flutter_libs_swiftpm/integration_test/integration_test.dart new file mode 100644 index 00000000..a89b1f12 --- /dev/null +++ b/integration_tests/flutter_libs_swiftpm/integration_test/integration_test.dart @@ -0,0 +1,135 @@ +import 'dart:ffi'; + +import 'package:integration_test/integration_test.dart'; +import 'package:test/test.dart'; +import 'package:sqlite3/sqlite3.dart'; +import 'package:sqlite3/src/ffi/sqlite3.g.dart' hide sqlite3; +import 'package:sqlite3/src/ffi/memory.dart'; +import 'package:sqlite3/open.dart'; + +typedef _sqlite3_compileoption_get_native = Pointer Function(Int32 n); +typedef _sqlite3_compileoption_get_dart = Pointer Function(int n); + +void main() { + IntegrationTestWidgetsFlutterBinding.ensureInitialized(); + + test('can open sqlite3', () { + print(sqlite3.version); + + final getCompileOption = open.openSqlite().lookupFunction< + _sqlite3_compileoption_get_native, + _sqlite3_compileoption_get_dart>('sqlite3_compileoption_get'); + + String? lastOption; + var i = 0; + do { + final ptr = getCompileOption(i).cast(); + + if (!ptr.isNullPointer) { + lastOption = ptr.readString(); + print('Compile-option: $lastOption'); + } else { + lastOption = null; + } + + i++; + } while (lastOption != null); + }); + + test('can open databases', () { + final db = sqlite3.openInMemory() + ..closeWhenDone() + ..execute('CREATE TABLE foo (bar)') + ..execute('INSERT INTO foo VALUES (1), (2)'); + + expect(db.select('SELECT * FROM foo'), [ + {'bar': 1}, + {'bar': 2}, + ]); + }); + + test('has json support', () { + final db = sqlite3.openInMemory()..closeWhenDone(); + expect(db.select("SELECT json('[1, 2, 3]') AS r;"), [ + {'r': '[1,2,3]'}, + ]); + }); + + test('has fts5 support', () { + final db = sqlite3.openInMemory()..closeWhenDone(); + + db.execute('CREATE VIRTUAL TABLE foo USING fts5 (a,b,c);'); + }); + + test('can create collation', () { + final db = sqlite3.openInMemory() + ..closeWhenDone() + ..execute('CREATE TABLE foo2 (bar)') + ..execute( + "INSERT INTO foo2 VALUES ('AaAaaaAA'), ('BBBbBb'),('cCCCcc '), (' dD ')"); + + /// Create a collation to compare String without extra-blank to the right and + /// ignoring case + db.createCollation( + name: "RTRIMNOCASE", + function: (String? a, String? b) { + // Combining nocase and rtrim + // + String? compareA = a?.toLowerCase().trimRight(); + String? compareB = b?.toLowerCase().trimRight(); + + if (compareA == null && compareB == null) { + return 0; + } else if (compareA == null) { + // a < b + return -1; + } else if (compareB == null) { + // a > b + return 1; + } else { + return compareA.compareTo(compareB); + } + }, + ); + + expect( + db.select( + "SELECT * FROM foo2 WHERE bar = 'aaaaAaAa ' COLLATE RTRIMNOCASE"), + [ + {'bar': 'AaAaaaAA'}, + ]); + + expect( + db.select( + "SELECT * FROM foo2 WHERE bar = 'bbbbbb' COLLATE RTRIMNOCASE"), + [ + {'bar': 'BBBbBb'}, + ]); + + expect( + db.select( + "SELECT * FROM foo2 WHERE bar = 'cCcccC' COLLATE RTRIMNOCASE"), + [ + {'bar': 'cCCCcc '}, + ]); + + expect(db.select("SELECT * FROM foo2 WHERE bar = 'dd' COLLATE RTRIMNOCASE"), + []); + }); + + test( + 'can use statically-linked extensions', + () { + sqlite3.ensureExtensionLoaded( + SqliteExtension.staticallyLinked('sqlite3_spellfix_init')); + + final db = sqlite3.openInMemory()..closeWhenDone(); + db.execute('CREATE VIRTUAL TABLE demo USING spellfix1;'); + }, + skip: 'Does not yet work with SwiftPM due to missing dependency', + ); +} + +extension on Database { + void closeWhenDone() => addTearDown(dispose); +} diff --git a/integration_tests/flutter_libs_swiftpm/ios/.gitignore b/integration_tests/flutter_libs_swiftpm/ios/.gitignore new file mode 100644 index 00000000..7a7f9873 --- /dev/null +++ b/integration_tests/flutter_libs_swiftpm/ios/.gitignore @@ -0,0 +1,34 @@ +**/dgph +*.mode1v3 +*.mode2v3 +*.moved-aside +*.pbxuser +*.perspectivev3 +**/*sync/ +.sconsign.dblite +.tags* +**/.vagrant/ +**/DerivedData/ +Icon? +**/Pods/ +**/.symlinks/ +profile +xcuserdata +**/.generated/ +Flutter/App.framework +Flutter/Flutter.framework +Flutter/Flutter.podspec +Flutter/Generated.xcconfig +Flutter/ephemeral/ +Flutter/app.flx +Flutter/app.zip +Flutter/flutter_assets/ +Flutter/flutter_export_environment.sh +ServiceDefinitions.json +Runner/GeneratedPluginRegistrant.* + +# Exceptions to above rules. +!default.mode1v3 +!default.mode2v3 +!default.pbxuser +!default.perspectivev3 diff --git a/integration_tests/flutter_libs_swiftpm/ios/Flutter/AppFrameworkInfo.plist b/integration_tests/flutter_libs_swiftpm/ios/Flutter/AppFrameworkInfo.plist new file mode 100644 index 00000000..7c569640 --- /dev/null +++ b/integration_tests/flutter_libs_swiftpm/ios/Flutter/AppFrameworkInfo.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + App + CFBundleIdentifier + io.flutter.flutter.app + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + App + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + MinimumOSVersion + 12.0 + + diff --git a/integration_tests/flutter_libs_swiftpm/ios/Flutter/Debug.xcconfig b/integration_tests/flutter_libs_swiftpm/ios/Flutter/Debug.xcconfig new file mode 100644 index 00000000..592ceee8 --- /dev/null +++ b/integration_tests/flutter_libs_swiftpm/ios/Flutter/Debug.xcconfig @@ -0,0 +1 @@ +#include "Generated.xcconfig" diff --git a/integration_tests/flutter_libs_swiftpm/ios/Flutter/Release.xcconfig b/integration_tests/flutter_libs_swiftpm/ios/Flutter/Release.xcconfig new file mode 100644 index 00000000..592ceee8 --- /dev/null +++ b/integration_tests/flutter_libs_swiftpm/ios/Flutter/Release.xcconfig @@ -0,0 +1 @@ +#include "Generated.xcconfig" diff --git a/integration_tests/flutter_libs_swiftpm/ios/Runner.xcodeproj/project.pbxproj b/integration_tests/flutter_libs_swiftpm/ios/Runner.xcodeproj/project.pbxproj new file mode 100644 index 00000000..75c165ef --- /dev/null +++ b/integration_tests/flutter_libs_swiftpm/ios/Runner.xcodeproj/project.pbxproj @@ -0,0 +1,638 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 54; + objects = { + +/* Begin PBXBuildFile section */ + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; + 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; }; + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; + 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */ = {isa = PBXBuildFile; productRef = 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */; }; + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 331C8085294A63A400263BE5 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 97C146E61CF9000F007C117D /* Project object */; + proxyType = 1; + remoteGlobalIDString = 97C146ED1CF9000F007C117D; + remoteInfo = Runner; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 9705A1C41CF9048500538489 /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; + 331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; + 331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; + 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; + 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; + 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 97C146EB1CF9000F007C117D /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 331C8082294A63A400263BE5 /* RunnerTests */ = { + isa = PBXGroup; + children = ( + 331C807B294A618700263BE5 /* RunnerTests.swift */, + ); + path = RunnerTests; + sourceTree = ""; + }; + 9740EEB11CF90186004384FC /* Flutter */ = { + isa = PBXGroup; + children = ( + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, + 9740EEB21CF90195004384FC /* Debug.xcconfig */, + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, + 9740EEB31CF90195004384FC /* Generated.xcconfig */, + ); + name = Flutter; + sourceTree = ""; + }; + 97C146E51CF9000F007C117D = { + isa = PBXGroup; + children = ( + 9740EEB11CF90186004384FC /* Flutter */, + 97C146F01CF9000F007C117D /* Runner */, + 97C146EF1CF9000F007C117D /* Products */, + 331C8082294A63A400263BE5 /* RunnerTests */, + ); + sourceTree = ""; + }; + 97C146EF1CF9000F007C117D /* Products */ = { + isa = PBXGroup; + children = ( + 97C146EE1CF9000F007C117D /* Runner.app */, + 331C8081294A63A400263BE5 /* RunnerTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 97C146F01CF9000F007C117D /* Runner */ = { + isa = PBXGroup; + children = ( + 97C146FA1CF9000F007C117D /* Main.storyboard */, + 97C146FD1CF9000F007C117D /* Assets.xcassets */, + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, + 97C147021CF9000F007C117D /* Info.plist */, + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, + ); + path = Runner; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 331C8080294A63A400263BE5 /* RunnerTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; + buildPhases = ( + 331C807D294A63A400263BE5 /* Sources */, + 331C807F294A63A400263BE5 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 331C8086294A63A400263BE5 /* PBXTargetDependency */, + ); + name = RunnerTests; + productName = RunnerTests; + productReference = 331C8081294A63A400263BE5 /* RunnerTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + 97C146ED1CF9000F007C117D /* Runner */ = { + isa = PBXNativeTarget; + buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; + buildPhases = ( + 9740EEB61CF901F6004384FC /* Run Script */, + 97C146EA1CF9000F007C117D /* Sources */, + 97C146EB1CF9000F007C117D /* Frameworks */, + 97C146EC1CF9000F007C117D /* Resources */, + 9705A1C41CF9048500538489 /* Embed Frameworks */, + 3B06AD1E1E4923F5004D2608 /* Thin Binary */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Runner; + packageProductDependencies = ( + 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */, + ); + productName = Runner; + productReference = 97C146EE1CF9000F007C117D /* Runner.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 97C146E61CF9000F007C117D /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = YES; + LastUpgradeCheck = 1510; + ORGANIZATIONNAME = ""; + TargetAttributes = { + 331C8080294A63A400263BE5 = { + CreatedOnToolsVersion = 14.0; + TestTargetID = 97C146ED1CF9000F007C117D; + }; + 97C146ED1CF9000F007C117D = { + CreatedOnToolsVersion = 7.3.1; + LastSwiftMigration = 1100; + }; + }; + }; + buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 97C146E51CF9000F007C117D; + packageReferences = ( + 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage" */, + ); + productRefGroup = 97C146EF1CF9000F007C117D /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 97C146ED1CF9000F007C117D /* Runner */, + 331C8080294A63A400263BE5 /* RunnerTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 331C807F294A63A400263BE5 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 97C146EC1CF9000F007C117D /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", + ); + name = "Thin Binary"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; + }; + 9740EEB61CF901F6004384FC /* Run Script */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Run Script"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 331C807D294A63A400263BE5 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 97C146EA1CF9000F007C117D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 331C8086294A63A400263BE5 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 97C146ED1CF9000F007C117D /* Runner */; + targetProxy = 331C8085294A63A400263BE5 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 97C146FA1CF9000F007C117D /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C146FB1CF9000F007C117D /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C147001CF9000F007C117D /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 249021D3217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Profile; + }; + 249021D4217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterLibsSwiftpm; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Profile; + }; + 331C8088294A63A400263BE5 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterLibsSwiftpm.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; + }; + name = Debug; + }; + 331C8089294A63A400263BE5 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterLibsSwiftpm.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; + }; + name = Release; + }; + 331C808A294A63A400263BE5 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterLibsSwiftpm.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; + }; + name = Profile; + }; + 97C147031CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 97C147041CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 97C147061CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterLibsSwiftpm; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Debug; + }; + 97C147071CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterLibsSwiftpm; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 331C8088294A63A400263BE5 /* Debug */, + 331C8089294A63A400263BE5 /* Release */, + 331C808A294A63A400263BE5 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147031CF9000F007C117D /* Debug */, + 97C147041CF9000F007C117D /* Release */, + 249021D3217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147061CF9000F007C117D /* Debug */, + 97C147071CF9000F007C117D /* Release */, + 249021D4217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + +/* Begin XCLocalSwiftPackageReference section */ + 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage" */ = { + isa = XCLocalSwiftPackageReference; + relativePath = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; + }; +/* End XCLocalSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */ = { + isa = XCSwiftPackageProductDependency; + productName = FlutterGeneratedPluginSwiftPackage; + }; +/* End XCSwiftPackageProductDependency section */ + }; + rootObject = 97C146E61CF9000F007C117D /* Project object */; +} diff --git a/integration_tests/flutter_libs_swiftpm/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/integration_tests/flutter_libs_swiftpm/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 00000000..919434a6 --- /dev/null +++ b/integration_tests/flutter_libs_swiftpm/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/integration_tests/flutter_libs_swiftpm/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/integration_tests/flutter_libs_swiftpm/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 00000000..18d98100 --- /dev/null +++ b/integration_tests/flutter_libs_swiftpm/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/integration_tests/flutter_libs_swiftpm/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/integration_tests/flutter_libs_swiftpm/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 00000000..f9b0d7c5 --- /dev/null +++ b/integration_tests/flutter_libs_swiftpm/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/integration_tests/flutter_libs_swiftpm/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/integration_tests/flutter_libs_swiftpm/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme new file mode 100644 index 00000000..d795332e --- /dev/null +++ b/integration_tests/flutter_libs_swiftpm/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/integration_tests/flutter_libs_swiftpm/ios/Runner.xcworkspace/contents.xcworkspacedata b/integration_tests/flutter_libs_swiftpm/ios/Runner.xcworkspace/contents.xcworkspacedata new file mode 100644 index 00000000..1d526a16 --- /dev/null +++ b/integration_tests/flutter_libs_swiftpm/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/integration_tests/flutter_libs_swiftpm/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/integration_tests/flutter_libs_swiftpm/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 00000000..18d98100 --- /dev/null +++ b/integration_tests/flutter_libs_swiftpm/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/integration_tests/flutter_libs_swiftpm/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/integration_tests/flutter_libs_swiftpm/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 00000000..f9b0d7c5 --- /dev/null +++ b/integration_tests/flutter_libs_swiftpm/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/integration_tests/flutter_libs_swiftpm/ios/Runner/AppDelegate.swift b/integration_tests/flutter_libs_swiftpm/ios/Runner/AppDelegate.swift new file mode 100644 index 00000000..62666446 --- /dev/null +++ b/integration_tests/flutter_libs_swiftpm/ios/Runner/AppDelegate.swift @@ -0,0 +1,13 @@ +import Flutter +import UIKit + +@main +@objc class AppDelegate: FlutterAppDelegate { + override func application( + _ application: UIApplication, + didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? + ) -> Bool { + GeneratedPluginRegistrant.register(with: self) + return super.application(application, didFinishLaunchingWithOptions: launchOptions) + } +} diff --git a/integration_tests/flutter_libs_swiftpm/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/integration_tests/flutter_libs_swiftpm/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 00000000..d36b1fab --- /dev/null +++ b/integration_tests/flutter_libs_swiftpm/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,122 @@ +{ + "images" : [ + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@3x.png", + "scale" : "3x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@3x.png", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@3x.png", + "scale" : "3x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@2x.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@3x.png", + "scale" : "3x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@1x.png", + "scale" : "1x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@1x.png", + "scale" : "1x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@1x.png", + "scale" : "1x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@2x.png", + "scale" : "2x" + }, + { + "size" : "83.5x83.5", + "idiom" : "ipad", + "filename" : "Icon-App-83.5x83.5@2x.png", + "scale" : "2x" + }, + { + "size" : "1024x1024", + "idiom" : "ios-marketing", + "filename" : "Icon-App-1024x1024@1x.png", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/integration_tests/flutter_libs_swiftpm/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/integration_tests/flutter_libs_swiftpm/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png new file mode 100644 index 00000000..dc9ada47 Binary files /dev/null and b/integration_tests/flutter_libs_swiftpm/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png differ diff --git a/integration_tests/flutter_libs_swiftpm/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/integration_tests/flutter_libs_swiftpm/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png new file mode 100644 index 00000000..7353c41e Binary files /dev/null and b/integration_tests/flutter_libs_swiftpm/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png differ diff --git a/integration_tests/flutter_libs_swiftpm/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/integration_tests/flutter_libs_swiftpm/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png new file mode 100644 index 00000000..797d452e Binary files /dev/null and b/integration_tests/flutter_libs_swiftpm/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png differ diff --git a/integration_tests/flutter_libs_swiftpm/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/integration_tests/flutter_libs_swiftpm/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png new file mode 100644 index 00000000..6ed2d933 Binary files /dev/null and b/integration_tests/flutter_libs_swiftpm/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png differ diff --git a/integration_tests/flutter_libs_swiftpm/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/integration_tests/flutter_libs_swiftpm/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png new file mode 100644 index 00000000..4cd7b009 Binary files /dev/null and b/integration_tests/flutter_libs_swiftpm/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png differ diff --git a/integration_tests/flutter_libs_swiftpm/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/integration_tests/flutter_libs_swiftpm/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png new file mode 100644 index 00000000..fe730945 Binary files /dev/null and b/integration_tests/flutter_libs_swiftpm/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png differ diff --git a/integration_tests/flutter_libs_swiftpm/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/integration_tests/flutter_libs_swiftpm/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png new file mode 100644 index 00000000..321773cd Binary files /dev/null and b/integration_tests/flutter_libs_swiftpm/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png differ diff --git a/integration_tests/flutter_libs_swiftpm/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/integration_tests/flutter_libs_swiftpm/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png new file mode 100644 index 00000000..797d452e Binary files /dev/null and b/integration_tests/flutter_libs_swiftpm/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png differ diff --git a/integration_tests/flutter_libs_swiftpm/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/integration_tests/flutter_libs_swiftpm/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png new file mode 100644 index 00000000..502f463a Binary files /dev/null and b/integration_tests/flutter_libs_swiftpm/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png differ diff --git a/integration_tests/flutter_libs_swiftpm/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/integration_tests/flutter_libs_swiftpm/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png new file mode 100644 index 00000000..0ec30343 Binary files /dev/null and b/integration_tests/flutter_libs_swiftpm/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png differ diff --git a/integration_tests/flutter_libs_swiftpm/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/integration_tests/flutter_libs_swiftpm/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png new file mode 100644 index 00000000..0ec30343 Binary files /dev/null and b/integration_tests/flutter_libs_swiftpm/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png differ diff --git a/integration_tests/flutter_libs_swiftpm/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/integration_tests/flutter_libs_swiftpm/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png new file mode 100644 index 00000000..e9f5fea2 Binary files /dev/null and b/integration_tests/flutter_libs_swiftpm/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png differ diff --git a/integration_tests/flutter_libs_swiftpm/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/integration_tests/flutter_libs_swiftpm/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png new file mode 100644 index 00000000..84ac32ae Binary files /dev/null and b/integration_tests/flutter_libs_swiftpm/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png differ diff --git a/integration_tests/flutter_libs_swiftpm/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/integration_tests/flutter_libs_swiftpm/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png new file mode 100644 index 00000000..8953cba0 Binary files /dev/null and b/integration_tests/flutter_libs_swiftpm/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png differ diff --git a/integration_tests/flutter_libs_swiftpm/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/integration_tests/flutter_libs_swiftpm/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png new file mode 100644 index 00000000..0467bf12 Binary files /dev/null and b/integration_tests/flutter_libs_swiftpm/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ diff --git a/integration_tests/flutter_libs_swiftpm/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/integration_tests/flutter_libs_swiftpm/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json new file mode 100644 index 00000000..0bedcf2f --- /dev/null +++ b/integration_tests/flutter_libs_swiftpm/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "LaunchImage.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/integration_tests/flutter_libs_swiftpm/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/integration_tests/flutter_libs_swiftpm/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png new file mode 100644 index 00000000..9da19eac Binary files /dev/null and b/integration_tests/flutter_libs_swiftpm/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png differ diff --git a/integration_tests/flutter_libs_swiftpm/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/integration_tests/flutter_libs_swiftpm/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png new file mode 100644 index 00000000..9da19eac Binary files /dev/null and b/integration_tests/flutter_libs_swiftpm/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png differ diff --git a/integration_tests/flutter_libs_swiftpm/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/integration_tests/flutter_libs_swiftpm/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png new file mode 100644 index 00000000..9da19eac Binary files /dev/null and b/integration_tests/flutter_libs_swiftpm/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png differ diff --git a/integration_tests/flutter_libs_swiftpm/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/integration_tests/flutter_libs_swiftpm/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md new file mode 100644 index 00000000..89c2725b --- /dev/null +++ b/integration_tests/flutter_libs_swiftpm/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md @@ -0,0 +1,5 @@ +# Launch Screen Assets + +You can customize the launch screen with your own desired assets by replacing the image files in this directory. + +You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. \ No newline at end of file diff --git a/integration_tests/flutter_libs_swiftpm/ios/Runner/Base.lproj/LaunchScreen.storyboard b/integration_tests/flutter_libs_swiftpm/ios/Runner/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 00000000..f2e259c7 --- /dev/null +++ b/integration_tests/flutter_libs_swiftpm/ios/Runner/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/integration_tests/flutter_libs_swiftpm/ios/Runner/Base.lproj/Main.storyboard b/integration_tests/flutter_libs_swiftpm/ios/Runner/Base.lproj/Main.storyboard new file mode 100644 index 00000000..f3c28516 --- /dev/null +++ b/integration_tests/flutter_libs_swiftpm/ios/Runner/Base.lproj/Main.storyboard @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/integration_tests/flutter_libs_swiftpm/ios/Runner/Info.plist b/integration_tests/flutter_libs_swiftpm/ios/Runner/Info.plist new file mode 100644 index 00000000..0e3e74c5 --- /dev/null +++ b/integration_tests/flutter_libs_swiftpm/ios/Runner/Info.plist @@ -0,0 +1,49 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleDisplayName + Flutter Libs Swiftpm + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + flutter_libs_swiftpm + CFBundlePackageType + APPL + CFBundleShortVersionString + $(FLUTTER_BUILD_NAME) + CFBundleSignature + ???? + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + CADisableMinimumFrameDurationOnPhone + + UIApplicationSupportsIndirectInputEvents + + + diff --git a/integration_tests/flutter_libs_swiftpm/ios/Runner/Runner-Bridging-Header.h b/integration_tests/flutter_libs_swiftpm/ios/Runner/Runner-Bridging-Header.h new file mode 100644 index 00000000..308a2a56 --- /dev/null +++ b/integration_tests/flutter_libs_swiftpm/ios/Runner/Runner-Bridging-Header.h @@ -0,0 +1 @@ +#import "GeneratedPluginRegistrant.h" diff --git a/integration_tests/flutter_libs_swiftpm/ios/RunnerTests/RunnerTests.swift b/integration_tests/flutter_libs_swiftpm/ios/RunnerTests/RunnerTests.swift new file mode 100644 index 00000000..86a7c3b1 --- /dev/null +++ b/integration_tests/flutter_libs_swiftpm/ios/RunnerTests/RunnerTests.swift @@ -0,0 +1,12 @@ +import Flutter +import UIKit +import XCTest + +class RunnerTests: XCTestCase { + + func testExample() { + // If you add code to the Runner application, consider adding tests here. + // See https://developer.apple.com/documentation/xctest for more information about using XCTest. + } + +} diff --git a/integration_tests/flutter_libs_swiftpm/macos/.gitignore b/integration_tests/flutter_libs_swiftpm/macos/.gitignore new file mode 100644 index 00000000..746adbb6 --- /dev/null +++ b/integration_tests/flutter_libs_swiftpm/macos/.gitignore @@ -0,0 +1,7 @@ +# Flutter-related +**/Flutter/ephemeral/ +**/Pods/ + +# Xcode-related +**/dgph +**/xcuserdata/ diff --git a/integration_tests/flutter_libs_swiftpm/macos/Flutter/Flutter-Debug.xcconfig b/integration_tests/flutter_libs_swiftpm/macos/Flutter/Flutter-Debug.xcconfig new file mode 100644 index 00000000..c2efd0b6 --- /dev/null +++ b/integration_tests/flutter_libs_swiftpm/macos/Flutter/Flutter-Debug.xcconfig @@ -0,0 +1 @@ +#include "ephemeral/Flutter-Generated.xcconfig" diff --git a/integration_tests/flutter_libs_swiftpm/macos/Flutter/Flutter-Release.xcconfig b/integration_tests/flutter_libs_swiftpm/macos/Flutter/Flutter-Release.xcconfig new file mode 100644 index 00000000..c2efd0b6 --- /dev/null +++ b/integration_tests/flutter_libs_swiftpm/macos/Flutter/Flutter-Release.xcconfig @@ -0,0 +1 @@ +#include "ephemeral/Flutter-Generated.xcconfig" diff --git a/integration_tests/flutter_libs_swiftpm/macos/Flutter/GeneratedPluginRegistrant.swift b/integration_tests/flutter_libs_swiftpm/macos/Flutter/GeneratedPluginRegistrant.swift new file mode 100644 index 00000000..a76a051a --- /dev/null +++ b/integration_tests/flutter_libs_swiftpm/macos/Flutter/GeneratedPluginRegistrant.swift @@ -0,0 +1,12 @@ +// +// Generated file. Do not edit. +// + +import FlutterMacOS +import Foundation + +import sqlite3_flutter_libs + +func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { + Sqlite3FlutterLibsPlugin.register(with: registry.registrar(forPlugin: "Sqlite3FlutterLibsPlugin")) +} diff --git a/integration_tests/flutter_libs_swiftpm/macos/Runner.xcodeproj/project.pbxproj b/integration_tests/flutter_libs_swiftpm/macos/Runner.xcodeproj/project.pbxproj new file mode 100644 index 00000000..d99e292f --- /dev/null +++ b/integration_tests/flutter_libs_swiftpm/macos/Runner.xcodeproj/project.pbxproj @@ -0,0 +1,727 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 54; + objects = { + +/* Begin PBXAggregateTarget section */ + 33CC111A2044C6BA0003C045 /* Flutter Assemble */ = { + isa = PBXAggregateTarget; + buildConfigurationList = 33CC111B2044C6BA0003C045 /* Build configuration list for PBXAggregateTarget "Flutter Assemble" */; + buildPhases = ( + 33CC111E2044C6BF0003C045 /* ShellScript */, + ); + dependencies = ( + ); + name = "Flutter Assemble"; + productName = FLX; + }; +/* End PBXAggregateTarget section */ + +/* Begin PBXBuildFile section */ + 331C80D8294CF71000263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C80D7294CF71000263BE5 /* RunnerTests.swift */; }; + 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */; }; + 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC10F02044A3C60003C045 /* AppDelegate.swift */; }; + 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; }; + 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; }; + 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; }; + 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */ = {isa = PBXBuildFile; productRef = 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 331C80D9294CF71000263BE5 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 33CC10E52044A3C60003C045 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 33CC10EC2044A3C60003C045; + remoteInfo = Runner; + }; + 33CC111F2044C79F0003C045 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 33CC10E52044A3C60003C045 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 33CC111A2044C6BA0003C045; + remoteInfo = FLX; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 33CC110E2044A8840003C045 /* Bundle Framework */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + ); + name = "Bundle Framework"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 331C80D5294CF71000263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 331C80D7294CF71000263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; + 333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = ""; }; + 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = ""; }; + 33CC10ED2044A3C60003C045 /* flutter_libs_swiftpm.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "flutter_libs_swiftpm.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = ""; }; + 33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; + 33CC10F72044A3C60003C045 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = Runner/Info.plist; sourceTree = ""; }; + 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainFlutterWindow.swift; sourceTree = ""; }; + 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Debug.xcconfig"; sourceTree = ""; }; + 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Release.xcconfig"; sourceTree = ""; }; + 33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = "Flutter-Generated.xcconfig"; path = "ephemeral/Flutter-Generated.xcconfig"; sourceTree = ""; }; + 33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = ""; }; + 33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = ""; }; + 33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = ""; }; + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; }; + 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 331C80D2294CF70F00263BE5 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 33CC10EA2044A3C60003C045 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 331C80D6294CF71000263BE5 /* RunnerTests */ = { + isa = PBXGroup; + children = ( + 331C80D7294CF71000263BE5 /* RunnerTests.swift */, + ); + path = RunnerTests; + sourceTree = ""; + }; + 33BA886A226E78AF003329D5 /* Configs */ = { + isa = PBXGroup; + children = ( + 33E5194F232828860026EE4D /* AppInfo.xcconfig */, + 9740EEB21CF90195004384FC /* Debug.xcconfig */, + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, + 333000ED22D3DE5D00554162 /* Warnings.xcconfig */, + ); + path = Configs; + sourceTree = ""; + }; + 33CC10E42044A3C60003C045 = { + isa = PBXGroup; + children = ( + 33FAB671232836740065AC1E /* Runner */, + 33CEB47122A05771004F2AC0 /* Flutter */, + 331C80D6294CF71000263BE5 /* RunnerTests */, + 33CC10EE2044A3C60003C045 /* Products */, + D73912EC22F37F3D000D13A0 /* Frameworks */, + ); + sourceTree = ""; + }; + 33CC10EE2044A3C60003C045 /* Products */ = { + isa = PBXGroup; + children = ( + 33CC10ED2044A3C60003C045 /* flutter_libs_swiftpm.app */, + 331C80D5294CF71000263BE5 /* RunnerTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 33CC11242044D66E0003C045 /* Resources */ = { + isa = PBXGroup; + children = ( + 33CC10F22044A3C60003C045 /* Assets.xcassets */, + 33CC10F42044A3C60003C045 /* MainMenu.xib */, + 33CC10F72044A3C60003C045 /* Info.plist */, + ); + name = Resources; + path = ..; + sourceTree = ""; + }; + 33CEB47122A05771004F2AC0 /* Flutter */ = { + isa = PBXGroup; + children = ( + 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */, + 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */, + 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */, + 33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */, + ); + path = Flutter; + sourceTree = ""; + }; + 33FAB671232836740065AC1E /* Runner */ = { + isa = PBXGroup; + children = ( + 33CC10F02044A3C60003C045 /* AppDelegate.swift */, + 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */, + 33E51913231747F40026EE4D /* DebugProfile.entitlements */, + 33E51914231749380026EE4D /* Release.entitlements */, + 33CC11242044D66E0003C045 /* Resources */, + 33BA886A226E78AF003329D5 /* Configs */, + ); + path = Runner; + sourceTree = ""; + }; + D73912EC22F37F3D000D13A0 /* Frameworks */ = { + isa = PBXGroup; + children = ( + ); + name = Frameworks; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 331C80D4294CF70F00263BE5 /* RunnerTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 331C80DE294CF71000263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; + buildPhases = ( + 331C80D1294CF70F00263BE5 /* Sources */, + 331C80D2294CF70F00263BE5 /* Frameworks */, + 331C80D3294CF70F00263BE5 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 331C80DA294CF71000263BE5 /* PBXTargetDependency */, + ); + name = RunnerTests; + productName = RunnerTests; + productReference = 331C80D5294CF71000263BE5 /* RunnerTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + 33CC10EC2044A3C60003C045 /* Runner */ = { + isa = PBXNativeTarget; + buildConfigurationList = 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */; + buildPhases = ( + 33CC10E92044A3C60003C045 /* Sources */, + 33CC10EA2044A3C60003C045 /* Frameworks */, + 33CC10EB2044A3C60003C045 /* Resources */, + 33CC110E2044A8840003C045 /* Bundle Framework */, + 3399D490228B24CF009A79C7 /* ShellScript */, + ); + buildRules = ( + ); + dependencies = ( + 33CC11202044C79F0003C045 /* PBXTargetDependency */, + ); + name = Runner; + packageProductDependencies = ( + 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */, + ); + productName = Runner; + productReference = 33CC10ED2044A3C60003C045 /* flutter_libs_swiftpm.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 33CC10E52044A3C60003C045 /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = YES; + LastSwiftUpdateCheck = 0920; + LastUpgradeCheck = 1510; + ORGANIZATIONNAME = ""; + TargetAttributes = { + 331C80D4294CF70F00263BE5 = { + CreatedOnToolsVersion = 14.0; + TestTargetID = 33CC10EC2044A3C60003C045; + }; + 33CC10EC2044A3C60003C045 = { + CreatedOnToolsVersion = 9.2; + LastSwiftMigration = 1100; + ProvisioningStyle = Automatic; + SystemCapabilities = { + com.apple.Sandbox = { + enabled = 1; + }; + }; + }; + 33CC111A2044C6BA0003C045 = { + CreatedOnToolsVersion = 9.2; + ProvisioningStyle = Manual; + }; + }; + }; + buildConfigurationList = 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 33CC10E42044A3C60003C045; + packageReferences = ( + 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage" */, + ); + productRefGroup = 33CC10EE2044A3C60003C045 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 33CC10EC2044A3C60003C045 /* Runner */, + 331C80D4294CF70F00263BE5 /* RunnerTests */, + 33CC111A2044C6BA0003C045 /* Flutter Assemble */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 331C80D3294CF70F00263BE5 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 33CC10EB2044A3C60003C045 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */, + 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 3399D490228B24CF009A79C7 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "echo \"$PRODUCT_NAME.app\" > \"$PROJECT_DIR\"/Flutter/ephemeral/.app_filename && \"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh embed\n"; + }; + 33CC111E2044C6BF0003C045 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + Flutter/ephemeral/FlutterInputs.xcfilelist, + ); + inputPaths = ( + Flutter/ephemeral/tripwire, + ); + outputFileListPaths = ( + Flutter/ephemeral/FlutterOutputs.xcfilelist, + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 331C80D1294CF70F00263BE5 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 331C80D8294CF71000263BE5 /* RunnerTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 33CC10E92044A3C60003C045 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */, + 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */, + 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 331C80DA294CF71000263BE5 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 33CC10EC2044A3C60003C045 /* Runner */; + targetProxy = 331C80D9294CF71000263BE5 /* PBXContainerItemProxy */; + }; + 33CC11202044C79F0003C045 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 33CC111A2044C6BA0003C045 /* Flutter Assemble */; + targetProxy = 33CC111F2044C79F0003C045 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 33CC10F42044A3C60003C045 /* MainMenu.xib */ = { + isa = PBXVariantGroup; + children = ( + 33CC10F52044A3C60003C045 /* Base */, + ); + name = MainMenu.xib; + path = Runner; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 331C80DB294CF71000263BE5 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterLibsSwiftpm.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/flutter_libs_swiftpm.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/flutter_libs_swiftpm"; + }; + name = Debug; + }; + 331C80DC294CF71000263BE5 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterLibsSwiftpm.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/flutter_libs_swiftpm.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/flutter_libs_swiftpm"; + }; + name = Release; + }; + 331C80DD294CF71000263BE5 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterLibsSwiftpm.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/flutter_libs_swiftpm.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/flutter_libs_swiftpm"; + }; + name = Profile; + }; + 338D0CE9231458BD00FA5F75 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.14; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = macosx; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + }; + name = Profile; + }; + 338D0CEA231458BD00FA5F75 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 5.0; + }; + name = Profile; + }; + 338D0CEB231458BD00FA5F75 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Manual; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Profile; + }; + 33CC10F92044A3C60003C045 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = YES; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.14; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 33CC10FA2044A3C60003C045 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.14; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = macosx; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + }; + name = Release; + }; + 33CC10FC2044A3C60003C045 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + }; + name = Debug; + }; + 33CC10FD2044A3C60003C045 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/Release.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 5.0; + }; + name = Release; + }; + 33CC111C2044C6BA0003C045 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Manual; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 33CC111D2044C6BA0003C045 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 331C80DE294CF71000263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 331C80DB294CF71000263BE5 /* Debug */, + 331C80DC294CF71000263BE5 /* Release */, + 331C80DD294CF71000263BE5 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 33CC10F92044A3C60003C045 /* Debug */, + 33CC10FA2044A3C60003C045 /* Release */, + 338D0CE9231458BD00FA5F75 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 33CC10FC2044A3C60003C045 /* Debug */, + 33CC10FD2044A3C60003C045 /* Release */, + 338D0CEA231458BD00FA5F75 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 33CC111B2044C6BA0003C045 /* Build configuration list for PBXAggregateTarget "Flutter Assemble" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 33CC111C2044C6BA0003C045 /* Debug */, + 33CC111D2044C6BA0003C045 /* Release */, + 338D0CEB231458BD00FA5F75 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + +/* Begin XCLocalSwiftPackageReference section */ + 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage" */ = { + isa = XCLocalSwiftPackageReference; + relativePath = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; + }; +/* End XCLocalSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */ = { + isa = XCSwiftPackageProductDependency; + productName = FlutterGeneratedPluginSwiftPackage; + }; +/* End XCSwiftPackageProductDependency section */ + }; + rootObject = 33CC10E52044A3C60003C045 /* Project object */; +} diff --git a/integration_tests/flutter_libs_swiftpm/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/integration_tests/flutter_libs_swiftpm/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 00000000..18d98100 --- /dev/null +++ b/integration_tests/flutter_libs_swiftpm/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/integration_tests/flutter_libs_swiftpm/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/integration_tests/flutter_libs_swiftpm/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved new file mode 100644 index 00000000..cbb27e9c --- /dev/null +++ b/integration_tests/flutter_libs_swiftpm/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -0,0 +1,15 @@ +{ + "originHash" : "30f045e70ea1d033f7e25465f217a8f22ba8aae829e8bb9811c4c6e40ec5bf75", + "pins" : [ + { + "identity" : "csqlite", + "kind" : "remoteSourceControl", + "location" : "https://github.com/sbooth/CSQLite.git", + "state" : { + "revision" : "f9bc82fd757667a5d1819db4fbb073c97488eb85", + "version" : "3.47.1" + } + } + ], + "version" : 3 +} diff --git a/integration_tests/flutter_libs_swiftpm/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/integration_tests/flutter_libs_swiftpm/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme new file mode 100644 index 00000000..389a50f5 --- /dev/null +++ b/integration_tests/flutter_libs_swiftpm/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/integration_tests/flutter_libs_swiftpm/macos/Runner.xcworkspace/contents.xcworkspacedata b/integration_tests/flutter_libs_swiftpm/macos/Runner.xcworkspace/contents.xcworkspacedata new file mode 100644 index 00000000..1d526a16 --- /dev/null +++ b/integration_tests/flutter_libs_swiftpm/macos/Runner.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/integration_tests/flutter_libs_swiftpm/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/integration_tests/flutter_libs_swiftpm/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 00000000..18d98100 --- /dev/null +++ b/integration_tests/flutter_libs_swiftpm/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/integration_tests/flutter_libs_swiftpm/macos/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved b/integration_tests/flutter_libs_swiftpm/macos/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved new file mode 100644 index 00000000..cbb27e9c --- /dev/null +++ b/integration_tests/flutter_libs_swiftpm/macos/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -0,0 +1,15 @@ +{ + "originHash" : "30f045e70ea1d033f7e25465f217a8f22ba8aae829e8bb9811c4c6e40ec5bf75", + "pins" : [ + { + "identity" : "csqlite", + "kind" : "remoteSourceControl", + "location" : "https://github.com/sbooth/CSQLite.git", + "state" : { + "revision" : "f9bc82fd757667a5d1819db4fbb073c97488eb85", + "version" : "3.47.1" + } + } + ], + "version" : 3 +} diff --git a/integration_tests/flutter_libs_swiftpm/macos/Runner/AppDelegate.swift b/integration_tests/flutter_libs_swiftpm/macos/Runner/AppDelegate.swift new file mode 100644 index 00000000..b3c17614 --- /dev/null +++ b/integration_tests/flutter_libs_swiftpm/macos/Runner/AppDelegate.swift @@ -0,0 +1,13 @@ +import Cocoa +import FlutterMacOS + +@main +class AppDelegate: FlutterAppDelegate { + override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { + return true + } + + override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool { + return true + } +} diff --git a/integration_tests/flutter_libs_swiftpm/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/integration_tests/flutter_libs_swiftpm/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 00000000..a2ec33f1 --- /dev/null +++ b/integration_tests/flutter_libs_swiftpm/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,68 @@ +{ + "images" : [ + { + "size" : "16x16", + "idiom" : "mac", + "filename" : "app_icon_16.png", + "scale" : "1x" + }, + { + "size" : "16x16", + "idiom" : "mac", + "filename" : "app_icon_32.png", + "scale" : "2x" + }, + { + "size" : "32x32", + "idiom" : "mac", + "filename" : "app_icon_32.png", + "scale" : "1x" + }, + { + "size" : "32x32", + "idiom" : "mac", + "filename" : "app_icon_64.png", + "scale" : "2x" + }, + { + "size" : "128x128", + "idiom" : "mac", + "filename" : "app_icon_128.png", + "scale" : "1x" + }, + { + "size" : "128x128", + "idiom" : "mac", + "filename" : "app_icon_256.png", + "scale" : "2x" + }, + { + "size" : "256x256", + "idiom" : "mac", + "filename" : "app_icon_256.png", + "scale" : "1x" + }, + { + "size" : "256x256", + "idiom" : "mac", + "filename" : "app_icon_512.png", + "scale" : "2x" + }, + { + "size" : "512x512", + "idiom" : "mac", + "filename" : "app_icon_512.png", + "scale" : "1x" + }, + { + "size" : "512x512", + "idiom" : "mac", + "filename" : "app_icon_1024.png", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/integration_tests/flutter_libs_swiftpm/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png b/integration_tests/flutter_libs_swiftpm/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png new file mode 100644 index 00000000..82b6f9d9 Binary files /dev/null and b/integration_tests/flutter_libs_swiftpm/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png differ diff --git a/integration_tests/flutter_libs_swiftpm/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png b/integration_tests/flutter_libs_swiftpm/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png new file mode 100644 index 00000000..13b35eba Binary files /dev/null and b/integration_tests/flutter_libs_swiftpm/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png differ diff --git a/integration_tests/flutter_libs_swiftpm/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png b/integration_tests/flutter_libs_swiftpm/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png new file mode 100644 index 00000000..0a3f5fa4 Binary files /dev/null and b/integration_tests/flutter_libs_swiftpm/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png differ diff --git a/integration_tests/flutter_libs_swiftpm/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png b/integration_tests/flutter_libs_swiftpm/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png new file mode 100644 index 00000000..bdb57226 Binary files /dev/null and b/integration_tests/flutter_libs_swiftpm/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png differ diff --git a/integration_tests/flutter_libs_swiftpm/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png b/integration_tests/flutter_libs_swiftpm/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png new file mode 100644 index 00000000..f083318e Binary files /dev/null and b/integration_tests/flutter_libs_swiftpm/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png differ diff --git a/integration_tests/flutter_libs_swiftpm/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png b/integration_tests/flutter_libs_swiftpm/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png new file mode 100644 index 00000000..326c0e72 Binary files /dev/null and b/integration_tests/flutter_libs_swiftpm/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png differ diff --git a/integration_tests/flutter_libs_swiftpm/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png b/integration_tests/flutter_libs_swiftpm/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png new file mode 100644 index 00000000..2f1632cf Binary files /dev/null and b/integration_tests/flutter_libs_swiftpm/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png differ diff --git a/integration_tests/flutter_libs_swiftpm/macos/Runner/Base.lproj/MainMenu.xib b/integration_tests/flutter_libs_swiftpm/macos/Runner/Base.lproj/MainMenu.xib new file mode 100644 index 00000000..80e867a4 --- /dev/null +++ b/integration_tests/flutter_libs_swiftpm/macos/Runner/Base.lproj/MainMenu.xib @@ -0,0 +1,343 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/integration_tests/flutter_libs_swiftpm/macos/Runner/Configs/AppInfo.xcconfig b/integration_tests/flutter_libs_swiftpm/macos/Runner/Configs/AppInfo.xcconfig new file mode 100644 index 00000000..af47b9a9 --- /dev/null +++ b/integration_tests/flutter_libs_swiftpm/macos/Runner/Configs/AppInfo.xcconfig @@ -0,0 +1,14 @@ +// Application-level settings for the Runner target. +// +// This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the +// future. If not, the values below would default to using the project name when this becomes a +// 'flutter create' template. + +// The application's name. By default this is also the title of the Flutter window. +PRODUCT_NAME = flutter_libs_swiftpm + +// The application's bundle identifier +PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterLibsSwiftpm + +// The copyright displayed in application information +PRODUCT_COPYRIGHT = Copyright © 2024 com.example. All rights reserved. diff --git a/integration_tests/flutter_libs_swiftpm/macos/Runner/Configs/Debug.xcconfig b/integration_tests/flutter_libs_swiftpm/macos/Runner/Configs/Debug.xcconfig new file mode 100644 index 00000000..36b0fd94 --- /dev/null +++ b/integration_tests/flutter_libs_swiftpm/macos/Runner/Configs/Debug.xcconfig @@ -0,0 +1,2 @@ +#include "../../Flutter/Flutter-Debug.xcconfig" +#include "Warnings.xcconfig" diff --git a/integration_tests/flutter_libs_swiftpm/macos/Runner/Configs/Release.xcconfig b/integration_tests/flutter_libs_swiftpm/macos/Runner/Configs/Release.xcconfig new file mode 100644 index 00000000..dff4f495 --- /dev/null +++ b/integration_tests/flutter_libs_swiftpm/macos/Runner/Configs/Release.xcconfig @@ -0,0 +1,2 @@ +#include "../../Flutter/Flutter-Release.xcconfig" +#include "Warnings.xcconfig" diff --git a/integration_tests/flutter_libs_swiftpm/macos/Runner/Configs/Warnings.xcconfig b/integration_tests/flutter_libs_swiftpm/macos/Runner/Configs/Warnings.xcconfig new file mode 100644 index 00000000..42bcbf47 --- /dev/null +++ b/integration_tests/flutter_libs_swiftpm/macos/Runner/Configs/Warnings.xcconfig @@ -0,0 +1,13 @@ +WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings +GCC_WARN_UNDECLARED_SELECTOR = YES +CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES +CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE +CLANG_WARN__DUPLICATE_METHOD_MATCH = YES +CLANG_WARN_PRAGMA_PACK = YES +CLANG_WARN_STRICT_PROTOTYPES = YES +CLANG_WARN_COMMA = YES +GCC_WARN_STRICT_SELECTOR_MATCH = YES +CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES +CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES +GCC_WARN_SHADOW = YES +CLANG_WARN_UNREACHABLE_CODE = YES diff --git a/integration_tests/flutter_libs_swiftpm/macos/Runner/DebugProfile.entitlements b/integration_tests/flutter_libs_swiftpm/macos/Runner/DebugProfile.entitlements new file mode 100644 index 00000000..dddb8a30 --- /dev/null +++ b/integration_tests/flutter_libs_swiftpm/macos/Runner/DebugProfile.entitlements @@ -0,0 +1,12 @@ + + + + + com.apple.security.app-sandbox + + com.apple.security.cs.allow-jit + + com.apple.security.network.server + + + diff --git a/integration_tests/flutter_libs_swiftpm/macos/Runner/Info.plist b/integration_tests/flutter_libs_swiftpm/macos/Runner/Info.plist new file mode 100644 index 00000000..4789daa6 --- /dev/null +++ b/integration_tests/flutter_libs_swiftpm/macos/Runner/Info.plist @@ -0,0 +1,32 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIconFile + + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + $(FLUTTER_BUILD_NAME) + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + LSMinimumSystemVersion + $(MACOSX_DEPLOYMENT_TARGET) + NSHumanReadableCopyright + $(PRODUCT_COPYRIGHT) + NSMainNibFile + MainMenu + NSPrincipalClass + NSApplication + + diff --git a/integration_tests/flutter_libs_swiftpm/macos/Runner/MainFlutterWindow.swift b/integration_tests/flutter_libs_swiftpm/macos/Runner/MainFlutterWindow.swift new file mode 100644 index 00000000..3cc05eb2 --- /dev/null +++ b/integration_tests/flutter_libs_swiftpm/macos/Runner/MainFlutterWindow.swift @@ -0,0 +1,15 @@ +import Cocoa +import FlutterMacOS + +class MainFlutterWindow: NSWindow { + override func awakeFromNib() { + let flutterViewController = FlutterViewController() + let windowFrame = self.frame + self.contentViewController = flutterViewController + self.setFrame(windowFrame, display: true) + + RegisterGeneratedPlugins(registry: flutterViewController) + + super.awakeFromNib() + } +} diff --git a/integration_tests/flutter_libs_swiftpm/macos/Runner/Release.entitlements b/integration_tests/flutter_libs_swiftpm/macos/Runner/Release.entitlements new file mode 100644 index 00000000..852fa1a4 --- /dev/null +++ b/integration_tests/flutter_libs_swiftpm/macos/Runner/Release.entitlements @@ -0,0 +1,8 @@ + + + + + com.apple.security.app-sandbox + + + diff --git a/integration_tests/flutter_libs_swiftpm/macos/RunnerTests/RunnerTests.swift b/integration_tests/flutter_libs_swiftpm/macos/RunnerTests/RunnerTests.swift new file mode 100644 index 00000000..61f3bd1f --- /dev/null +++ b/integration_tests/flutter_libs_swiftpm/macos/RunnerTests/RunnerTests.swift @@ -0,0 +1,12 @@ +import Cocoa +import FlutterMacOS +import XCTest + +class RunnerTests: XCTestCase { + + func testExample() { + // If you add code to the Runner application, consider adding tests here. + // See https://developer.apple.com/documentation/xctest for more information about using XCTest. + } + +} diff --git a/integration_tests/flutter_libs_swiftpm/pubspec.yaml b/integration_tests/flutter_libs_swiftpm/pubspec.yaml new file mode 100644 index 00000000..7c9445e6 --- /dev/null +++ b/integration_tests/flutter_libs_swiftpm/pubspec.yaml @@ -0,0 +1,22 @@ +name: flutter_libs_swiftpm +description: "A new Flutter project." +publish_to: 'none' +version: 1.0.0+1 + +environment: + sdk: ^3.5.0 + +dependencies: + flutter: + sdk: flutter + sqlite3_flutter_libs: + path: ../../sqlite3_flutter_libs + +dev_dependencies: + flutter_test: + sdk: flutter + flutter_lints: ^5.0.0 + integration_test: + sdk: flutter + test: ^1.24.0 + sqlite3: ^2.5.0 diff --git a/integration_tests/sqlcipher_flutter/ios/Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage/Package.swift b/integration_tests/sqlcipher_flutter/ios/Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage/Package.swift new file mode 100644 index 00000000..bd66df1b --- /dev/null +++ b/integration_tests/sqlcipher_flutter/ios/Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage/Package.swift @@ -0,0 +1,28 @@ +// swift-tools-version: 5.9 +// The swift-tools-version declares the minimum version of Swift required to build this package. +// +// Generated file. Do not edit. +// + +import PackageDescription + +let package = Package( + name: "FlutterGeneratedPluginSwiftPackage", + platforms: [ + .iOS("12.0") + ], + products: [ + .library(name: "FlutterGeneratedPluginSwiftPackage", type: .static, targets: ["FlutterGeneratedPluginSwiftPackage"]) + ], + dependencies: [ + .package(name: "integration_test", path: "/Users/simon/fvm/versions/master/packages/integration_test/ios/integration_test") + ], + targets: [ + .target( + name: "FlutterGeneratedPluginSwiftPackage", + dependencies: [ + .product(name: "integration-test", package: "integration_test") + ] + ) + ] +) diff --git a/integration_tests/sqlcipher_flutter/ios/Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage/Sources/FlutterGeneratedPluginSwiftPackage/FlutterGeneratedPluginSwiftPackage.swift b/integration_tests/sqlcipher_flutter/ios/Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage/Sources/FlutterGeneratedPluginSwiftPackage/FlutterGeneratedPluginSwiftPackage.swift new file mode 100644 index 00000000..62e7b11a --- /dev/null +++ b/integration_tests/sqlcipher_flutter/ios/Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage/Sources/FlutterGeneratedPluginSwiftPackage/FlutterGeneratedPluginSwiftPackage.swift @@ -0,0 +1,3 @@ +// +// Generated file. Do not edit. +// diff --git a/sqlite3/CHANGELOG.md b/sqlite3/CHANGELOG.md index 674f791a..c0829731 100644 --- a/sqlite3/CHANGELOG.md +++ b/sqlite3/CHANGELOG.md @@ -1,3 +1,13 @@ +## 2.6.0 + +- Add `SimpleOpfsFileSystem.deleteFromStorage` to delete OPFS-based file + systems. +- Add `jsonb`, a Dart `Codec` converting Dart object from and to SQLite + `JSONB` values. +- __Experimentally__ support encryption on the web through SQLite Multiple + Ciphers. The readme provides more information on how to use encryption on the + web. + ## 2.5.0 - Allow registering custom virtual file systems on all platforms. Previously, diff --git a/sqlite3/README.md b/sqlite3/README.md index 9ee18f7e..0e770881 100644 --- a/sqlite3/README.md +++ b/sqlite3/README.md @@ -96,7 +96,7 @@ Emscripten or any JavaScript glue code. Please note that stable web support for `package:sqlite3` is restricted to Dart being compiled to JavaScript. Support for `dart2wasm` is experimental. The API -is identical, but the implementation [is severly limited](https://github.com/simolus3/sqlite3.dart/issues/230). +is identical, but the implementation [is severely limited](https://github.com/simolus3/sqlite3.dart/issues/230). ### Setup @@ -130,7 +130,7 @@ in `package:sqlite3/sqlite3.dart`, databases can be opened in similar ways. An example for such web folder is in `example/web/` of this repo. To view the example, copy a compiled `sqlite3.wasm` file to `web/sqlite3.wasm` in this directory. -Then, run `dart run build_runner serve example:8080` and visit `http://localhost:8080/web/` in a browser. +Then, run `dart run build_runner serve example:8080` and visit `http://localhost:8080/web/` in a browser. Another `example/multiplatform/` uses common interface to `sqlite3` on web and native platforms. To run this example, merge its files into a Flutter app. @@ -143,6 +143,26 @@ version in `package:sqlite3/wasm.dart`. By having shared code depend on the common interfaces, it can be used for both native and web apps. +### Web encryption + +Starting from version 2.6.0, `package:sqlite3/wasm.dart` supports loading a compiled version of +[SQLite Multiple Ciphers](https://utelle.github.io/SQLite3MultipleCiphers/) providing encryption +support for the web. +Please note that this variant is not currently tested as well as the regular SQLite version. +For this reason, using SQLite Multiple Ciphers with `package:sqlite3/wasm.dart` should be considered +experimental for the time being. + +To test the encryption integration, download `sqlite3mc.wasm` from the [releases](https://github.com/simolus3/sqlite3.dart/releases) +of this package and use that as a URL to load sqlite3 on the web: + +```dart +final sqlite3 = await WasmSqlite3.loadFromUrl(Uri.parse('sqlite3mc.wasm')); +sqlite3.registerVirtualFileSystem(InMemoryFileSystem(), makeDefault: true); + +final database = sqlite3.open('/database') + ..execute("pragma key = 'test';"); // TODO: Replace key +``` + ### Testing To run the tests of this package with wasm, either download the `sqlite3.wasm` file from the diff --git a/sqlite3/assets/wasm/CMakeLists.txt b/sqlite3/assets/wasm/CMakeLists.txt index 6806da46..814f1053 100644 --- a/sqlite3/assets/wasm/CMakeLists.txt +++ b/sqlite3/assets/wasm/CMakeLists.txt @@ -12,11 +12,18 @@ include(FetchContent) FetchContent_Declare( sqlite3 # NOTE: When changing this, also update `test/wasm/sqlite3_test.dart` - URL https://sqlite.org/2024/sqlite-autoconf-3470000.tar.gz + URL https://sqlite.org/2024/sqlite-autoconf-3470200.tar.gz + DOWNLOAD_EXTRACT_TIMESTAMP NEW +) + +FetchContent_Declare( + sqlite3mc + URL https://github.com/utelle/SQLite3MultipleCiphers/releases/download/v1.9.2/sqlite3mc-1.9.2-sqlite-3.47.2-amalgamation.zip DOWNLOAD_EXTRACT_TIMESTAMP NEW ) FetchContent_MakeAvailable(sqlite3) +FetchContent_MakeAvailable(sqlite3mc) file(DOWNLOAD https://raw.githubusercontent.com/sqlite/sqlite/master/src/test_vfstrace.c "${CMAKE_BINARY_DIR}/vfstrace.c") @@ -34,7 +41,7 @@ add_custom_command( ) add_custom_target(required_symbols DEPENDS required_symbols.txt) -macro(base_sqlite3_target name debug) +macro(base_sqlite3_target name debug crypto) set(clang_output ${name}.clang.wasm) set(init_output ${name}.init.wasm) set(output ${init_output}) @@ -42,10 +49,17 @@ macro(base_sqlite3_target name debug) set(sources ${CMAKE_CURRENT_SOURCE_DIR}/os_web.c ${CMAKE_CURRENT_SOURCE_DIR}/helpers.c - ${sqlite3_SOURCE_DIR}/sqlite3.c ) set(flags -Wall -Wextra -Wno-unused-parameter -Wno-unused-function) + if(${crypto}) + list(APPEND sources "${sqlite3mc_SOURCE_DIR}/sqlite3mc_amalgamation.c") + list(APPEND sources "${CMAKE_CURRENT_SOURCE_DIR}/getentropy.c") + list(APPEND flags "-DSQLITE_OMIT_AUTOINIT") + else() + list(APPEND sources "${sqlite3_SOURCE_DIR}/sqlite3.c") + endif() + if(${debug}) list(APPEND sources "${CMAKE_BINARY_DIR}/vfstrace.c") list(APPEND flags "-g" "-DDEBUG") @@ -60,6 +74,7 @@ macro(base_sqlite3_target name debug) -o ${clang_output} -I ${PROJECT_SOURCE_DIR} -I ${sqlite3_SOURCE_DIR} -D_HAVE_SQLITE_CONFIG_H + -D__WASM__ -mcpu=generic -mexec-model=reactor -fno-stack-protector -fno-stack-clash-protection @@ -93,10 +108,12 @@ macro(base_sqlite3_target name debug) add_custom_target(${name} DEPENDS ${output}) endmacro() -base_sqlite3_target(sqlite3_debug true) -base_sqlite3_target(sqlite3_opt false) +base_sqlite3_target(sqlite3_debug true false) +base_sqlite3_target(sqlite3_opt false false) +base_sqlite3_target(sqlite3mc false true) add_custom_target(output) add_custom_command(TARGET output COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/sqlite3_opt.wasm ${PROJECT_SOURCE_DIR}/../../example/web/sqlite3.wasm) add_custom_command(TARGET output COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/sqlite3_debug.init.wasm ${PROJECT_SOURCE_DIR}/../../example/web/sqlite3.debug.wasm) -add_dependencies(output sqlite3_debug sqlite3_opt) +add_custom_command(TARGET output COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/sqlite3mc.wasm ${PROJECT_SOURCE_DIR}/../../example/web/sqlite3mc.wasm) +add_dependencies(output sqlite3_debug sqlite3_opt sqlite3mc) diff --git a/sqlite3/assets/wasm/getentropy.c b/sqlite3/assets/wasm/getentropy.c new file mode 100644 index 00000000..8189f06b --- /dev/null +++ b/sqlite3/assets/wasm/getentropy.c @@ -0,0 +1,11 @@ +#include + +#include "bridge.h" + +// sqlite3mc calls getentropy on initialization. That call pulls a bunch of WASI +// imports in when using the default WASI libc, which we're trying to avoid +// here. Instead, we use a local implementation backed by `Random.secure()` in +// Dart. +int getentropy(void* buf, size_t n) { + return xRandomness(-1, (int)n, (char*)buf); +} diff --git a/sqlite3/assets/wasm/helpers.c b/sqlite3/assets/wasm/helpers.c index 380104ca..90b4e992 100644 --- a/sqlite3/assets/wasm/helpers.c +++ b/sqlite3/assets/wasm/helpers.c @@ -187,7 +187,11 @@ SQLITE_API sqlite3_vfs *dart_sqlite3_register_vfs(const char *name, int dartId, vfstrace_register(traceName, name, &dartvfs_trace_log1, NULL, makeDefault); #else // Just register the VFS as is. - sqlite3_vfs_register(vfs, makeDefault); + int rc = sqlite3_vfs_register(vfs, makeDefault); + if (rc) { + free(vfs); + return NULL; + } #endif return vfs; } diff --git a/sqlite3/assets/wasm/os_web.c b/sqlite3/assets/wasm/os_web.c index 0463380c..666902de 100644 --- a/sqlite3/assets/wasm/os_web.c +++ b/sqlite3/assets/wasm/os_web.c @@ -2,7 +2,6 @@ #include #include -#include "bridge.h" #include "sqlite3.h" extern int sqlite3_powersync_init(sqlite3 *db, char **pzErrMsg, diff --git a/sqlite3/dart_test.yaml b/sqlite3/dart_test.yaml index 6f2a0f90..53172fda 100644 --- a/sqlite3/dart_test.yaml +++ b/sqlite3/dart_test.yaml @@ -22,6 +22,7 @@ override_platforms: presets: full: platforms: [vm, chrome, firefox] + compilers: [dart2js, dart2wasm] on_os: windows: platforms: [vm, chrome, firefox, edge] diff --git a/sqlite3/example/jsonb.dart b/sqlite3/example/jsonb.dart new file mode 100644 index 00000000..d0989c1e --- /dev/null +++ b/sqlite3/example/jsonb.dart @@ -0,0 +1,12 @@ +import 'package:sqlite3/sqlite3.dart'; + +void main() { + final database = sqlite3.openInMemory() + ..execute('CREATE TABLE entries (entry BLOB NOT NULL) STRICT;') + // You can insert JSONB-formatted values directly + ..execute('INSERT INTO entries (entry) VALUES (?)', [ + jsonb.encode({'hello': 'dart'}) + ]); + // And use them with JSON operators in SQLite without a further conversion: + print(database.select('SELECT entry ->> ? AS r FROM entries;', [r'$.hello'])); +} diff --git a/sqlite3/example/web/index.html b/sqlite3/example/web/index.html index 0170e6c5..c84a5097 100644 --- a/sqlite3/example/web/index.html +++ b/sqlite3/example/web/index.html @@ -22,6 +22,7 @@

sqlite3 web demo

  • With an Origin-Private FileSystem (OPFS)-based storage implementation. Note that this requires two workers and a special header that is not available with build_runner serve, but it will work when launching this website with dart run tool/example_server.dart
  • +
  • With an in-memory test (using SQLite3 Multiple Ciphers for encryption):
  • After launching the example, you can check the console and the code in main.dart (or worker.dart for the OPFS example) diff --git a/sqlite3/example/web/main.dart b/sqlite3/example/web/main.dart index f7bf0bfc..9587d524 100644 --- a/sqlite3/example/web/main.dart +++ b/sqlite3/example/web/main.dart @@ -5,10 +5,10 @@ import 'package:sqlite3/wasm.dart'; Future main() async { final startIndexedDb = document.getElementById('start-idb')!; final startOpfs = document.getElementById('start-opfs')!; + final startEncryption = document.getElementById('start-encryption')!; startIndexedDb.onClick.listen((_) async { startIndexedDb.remove(); - final sqlite3 = await WasmSqlite3.loadFromUrl(Uri.parse('sqlite3.debug.wasm')); @@ -35,4 +35,27 @@ Future main() async { final worker = Worker('worker.dart.js'); worker.postMessage('start'); }); + + startEncryption.onClick.listen((_) async { + startEncryption.remove(); + final sqlite3 = await WasmSqlite3.loadFromUrl(Uri.parse('sqlite3mc.wasm')); + + sqlite3.registerVirtualFileSystem(InMemoryFileSystem(), makeDefault: true); + + sqlite3.open('/database') + ..execute("pragma key = 'test';") + ..execute('pragma user_version = 1') + ..execute('CREATE TABLE foo (bar INTEGER NOT NULL);') + ..execute('INSERT INTO foo (bar) VALUES (?)', [3]) + ..dispose(); + + final db = sqlite3.open('/database'); + try { + db.select('SELECT * FROM foo'); + } on SqliteException { + print('database call failed (expected due to missing key)'); + } + db.execute("pragma key = 'test';"); + print(db.select('SELECT * FROM foo')); + }); } diff --git a/sqlite3/lib/common.dart b/sqlite3/lib/common.dart index f081d32f..3844d669 100644 --- a/sqlite3/lib/common.dart +++ b/sqlite3/lib/common.dart @@ -6,9 +6,10 @@ export 'src/constants.dart'; export 'src/database.dart'; export 'src/exception.dart'; export 'src/functions.dart'; +export 'src/in_memory_vfs.dart' show InMemoryFileSystem; +export 'src/jsonb.dart'; export 'src/result_set.dart'; export 'src/sqlite3.dart'; export 'src/statement.dart' show CommonPreparedStatement, StatementParameters, CustomStatementParameter; export 'src/vfs.dart'; -export 'src/in_memory_vfs.dart' show InMemoryFileSystem; diff --git a/sqlite3/lib/src/jsonb.dart b/sqlite3/lib/src/jsonb.dart new file mode 100644 index 00000000..c1d8d460 --- /dev/null +++ b/sqlite3/lib/src/jsonb.dart @@ -0,0 +1,415 @@ +import 'dart:convert'; +import 'dart:typed_data'; + +import 'package:typed_data/typed_buffers.dart'; + +/// A [Codec] capable of converting Dart objects from and to the [JSONB] format +/// used by sqlite3. +/// +/// The codec is useful when columns stored as blobs in SQLite are to be +/// interpreted as JSONB values, as one conversion step between Dart and SQLite +/// (usually implemented by mapping to a JSON string in Dart and then calling +/// the `jsonb` SQL function, or calling `json` the other way around) becomes +/// superfluous. +/// +/// This codec's [Codec.encoder] supports the same objects as Dart's [json] +/// encoder with the addition of non-finite [double] values that can't be +/// represented in regular JSON. When passing a custom object into +/// [Codec.encode], it will attempt to call a `toJson()` method. The encoder +/// also throws the same [JsonCyclicError] and [JsonUnsupportedObjectError] +/// classes thrown by the native JSON encoder. +/// +/// Example: +/// +/// ```dart +/// import 'package:sqlite3/sqlite3.dart'; +/// +/// void main() { +/// final database = sqlite3.openInMemory() +/// ..execute('CREATE TABLE entries (entry BLOB NOT NULL) STRICT;') +/// // You can insert JSONB-formatted values directly +/// ..execute('INSERT INTO entries (entry) VALUES (?)', [ +/// jsonb.encode({'hello': 'dart'}) +/// ]); +/// // And use them with JSON operators in SQLite without a further conversion: +/// print(database.select('SELECT entry ->> ? AS r FROM entries;', [r'$.hello'])); +/// } +/// ``` +/// +/// [JSONB]: https://sqlite.org/jsonb.html +const Codec jsonb = _JsonbCodec(); + +final class _JsonbCodec extends Codec { + const _JsonbCodec(); + + @override + Converter get decoder => const _JsonbDecoder(); + + @override + Converter get encoder => const _JsonbEncoder(); +} + +enum _ElementType { + _null, + _true, + _false, + _int, + _int5, + _float, + _float5, + _text, + _textJ, + _text5, + _textraw, + _array, + _object, + _reserved13, + _reserved14, + _reserved15, +} + +final class _JsonbDecoder extends Converter { + const _JsonbDecoder(); + + @override + Object? convert(Uint8List input) { + final state = _JsonbDecodingState(input); + final value = state.read(); + if (state.remainingLength > 0) { + state._malformedJson(); + } + + return value; + } +} + +final class _JsonbDecodingState { + final Uint8List input; + int offset = 0; + final List endOffsetStack; + + _JsonbDecodingState(this.input) : endOffsetStack = [input.length]; + + int get remainingLength => endOffsetStack.last - offset; + + Never _malformedJson() { + throw ArgumentError('Malformed JSONB'); + } + + int nextByte() => input[offset++]; + + void pushLengthRestriction(int length) { + endOffsetStack.add(offset + length); + } + + void popLengthRestriction() => endOffsetStack.removeLast(); + + void checkRemainingLength(int requiredBytes) { + if (remainingLength < requiredBytes) { + _malformedJson(); + } + } + + (_ElementType, int) readHeader() { + assert(remainingLength >= 1); + final firstByte = nextByte(); + final type = _ElementType.values[firstByte & 0xF]; + final lengthIndicator = firstByte >> 4; + + var length = 0; + if (lengthIndicator <= 11) { + length = lengthIndicator; + } else { + final additionalBytes = 1 << (lengthIndicator - 12); + checkRemainingLength(additionalBytes); + + for (var i = 0; i < additionalBytes; i++) { + length <<= 8; + length |= nextByte(); + } + } + + return (type, length); + } + + List readArray(int payloadLength) { + pushLengthRestriction(payloadLength); + final result = []; + while (remainingLength > 0) { + result.add(read()); + } + + popLengthRestriction(); + return result; + } + + Map readObject(int payloadLength) { + pushLengthRestriction(payloadLength); + final result = {}; + while (remainingLength > 0) { + final name = read(); + if (name is! String) { + _malformedJson(); + } + + final value = read(); + result[name] = value; + } + + popLengthRestriction(); + return result; + } + + Object? read() { + checkRemainingLength(1); + final (type, payloadLength) = readHeader(); + checkRemainingLength(payloadLength); + final payloadStartOffset = offset; + final endIndex = offset + payloadLength; + + Uint8List payloadBytes() { + return input.buffer + .asUint8List(input.offsetInBytes + payloadStartOffset, payloadLength); + } + + String payloadString() { + return utf8.decode(payloadBytes()); + } + + final value = switch (type) { + _ElementType._null => null, + _ElementType._true => true, + _ElementType._false => false, + _ElementType._int || _ElementType._int5 => int.parse(payloadString()), + _ElementType._float || + _ElementType._float5 => + double.parse(payloadString()), + _ElementType._text || _ElementType._textraw => payloadString(), + _ElementType._textJ || + _ElementType._text5 => + json.decode('"${payloadString()}"'), + _ElementType._array => readArray(payloadLength), + _ElementType._object => readObject(payloadLength), + _ => _malformedJson(), + }; + + assert(offset <= endIndex); + offset = endIndex; + return value; + } +} + +final class _JsonbEncoder extends Converter { + const _JsonbEncoder(); + + @override + Uint8List convert(Object? input) { + final operation = _JsonbEncodingOperation()..write(input); + return operation._buffer.buffer + .asUint8List(operation._buffer.offsetInBytes, operation._buffer.length); + } +} + +final class _JsonbEncodingOperation { + final Uint8Buffer _buffer = Uint8Buffer(); + + /// List of objects currently being traversed. Used to detect cycles. + final List _seen = []; + + void writeHeader(int payloadSize, _ElementType type) { + var firstByte = type.index; + if (payloadSize <= 11) { + _buffer.add((payloadSize << 4) | firstByte); + } else { + // We can encode the length as a 1, 2, 4 or 8 byte integer. Prefer the + // shortest. + switch (payloadSize.bitLength) { + case <= 8: + const prefix = 12 << 4; + _buffer + ..add(prefix | firstByte) + ..add(payloadSize); + case <= 16: + const prefix = 13 << 4; + _buffer + ..add(prefix | firstByte) + ..add(payloadSize >> 8) + ..add(payloadSize); + case <= 32: + const prefix = 14 << 4; + _buffer + ..add(prefix | firstByte) + ..add(payloadSize >> 24) + ..add(payloadSize >> 16) + ..add(payloadSize >> 8) + ..add(payloadSize); + default: + const prefix = 15 << 4; + _buffer + ..add(prefix | firstByte) + ..add(payloadSize >> 56) + ..add(payloadSize >> 48) + ..add(payloadSize >> 40) + ..add(payloadSize >> 32) + ..add(payloadSize >> 24) + ..add(payloadSize >> 16) + ..add(payloadSize >> 8) + ..add(payloadSize); + } + } + } + + int prepareUnknownLength(_ElementType type) { + const prefix = 15 << 4; + _buffer.add(prefix | type.index); + final index = _buffer.length; + _buffer.addAll(_eightZeroes); + return index; + } + + void fillPreviouslyUnknownLength(int index) { + final length = _buffer.length - index - 8; + for (var i = 0; i < 8; i++) { + _buffer[index + i] = length >> (8 * (7 - i)); + } + } + + /// Check that [object] is not already being traversed, or add it to the end + /// of the seen list otherwise. + void checkCycle(Object? object) { + for (final entry in _seen) { + if (identical(object, entry)) { + throw JsonCyclicError(object); + } + } + + _seen.add(object); + } + + /// Removes [object] from the end of the [_seen] list. + void removeSeen(Object? object) { + assert(_seen.isNotEmpty); + assert(identical(_seen.last, object)); + _seen.removeLast(); + } + + void writeNull() { + writeHeader(0, _ElementType._null); + } + + void writeBool(bool value) { + writeHeader(0, value ? _ElementType._true : _ElementType._false); + } + + void writeInt(int value) { + final encoded = utf8.encode(value.toString()); + writeHeader(encoded.length, _ElementType._int); + _buffer.addAll(encoded); + } + + void writeDouble(double value) { + final encoded = utf8.encode(value.toString()); + // RFC 8259 does not support infinity or NaN. + writeHeader(encoded.length, + value.isFinite ? _ElementType._float : _ElementType._float5); + _buffer.addAll(encoded); + } + + void writeString(String value) { + final encoded = utf8.encode(value); + writeHeader(encoded.length, _ElementType._textraw); + _buffer.addAll(encoded); + } + + void writeArray(Iterable values) { + if (values.isEmpty) { + return writeHeader(0, _ElementType._array); + } + + final index = prepareUnknownLength(_ElementType._array); + values.forEach(write); + fillPreviouslyUnknownLength(index); + } + + bool writeMap(Map values) { + if (values.isEmpty) { + writeHeader(0, _ElementType._object); + return true; + } + + final keyValueList = List.filled(values.length * 2, null); + var i = 0; + var invalidKey = false; + for (final MapEntry(:key, :value) in values.entries) { + if (key is! String) { + invalidKey = true; + break; + } + keyValueList[i++] = key; + keyValueList[i++] = value; + } + if (invalidKey) return false; + + final index = prepareUnknownLength(_ElementType._object); + for (final value in keyValueList) { + write(value); + } + fillPreviouslyUnknownLength(index); + return true; + } + + void write(Object? value) { + // Try writing values that don't need to be converted into a JSON-compatible + // format. + if (writeJsonValue(value)) { + return; + } + + checkCycle(value); + try { + final lowered = _encodeObject(value); + if (!writeJsonValue(lowered)) { + throw JsonUnsupportedObjectError(lowered); + } + removeSeen(value); + } catch (e) { + throw JsonUnsupportedObjectError(value, cause: e); + } + } + + bool writeJsonValue(Object? value) { + switch (value) { + case null: + writeNull(); + return true; + case bool b: + writeBool(b); + return true; + case int i: + writeInt(i); + return true; + case double d: + writeDouble(d); + return true; + case String s: + writeString(s); + return true; + case List i: + checkCycle(i); + writeArray(i); + removeSeen(i); + return true; + case Map o: + checkCycle(o); + final success = writeMap(o); + removeSeen(o); + return success; + default: + return false; + } + } + + static final _eightZeroes = Uint8List(8); + + static Object? _encodeObject(dynamic object) => object.toJson(); +} diff --git a/sqlite3/lib/src/vfs.dart b/sqlite3/lib/src/vfs.dart index 7cad5883..88395584 100644 --- a/sqlite3/lib/src/vfs.dart +++ b/sqlite3/lib/src/vfs.dart @@ -132,18 +132,30 @@ abstract base class BaseVirtualFileSystem extends VirtualFileSystem { final Random random; BaseVirtualFileSystem({Random? random, required String name}) - : random = random ?? Random.secure(), + : random = random ?? _fallbackRandom, super(name); @override void xRandomness(Uint8List target) { + generateRandomness(target, random); + } + + @override + DateTime xCurrentTime() => DateTime.now(); + + /// Fills [target] with random bytes. + /// + /// An optional [random] source can be provided, otherwise a default instance + /// of [Random.secure] will be used. + static void generateRandomness(Uint8List target, [Random? random]) { + random ??= _fallbackRandom; + for (var i = 0; i < target.length; i++) { target[i] = random.nextInt(1 << 8); } } - @override - DateTime xCurrentTime() => DateTime.now(); + static final Random _fallbackRandom = Random.secure(); } /// A [VirtualFileSystemFile] base class that implements [xRead] to zero-fill diff --git a/sqlite3/lib/src/wasm/bindings.dart b/sqlite3/lib/src/wasm/bindings.dart index f6245d2d..bf210817 100644 --- a/sqlite3/lib/src/wasm/bindings.dart +++ b/sqlite3/lib/src/wasm/bindings.dart @@ -5,6 +5,7 @@ import 'dart:typed_data'; import 'package:sqlite3/src/vfs.dart'; import '../constants.dart'; +import '../exception.dart'; import '../functions.dart'; import '../implementation/bindings.dart'; import 'wasm_interop.dart' as wasm; @@ -55,6 +56,8 @@ final class WasmSqliteBindings extends RawSqliteBindings { @override SqliteResult sqlite3_open_v2( String name, int flags, String? zVfs) { + sqlite3_initialize(); + final namePtr = bindings.allocateZeroTerminated(name); final outDb = bindings.malloc(wasm.WasmBindings.pointerSize); final vfsPtr = zVfs == null ? 0 : bindings.allocateZeroTerminated(zVfs); @@ -76,12 +79,23 @@ final class WasmSqliteBindings extends RawSqliteBindings { return bindings.memory.readString(bindings.sqlite3_sourceid()); } + void sqlite3_initialize() { + final rc = bindings.sqlite3_initialize(); + if (rc != 0) { + throw SqliteException(rc, 'sqlite3_initialize call failed'); + } + } + @override void registerVirtualFileSystem(VirtualFileSystem vfs, int makeDefault) { final name = bindings.allocateZeroTerminated(vfs.name); final id = bindings.callbacks.registerVfs(vfs); final ptr = bindings.dart_sqlite3_register_vfs(name, id, makeDefault); + if (ptr == 0) { + throw StateError('could not register vfs'); + } + sqlite3_initialize(); DartCallbacks.sqliteVfsPointer[vfs] = ptr; } diff --git a/sqlite3/lib/src/wasm/vfs/simple_opfs.dart b/sqlite3/lib/src/wasm/vfs/simple_opfs.dart index 4efd09f1..17aefaf5 100644 --- a/sqlite3/lib/src/wasm/vfs/simple_opfs.dart +++ b/sqlite3/lib/src/wasm/vfs/simple_opfs.dart @@ -7,7 +7,9 @@ import 'package:web/web.dart' show FileSystemDirectoryHandle, FileSystemSyncAccessHandle, - FileSystemReadWriteOptions; + FileSystemReadWriteOptions, + FileSystemRemoveOptions, + DOMException; import '../../constants.dart'; import '../../vfs.dart'; @@ -68,6 +70,24 @@ final class SimpleOpfsFileSystem extends BaseVirtualFileSystem { {String vfsName = 'simple-opfs'}) : super(name: vfsName); + static Future<(FileSystemDirectoryHandle?, FileSystemDirectoryHandle)> + _resolveDir(String path, {bool create = true}) async { + final storage = storageManager; + if (storage == null) { + throw VfsException(SqlError.SQLITE_ERROR); + } + + FileSystemDirectoryHandle? parent; + var opfsDirectory = await storage.directory; + + for (final segment in p.split(path)) { + parent = opfsDirectory; + opfsDirectory = await opfsDirectory.getDirectory(segment, create: create); + } + + return (parent, opfsDirectory); + } + /// Loads an [SimpleOpfsFileSystem] in the desired [path] under the root directory /// for OPFS as given by `navigator.storage.getDirectory()` in JavaScript. /// @@ -81,13 +101,32 @@ final class SimpleOpfsFileSystem extends BaseVirtualFileSystem { throw VfsException(SqlError.SQLITE_ERROR); } - var opfsDirectory = await storage.directory; + final (_, directory) = await _resolveDir(path); + return inDirectory(directory, vfsName: vfsName); + } - for (final segment in p.split(path)) { - opfsDirectory = await opfsDirectory.getDirectory(segment, create: true); + /// Deletes the file system directory handle that would store sqlite3 + /// databases when using [loadFromStorage] with the same path. + static Future deleteFromStorage(String path) async { + final FileSystemDirectoryHandle? parent; + final FileSystemDirectoryHandle handle; + + try { + (parent, handle) = await _resolveDir(path, create: false); + } on DOMException catch (e) { + if (e.name == 'NotFoundError' || e.name == 'TypeMismatchError') { + // Directory doesn't exist, ignore. + return; + } else { + rethrow; + } } - return inDirectory(opfsDirectory, vfsName: vfsName); + if (parent != null) { + await parent + .removeEntry(handle.name, FileSystemRemoveOptions(recursive: true)) + .toDart; + } } /// Loads an [SimpleOpfsFileSystem] in the desired [root] directory, which must be diff --git a/sqlite3/lib/src/wasm/wasm_interop.dart b/sqlite3/lib/src/wasm/wasm_interop.dart index 75a1ca94..1f9d1d68 100644 --- a/sqlite3/lib/src/wasm/wasm_interop.dart +++ b/sqlite3/lib/src/wasm/wasm_interop.dart @@ -83,7 +83,7 @@ class WasmBindings { _sqlite3_stmt_readonly, _sqlite3_stmt_isexplain; - final JSFunction? _sqlite3_db_config; + final JSFunction? _sqlite3_db_config, _sqlite3_initialize; final Global _sqlite3_temp_directory; @@ -160,7 +160,9 @@ class WasmBindings { _sqlite3_stmt_isexplain = instance.functions['sqlite3_stmt_isexplain']!, _sqlite3_stmt_readonly = instance.functions['sqlite3_stmt_readonly']!, _sqlite3_db_config = instance.functions['dart_sqlite3_db_config_int'], + _sqlite3_initialize = instance.functions['sqlite3_initialize'], _sqlite3_temp_directory = instance.globals['sqlite3_temp_directory']! + // Note when adding new fields: We remove functions from the wasm module that // aren't referenced in Dart. We consider a symbol used when it appears in a // string literal in an initializer of this constructor (`tool/wasm_dce.dart`). @@ -210,6 +212,13 @@ class WasmBindings { void sqlite3_free(Pointer ptr) => _sqlite3_free.callReturningVoid(ptr.toJS); + int sqlite3_initialize() { + return switch (_sqlite3_initialize) { + final fun? => fun.callReturningInt0(), + null => 0, + }; + } + int create_scalar_function( Pointer db, Pointer functionName, int nArg, int eTextRep, int id) { return _create_scalar.callReturningInt5( @@ -601,10 +610,18 @@ class _InjectedValues { }); }).toJS, 'xRandomness': ((int vfsId, int nByte, Pointer zOut) { - final vfs = callbacks.registeredVfs[vfsId]!; + final vfs = callbacks.registeredVfs[vfsId]; return _runVfs(() { - vfs.xRandomness(memory.buffer.toDart.asUint8List(zOut, nByte)); + final target = memory.buffer.toDart.asUint8List(zOut, nByte); + + if (vfs != null) { + vfs.xRandomness(target); + } else { + // Fall back to a default random source. We're using this to + // implement `getentropy` in C which is used by sqlite3mc. + return BaseVirtualFileSystem.generateRandomness(target); + } }); }).toJS, 'xSleep': ((int vfsId, int micros) { diff --git a/sqlite3/pubspec.yaml b/sqlite3/pubspec.yaml index 4d419ceb..f3fb98f0 100644 --- a/sqlite3/pubspec.yaml +++ b/sqlite3/pubspec.yaml @@ -1,6 +1,6 @@ name: sqlite3 description: Provides lightweight yet convenient bindings to SQLite by using dart:ffi -version: 2.5.0 +version: 2.6.0 homepage: https://github.com/simolus3/sqlite3.dart/tree/main/sqlite3 issue_tracker: https://github.com/simolus3/sqlite3.dart/issues diff --git a/sqlite3/test/jsonb_test.dart b/sqlite3/test/jsonb_test.dart new file mode 100644 index 00000000..904bee40 --- /dev/null +++ b/sqlite3/test/jsonb_test.dart @@ -0,0 +1,227 @@ +@Tags(['ffi']) +library; + +import 'dart:convert'; +import 'dart:typed_data'; + +import 'package:sqlite3/sqlite3.dart'; +import 'package:test/test.dart'; + +void main() { + final supportsJsonb = sqlite3.version.versionNumber >= 3045000; + + group('encode', () { + void expectEncoded(Object? object, String expectedHex) { + final encoded = jsonb.encode(object); + final hex = + encoded.map((e) => e.toRadixString(16).padLeft(2, '0')).join(); + expect(hex, expectedHex); + } + + test('null', () { + expectEncoded(null, '00'); + }); + + test('booleans', () { + expectEncoded(true, '01'); + expectEncoded(false, '02'); + }); + + test('integers', () { + expectEncoded(0, '1330'); + expectEncoded(-1, '232d31'); + }); + + test('doubles', () { + expectEncoded(0.0, '35302e30'); + expectEncoded(-0.0, '452d302e30'); + }); + + test('array', () { + expectEncoded([], '0b'); + expectEncoded([true], 'fb000000000000000101'); + }); + + test('object', () { + expectEncoded({}, '0c'); + expectEncoded({'a': true}, 'fc00000000000000031a6101'); + }); + + test('does not encode circular elements', () { + final selfContainingList = []; + selfContainingList.add(selfContainingList); + final selfContainingMap = {}; + selfContainingMap['.'] = selfContainingMap; + + expect(() => jsonb.encode(selfContainingList), + throwsA(isA())); + expect(() => jsonb.encode(selfContainingMap), + throwsA(isA())); + }); + + test('does not encode invalid elements', () { + expect(() => jsonb.encode(jsonb), + throwsA(isA())); + }); + + test('can call toJson', () { + expectEncoded(_CustomJsonRepresentation(), '01'); + }); + }); + + group('decode', () { + Object? decode(String hex) { + expect(hex.length.isEven, true); + final bytes = Uint8List(hex.length ~/ 2); + for (var i = 0; i < bytes.length; i++) { + bytes[i] = int.parse(hex.substring(i * 2, (i * 2) + 2), radix: 16); + } + return jsonb.decode(bytes); + } + + void expectDecoded(String hex, Object? decoded) { + expect(decode(hex), decoded); + } + + test('null', () { + expectDecoded('00', null); + }); + + test('true', () { + expectDecoded('01', true); + }); + + test('false', () { + expectDecoded('02', false); + }); + + test('integers', () { + expectDecoded('1330', 0); + expectDecoded('232d31', -1); + }); + + test('doubles', () { + expectDecoded('35302e30', 0.0); + expectDecoded('452d302e30', -0.0); + }); + + test('array', () { + expectDecoded('0b', []); + expectDecoded('1b01', [true]); + }); + + test('object', () { + expectDecoded('0c', {}); + expectDecoded('3c1a6101', {'a': true}); + }); + + test('supports long primitives', () { + // "Future versions of SQLite might extend the JSONB format with elements + // that have a zero element type but a non-zero size. In that way, legacy + // versions of SQLite will interpret the element as a NULL for backwards + // compatibility while newer versions will interpret the element in some + // other way. " + expectDecoded('30000000', null); + }); + + test('fails for invalid element types', () { + expect(() => decode('0d'), throwsA(_isMalformedJsonException)); + expect(() => decode('0e'), throwsA(_isMalformedJsonException)); + expect(() => decode('0f'), throwsA(_isMalformedJsonException)); + }); + + test('fails for trailing data', () { + expect(() => decode('10'), throwsA(_isMalformedJsonException)); + }); + }); + + group('round trips', () { + late Database database; + late PreparedStatement jsonb2json, json2jsonb; + + setUpAll(() { + database = sqlite3.openInMemory(); + if (supportsJsonb) { + jsonb2json = database.prepare('SELECT json(?);'); + json2jsonb = database.prepare('SELECT jsonb(?);'); + } + }); + + tearDownAll(() => database.dispose()); + + void check(Object? value, {String? expectDecodesAs}) { + final valueMatcher = switch (value) { + double(isNaN: true) => isNaN, + _ => equals(value), + }; + + // Check our encoder -> our decoder roundtrip + expect(jsonb.decode(jsonb.encode(value)), valueMatcher); + + if (supportsJsonb) { + // Check our encoder -> sqlite3 decoder rountrip + final sqliteDecoded = jsonb2json + .select([jsonb.encode(value)]) + .single + .values + .single as String; + if (expectDecodesAs != null) { + expect(sqliteDecoded, expectDecodesAs); + } else { + expect(json.decode(sqliteDecoded), valueMatcher); + } + + // Check sqlite3 encoder -> our decoder roundtrip + final sqliteEncoded = json2jsonb + .select([jsonb.encode(value)]) + .single + .values + .single as Uint8List; + expect(jsonb.decode(sqliteEncoded), valueMatcher); + } + } + + test('primitives', () { + check(null); + check(true); + check(false); + check(0); + check(-1); + check(0.0); + check(double.infinity, expectDecodesAs: 'Infinity'); + check(double.negativeInfinity, expectDecodesAs: '-Infinity'); + check(double.nan, expectDecodesAs: 'NaN'); + check('hello world'); + check('hello " world'); + check('hello \n world'); + }); + + test('arrays', () { + check([]); + check([1, 2, 3]); + check([0, 1.1, 'hello', false, null, 'world']); + }); + + test('objects', () { + check({}); + check({'foo': 'bar'}); + check({'a': null, 'b': true, 'c': 0, 'd': 0.1, 'e': 'hi'}); + }); + + test( + 'did use sqlite3 decoder', + () {}, + skip: supportsJsonb + ? null + : 'Roundtrip tests with SQLite were skipped because the available ' + 'SQLite version does not support JSONB.', + ); + }); +} + +final class _CustomJsonRepresentation { + Object? toJson() => true; +} + +final _isMalformedJsonException = + isA().having((e) => e.message, 'message', 'Malformed JSONB'); diff --git a/sqlite3/test/wasm/encryption_test.dart b/sqlite3/test/wasm/encryption_test.dart new file mode 100644 index 00000000..94227672 --- /dev/null +++ b/sqlite3/test/wasm/encryption_test.dart @@ -0,0 +1,30 @@ +@Tags(['wasm']) +library; + +import 'package:sqlite3/wasm.dart'; +import 'package:test/test.dart'; + +import 'utils.dart'; + +void main() { + test('can open databases with sqlite3mc', () async { + final sqlite3 = await loadSqlite3WithoutVfs(encryption: true); + sqlite3.registerVirtualFileSystem(InMemoryFileSystem(), makeDefault: true); + + sqlite3.open('/test') + ..execute('pragma key = "key"') + ..execute('CREATE TABLE foo (bar TEXT) STRICT;') + ..execute('INSERT INTO foo VALUES (?)', ['test']) + ..dispose(); + + final database = sqlite3.open('/test'); + expect( + () => database.select('SELECT * FROM foo'), + throwsA(isA() + .having((e) => e.message, 'message', contains('not a database'))), + ); + + database.execute('pragma key = "key"'); + expect(database.select('SELECT * FROM foo'), isNotEmpty); + }); +} diff --git a/sqlite3/test/wasm/sqlite3_test.dart b/sqlite3/test/wasm/sqlite3_test.dart index 468bf474..6f091db3 100644 --- a/sqlite3/test/wasm/sqlite3_test.dart +++ b/sqlite3/test/wasm/sqlite3_test.dart @@ -3,7 +3,6 @@ library; import 'dart:js_interop'; import 'dart:js_interop_unsafe'; -import 'dart:math'; import 'package:http/http.dart' as http; import 'package:sqlite3/wasm.dart'; @@ -35,9 +34,7 @@ void main() { sqlite3 = await WasmSqlite3.load(response.bodyBytes); sqlite3.registerVirtualFileSystem( - // Not using the default Random.secure() because it's not supported - // by dart2wasm - InMemoryFileSystem(random: Random()), + InMemoryFileSystem(), makeDefault: true, ); } @@ -48,7 +45,7 @@ void main() { expect( version, isA() - .having((e) => e.libVersion, 'libVersion', startsWith('3.46')), + .having((e) => e.libVersion, 'libVersion', startsWith('3.47')), ); }); diff --git a/sqlite3/test/wasm/utils.dart b/sqlite3/test/wasm/utils.dart index a2d9987d..39dccdb0 100644 --- a/sqlite3/test/wasm/utils.dart +++ b/sqlite3/test/wasm/utils.dart @@ -1,14 +1,12 @@ -import 'dart:math'; - import 'package:sqlite3/wasm.dart'; import 'package:test/scaffolding.dart'; -Future loadSqlite3WithoutVfs() async { +Future loadSqlite3WithoutVfs({bool encryption = false}) async { final channel = spawnHybridUri('/test/wasm/asset_server.dart'); final port = (await channel.stream.first as double).toInt(); - final sqliteWasm = - Uri.parse('http://localhost:$port/example/web/sqlite3.wasm'); + final filename = encryption ? 'sqlite3mc.wasm' : 'sqlite3.wasm'; + final sqliteWasm = Uri.parse('http://localhost:$port/example/web/$filename'); return await WasmSqlite3.loadFromUrl(sqliteWasm); } @@ -16,12 +14,7 @@ Future loadSqlite3WithoutVfs() async { Future loadSqlite3([VirtualFileSystem? defaultVfs]) async { final sqlite3 = await loadSqlite3WithoutVfs(); sqlite3.registerVirtualFileSystem( - defaultVfs ?? - InMemoryFileSystem( - // Not using the default Random.secure() because it's not supported - // by dart2wasm - random: Random(), - ), + defaultVfs ?? InMemoryFileSystem(), makeDefault: true, ); return sqlite3; diff --git a/sqlite3/tool/format_native.dart b/sqlite3/tool/format_native.dart deleted file mode 100644 index 7e054980..00000000 --- a/sqlite3/tool/format_native.dart +++ /dev/null @@ -1,11 +0,0 @@ -import 'dart:io'; - -Future main() async { - final process = await Process.start( - 'clang-format', - ['--style=google', '-i', 'assets/sqlite3.h'], - mode: ProcessStartMode.inheritStdio, - ); - - exitCode = await process.exitCode; -} diff --git a/sqlite3/tool/format_native.sh b/sqlite3/tool/format_native.sh new file mode 100755 index 00000000..236ae0e1 --- /dev/null +++ b/sqlite3/tool/format_native.sh @@ -0,0 +1,2 @@ +#!/bin/sh +clang-format --style=google -i assets/sqlite3.h assets/wasm/*.{c,h} test/**/*.c diff --git a/sqlite3_flutter_libs/.gitignore b/sqlite3_flutter_libs/.gitignore index e9dc58d3..3743457c 100644 --- a/sqlite3_flutter_libs/.gitignore +++ b/sqlite3_flutter_libs/.gitignore @@ -5,3 +5,4 @@ .pub/ build/ +darwin/sqlite3_flutter_libs/.build diff --git a/sqlite3_flutter_libs/CHANGELOG.md b/sqlite3_flutter_libs/CHANGELOG.md index 293a776b..34943a5d 100644 --- a/sqlite3_flutter_libs/CHANGELOG.md +++ b/sqlite3_flutter_libs/CHANGELOG.md @@ -1,3 +1,13 @@ +## 0.5.28 + +- Upgrade sqlite to version `3.37.2`. + +## 0.5.27 + +- Upgrade sqlite to version `3.47.1`. +- In addition to CocoaPods, this package now supports the Swift Package Manager + for iOS and macOS builds. + ## 0.5.26 - Upgrade sqlite to version `3.47.0`. diff --git a/sqlite3_flutter_libs/android/build.gradle b/sqlite3_flutter_libs/android/build.gradle index 7d80cf2a..f8b2d8c5 100644 --- a/sqlite3_flutter_libs/android/build.gradle +++ b/sqlite3_flutter_libs/android/build.gradle @@ -32,5 +32,5 @@ android { } dependencies { - implementation 'eu.simonbinder:sqlite3-native-library:3.47.0' + implementation 'eu.simonbinder:sqlite3-native-library:3.47.2' } diff --git a/sqlite3_flutter_libs/macos/sqlite3_flutter_libs.podspec b/sqlite3_flutter_libs/darwin/sqlite3_flutter_libs.podspec similarity index 55% rename from sqlite3_flutter_libs/macos/sqlite3_flutter_libs.podspec rename to sqlite3_flutter_libs/darwin/sqlite3_flutter_libs.podspec index a911ca54..458c23b0 100644 --- a/sqlite3_flutter_libs/macos/sqlite3_flutter_libs.podspec +++ b/sqlite3_flutter_libs/darwin/sqlite3_flutter_libs.podspec @@ -1,7 +1,3 @@ -# -# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html. -# Run `pod lib lint sqlite3_flutter_libs.podspec' to validate before publishing. -# Pod::Spec.new do |s| s.name = 'sqlite3_flutter_libs' s.version = '0.0.1' @@ -13,11 +9,18 @@ Pod::Spec.new do |s| s.license = { :file => '../LICENSE' } s.author = { 'Your Company' => 'email@example.com' } s.source = { :path => '.' } - s.source_files = 'Classes/**/*' - s.public_header_files = 'Classes/**/*.h' - s.dependency 'FlutterMacOS' + s.source_files = 'sqlite3_flutter_libs/Sources/sqlite3_flutter_libs/**/*.swift' + s.ios.dependency 'Flutter' + s.osx.dependency 'FlutterMacOS' + s.ios.deployment_target = '12.0' + s.osx.deployment_target = '10.14' + s.ios.xcconfig = { + 'LIBRARY_SEARCH_PATHS' => '$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)/ $(SDKROOT)/usr/lib/swift', + 'LD_RUNPATH_SEARCH_PATHS' => '/usr/lib/swift', + } + s.swift_version = '5.0' - s.dependency 'sqlite3', '~> 3.47.0' + s.dependency 'sqlite3', '~> 3.47.2' s.dependency 'sqlite3/fts5' s.dependency 'sqlite3/perf-threadsafe' s.dependency 'sqlite3/rtree' diff --git a/sqlite3_flutter_libs/darwin/sqlite3_flutter_libs/Package.resolved b/sqlite3_flutter_libs/darwin/sqlite3_flutter_libs/Package.resolved new file mode 100644 index 00000000..82d9b552 --- /dev/null +++ b/sqlite3_flutter_libs/darwin/sqlite3_flutter_libs/Package.resolved @@ -0,0 +1,14 @@ +{ + "pins" : [ + { + "identity" : "csqlite", + "kind" : "remoteSourceControl", + "location" : "https://github.com/sbooth/CSQLite.git", + "state" : { + "revision" : "c10dbeae1ea2bee3acd571c47509d6aaed1e9b92", + "version" : "3.47.2" + } + } + ], + "version" : 2 +} diff --git a/sqlite3_flutter_libs/darwin/sqlite3_flutter_libs/Package.swift b/sqlite3_flutter_libs/darwin/sqlite3_flutter_libs/Package.swift new file mode 100644 index 00000000..7f754825 --- /dev/null +++ b/sqlite3_flutter_libs/darwin/sqlite3_flutter_libs/Package.swift @@ -0,0 +1,25 @@ +// swift-tools-version: 5.9 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +import PackageDescription + +let package = Package( + name: "sqlite3_flutter_libs", + platforms: [ + .iOS("12.0"), + .macOS("10.14") + ], + products: [ + .library(name: "sqlite3-flutter-libs", type: .static, targets: ["sqlite3_flutter_libs"]) + ], + dependencies: [ + .package(url: "https://github.com/sbooth/CSQLite.git", exact: "3.47.2") + ], + targets: [ + .target( + name: "sqlite3_flutter_libs", + dependencies: ["CSQLite"], + resources: [] + ) + ] +) diff --git a/sqlite3_flutter_libs/darwin/sqlite3_flutter_libs/Sources/sqlite3_flutter_libs/Sqlite3FlutterLibsPlugin.swift b/sqlite3_flutter_libs/darwin/sqlite3_flutter_libs/Sources/sqlite3_flutter_libs/Sqlite3FlutterLibsPlugin.swift new file mode 100644 index 00000000..473e1665 --- /dev/null +++ b/sqlite3_flutter_libs/darwin/sqlite3_flutter_libs/Sources/sqlite3_flutter_libs/Sqlite3FlutterLibsPlugin.swift @@ -0,0 +1,13 @@ +import Foundation + +#if os(iOS) + import Flutter +#elseif os(macOS) + import FlutterMacOS +#endif + +public class Sqlite3FlutterLibsPlugin: NSObject, FlutterPlugin { + public static func register(with registrar: FlutterPluginRegistrar) { + // There's no native code, we just want to link sqlite3 + } +} diff --git a/sqlite3_flutter_libs/ios/.gitignore b/sqlite3_flutter_libs/ios/.gitignore deleted file mode 100644 index aa479fd3..00000000 --- a/sqlite3_flutter_libs/ios/.gitignore +++ /dev/null @@ -1,37 +0,0 @@ -.idea/ -.vagrant/ -.sconsign.dblite -.svn/ - -.DS_Store -*.swp -profile - -DerivedData/ -build/ -GeneratedPluginRegistrant.h -GeneratedPluginRegistrant.m - -.generated/ - -*.pbxuser -*.mode1v3 -*.mode2v3 -*.perspectivev3 - -!default.pbxuser -!default.mode1v3 -!default.mode2v3 -!default.perspectivev3 - -xcuserdata - -*.moved-aside - -*.pyc -*sync/ -Icon? -.tags* - -/Flutter/Generated.xcconfig -/Flutter/flutter_export_environment.sh \ No newline at end of file diff --git a/sqlite3_flutter_libs/ios/Assets/.gitkeep b/sqlite3_flutter_libs/ios/Assets/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/sqlite3_flutter_libs/ios/Classes/Sqlite3FlutterLibsPlugin.h b/sqlite3_flutter_libs/ios/Classes/Sqlite3FlutterLibsPlugin.h deleted file mode 100644 index e29ea70f..00000000 --- a/sqlite3_flutter_libs/ios/Classes/Sqlite3FlutterLibsPlugin.h +++ /dev/null @@ -1,4 +0,0 @@ -#import - -@interface Sqlite3FlutterLibsPlugin : NSObject -@end diff --git a/sqlite3_flutter_libs/ios/Classes/Sqlite3FlutterLibsPlugin.m b/sqlite3_flutter_libs/ios/Classes/Sqlite3FlutterLibsPlugin.m deleted file mode 100644 index 4a3dc707..00000000 --- a/sqlite3_flutter_libs/ios/Classes/Sqlite3FlutterLibsPlugin.m +++ /dev/null @@ -1,7 +0,0 @@ -#import "Sqlite3FlutterLibsPlugin.h" - -@implementation Sqlite3FlutterLibsPlugin -+ (void)registerWithRegistrar:(NSObject*)registrar { - -} -@end diff --git a/sqlite3_flutter_libs/ios/sqlite3_flutter_libs.podspec b/sqlite3_flutter_libs/ios/sqlite3_flutter_libs.podspec deleted file mode 100644 index 9e833068..00000000 --- a/sqlite3_flutter_libs/ios/sqlite3_flutter_libs.podspec +++ /dev/null @@ -1,30 +0,0 @@ -# -# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html. -# Run `pod lib lint sqlite3_flutter_libs.podspec' to validate before publishing. -# -Pod::Spec.new do |s| - s.name = 'sqlite3_flutter_libs' - s.version = '0.0.1' - s.summary = 'A new flutter plugin project.' - s.description = <<-DESC -A new flutter plugin project. - DESC - s.homepage = 'http://example.com' - s.license = { :file => '../LICENSE' } - s.author = { 'Your Company' => 'email@example.com' } - s.source = { :path => '.' } - s.source_files = 'Classes/**/*' - s.public_header_files = 'Classes/**/*.h' - s.dependency 'Flutter' - - s.dependency 'sqlite3', '~> 3.47.0' - s.dependency 'sqlite3/fts5' - s.dependency 'sqlite3/perf-threadsafe' - s.dependency 'sqlite3/rtree' - s.dependency 'sqlite3/dbstatvtab' - - s.platform = :ios, '12.0' - - # Flutter.framework does not contain a i386 slice. Only x86_64 simulators are supported. - s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'VALID_ARCHS[sdk=iphonesimulator*]' => 'x86_64' } -end diff --git a/sqlite3_flutter_libs/linux/CMakeLists.txt b/sqlite3_flutter_libs/linux/CMakeLists.txt index a39a2663..f3bcdbee 100644 --- a/sqlite3_flutter_libs/linux/CMakeLists.txt +++ b/sqlite3_flutter_libs/linux/CMakeLists.txt @@ -13,13 +13,13 @@ if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0") # We can't really ask users to use a cmake that recent, so there's this if here. FetchContent_Declare( sqlite3 - URL https://sqlite.org/2024/sqlite-autoconf-3470000.tar.gz + URL https://sqlite.org/2024/sqlite-autoconf-3470200.tar.gz DOWNLOAD_EXTRACT_TIMESTAMP NEW ) else() FetchContent_Declare( sqlite3 - URL https://sqlite.org/2024/sqlite-autoconf-3470000.tar.gz + URL https://sqlite.org/2024/sqlite-autoconf-3470200.tar.gz ) endif() FetchContent_MakeAvailable(sqlite3) diff --git a/sqlite3_flutter_libs/macos/Classes/Sqlite3FlutterLibsPlugin.h b/sqlite3_flutter_libs/macos/Classes/Sqlite3FlutterLibsPlugin.h deleted file mode 100644 index 6ce5b0a5..00000000 --- a/sqlite3_flutter_libs/macos/Classes/Sqlite3FlutterLibsPlugin.h +++ /dev/null @@ -1,4 +0,0 @@ -#import - -@interface Sqlite3FlutterLibsPlugin : NSObject -@end diff --git a/sqlite3_flutter_libs/macos/Classes/Sqlite3FlutterLibsPlugin.m b/sqlite3_flutter_libs/macos/Classes/Sqlite3FlutterLibsPlugin.m deleted file mode 100644 index 4a3dc707..00000000 --- a/sqlite3_flutter_libs/macos/Classes/Sqlite3FlutterLibsPlugin.m +++ /dev/null @@ -1,7 +0,0 @@ -#import "Sqlite3FlutterLibsPlugin.h" - -@implementation Sqlite3FlutterLibsPlugin -+ (void)registerWithRegistrar:(NSObject*)registrar { - -} -@end diff --git a/sqlite3_flutter_libs/pubspec.yaml b/sqlite3_flutter_libs/pubspec.yaml index 2eeab9bb..f60eb5e7 100644 --- a/sqlite3_flutter_libs/pubspec.yaml +++ b/sqlite3_flutter_libs/pubspec.yaml @@ -1,12 +1,12 @@ name: sqlite3_flutter_libs description: Flutter plugin to include native sqlite3 libraries with your app -version: 0.5.26 +version: 0.5.28 homepage: https://github.com/simolus3/sqlite3.dart/tree/main/sqlite3_flutter_libs issue_tracker: https://github.com/simolus3/sqlite3.dart/issues environment: sdk: ">=2.12.0 <4.0.0" - flutter: ">=1.10.1" + flutter: ">=3.7.0" dependencies: flutter: @@ -20,8 +20,10 @@ flutter: pluginClass: Sqlite3FlutterLibsPlugin ios: pluginClass: Sqlite3FlutterLibsPlugin + sharedDarwinSource: true macos: pluginClass: Sqlite3FlutterLibsPlugin + sharedDarwinSource: true linux: pluginClass: Sqlite3FlutterLibsPlugin windows: diff --git a/sqlite3_flutter_libs/windows/CMakeLists.txt b/sqlite3_flutter_libs/windows/CMakeLists.txt index 259ffb9f..a618ceb3 100644 --- a/sqlite3_flutter_libs/windows/CMakeLists.txt +++ b/sqlite3_flutter_libs/windows/CMakeLists.txt @@ -29,13 +29,13 @@ if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0") # We can't really ask users to use a cmake that recent, so there's this if here. FetchContent_Declare( sqlite3 - URL https://sqlite.org/2024/sqlite-autoconf-3470000.tar.gz + URL https://sqlite.org/2024/sqlite-autoconf-3470200.tar.gz DOWNLOAD_EXTRACT_TIMESTAMP NEW ) else() FetchContent_Declare( sqlite3 - URL https://sqlite.org/2024/sqlite-autoconf-3470000.tar.gz + URL https://sqlite.org/2024/sqlite-autoconf-3470200.tar.gz ) endif() FetchContent_MakeAvailable(sqlite3) diff --git a/sqlite3_test/CHANGELOG.md b/sqlite3_test/CHANGELOG.md index a0712a79..170b4664 100644 --- a/sqlite3_test/CHANGELOG.md +++ b/sqlite3_test/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.1.1 + +- Fix writes on Windows. + ## 0.1.0 - Initial version. diff --git a/sqlite3_test/LICENSE b/sqlite3_test/LICENSE new file mode 100644 index 00000000..30548a93 --- /dev/null +++ b/sqlite3_test/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Simon Binder + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/sqlite3_test/lib/sqlite3_test.dart b/sqlite3_test/lib/sqlite3_test.dart index 252877eb..2c0d9e2d 100644 --- a/sqlite3_test/lib/sqlite3_test.dart +++ b/sqlite3_test/lib/sqlite3_test.dart @@ -181,6 +181,7 @@ final class _TestFile implements VirtualFileSystemFile { } _file.unlockSync(); + _lockLevel = SqlFileLockingLevels.SQLITE_LOCK_NONE; if (mode != SqlFileLockingLevels.SQLITE_LOCK_NONE) { return xLock(mode); } diff --git a/sqlite3_test/pubspec.yaml b/sqlite3_test/pubspec.yaml index 12f1517e..af74012f 100644 --- a/sqlite3_test/pubspec.yaml +++ b/sqlite3_test/pubspec.yaml @@ -1,6 +1,6 @@ name: sqlite3_test description: Integration of fake clocks and other test utilities for SQLite databases. -version: 0.1.0 +version: 0.1.1 homepage: https://github.com/simolus3/sqlite3.dart/tree/main/sqlite3_test repository: https://github.com/simolus3/sqlite3.dart topics: diff --git a/sqlite3_web/CHANGELOG.md b/sqlite3_web/CHANGELOG.md index cddf1820..750d243c 100644 --- a/sqlite3_web/CHANGELOG.md +++ b/sqlite3_web/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.2.1 + +- Add `WebSqlite.deleteDatabase` to delete databases. + ## 0.2.0 - Make `FileSystem` implementation functional, add `FileSystem.flush()`. diff --git a/sqlite3_web/lib/src/client.dart b/sqlite3_web/lib/src/client.dart index c21f0dd8..fc2effe3 100644 --- a/sqlite3_web/lib/src/client.dart +++ b/sqlite3_web/lib/src/client.dart @@ -3,7 +3,7 @@ import 'dart:js_interop'; import 'dart:js_interop_unsafe'; import 'dart:typed_data'; -import 'package:sqlite3/common.dart'; +import 'package:sqlite3/wasm.dart' hide WorkerOptions; import 'package:web/web.dart' hide Response, Request, FileSystem, Notification, Lock; @@ -12,6 +12,7 @@ import 'channel.dart'; import 'database.dart'; import 'protocol.dart'; import 'shared.dart'; +import 'worker.dart'; final class RemoteDatabase implements Database { final WorkerConnection connection; @@ -290,6 +291,18 @@ final class DatabaseClient implements WebSqlite { }); } + @override + Future deleteDatabase( + {required String name, required StorageMode storage}) async { + switch (storage) { + case StorageMode.opfs: + await SimpleOpfsFileSystem.deleteFromStorage(pathForOpfs(name)); + case StorageMode.indexedDb: + await IndexedDbFileSystem.deleteDatabase(name); + case StorageMode.inMemory: + } + } + @override Future runFeatureDetection( {String? databaseName}) async { diff --git a/sqlite3_web/lib/src/database.dart b/sqlite3_web/lib/src/database.dart index 15e78890..6211a311 100644 --- a/sqlite3_web/lib/src/database.dart +++ b/sqlite3_web/lib/src/database.dart @@ -153,6 +153,12 @@ final class ConnectToRecommendedResult { /// Please see the readme of the `sqlite3_web` package for an overview on how /// to set up and use this package. abstract class WebSqlite { + /// Deletes a database from the [storage] if it exists. + /// + /// This method should not be called while the database is still open. + Future deleteDatabase( + {required String name, required StorageMode storage}); + /// Tries to find features related to storing and accessing databases. /// /// The [databaseName] can optionally be used to make diff --git a/sqlite3_web/test/integration_test.dart b/sqlite3_web/test/integration_test.dart index 10322a28..77b4ddc9 100644 --- a/sqlite3_web/test/integration_test.dart +++ b/sqlite3_web/test/integration_test.dart @@ -128,17 +128,7 @@ void main() { driver = TestWebDriver(server, rawDriver); await driver.driver.get('http://localhost:8080/'); - - while (true) { - try { - // This element is created after main() has completed, make sure - // all the callbacks have been installed. - await driver.driver.findElement(By.id('ready')); - break; - } on NoSuchElementException { - continue; - } - } + await driver.waitReady(); }); tearDown(() => driver.driver.quit()); @@ -170,6 +160,26 @@ void main() { expect(await driver.assertFile(true), isPositive); await driver.flush(); + + if (storage != StorageMode.inMemory) { + await driver.driver.refresh(); + await driver.waitReady(); + + await driver.openDatabase( + implementation: (storage, access), + onlyOpenVfs: true, + ); + await driver.assertFile(true); + + await driver.driver.refresh(); + await driver.waitReady(); + await driver.delete(storage); + await driver.openDatabase( + implementation: (storage, access), + onlyOpenVfs: true, + ); + await driver.assertFile(false); + } }); } }); diff --git a/sqlite3_web/tool/server.dart b/sqlite3_web/tool/server.dart index 6ea74e53..35b7980f 100644 --- a/sqlite3_web/tool/server.dart +++ b/sqlite3_web/tool/server.dart @@ -13,6 +13,7 @@ import 'package:shelf/shelf_io.dart'; import 'package:shelf_proxy/shelf_proxy.dart'; import 'package:webdriver/async_io.dart'; import 'package:sqlite3_web/src/types.dart'; +import 'package:webdriver/support/async.dart'; void main() async { await TestAssetServer.start(); @@ -104,6 +105,12 @@ class TestWebDriver { TestWebDriver(this.server, this.driver); + /// Wait for the Dart code on the test page to finish its main method, which + /// it signals by creating an element. + Future waitReady() async { + await waitFor(() => driver.findElement(By.id('ready'))); + } + Future< ({ Set<(StorageMode, AccessMode)> impls, @@ -201,4 +208,9 @@ class TestWebDriver { throw 'flush() failed: $result'; } } + + Future delete(StorageMode mode) async { + await driver + .executeAsync('delete_db(arguments[0], arguments[1])', [mode.name]); + } } diff --git a/sqlite3_web/web/main.dart b/sqlite3_web/web/main.dart index 04328335..76d82d08 100644 --- a/sqlite3_web/web/main.dart +++ b/sqlite3_web/web/main.dart @@ -58,6 +58,12 @@ void main() { await vfs.flush(); return true.toJS; }); + _addCallbackForWebDriver('delete_db', (arg) async { + final storage = StorageMode.values.byName(arg!); + await initializeSqlite() + .deleteDatabase(name: databaseName, storage: storage); + return true.toJS; + }); document.getElementById('selfcheck')?.onClick.listen((event) async { print('starting');