diff --git a/extras/integration_tests/flutter_db/.gitignore b/extras/integration_tests/flutter_db/.gitignore new file mode 100644 index 00000000..ac4a9064 --- /dev/null +++ b/extras/integration_tests/flutter_db/.gitignore @@ -0,0 +1,72 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ + +# 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/ +.dart_tool/ +.flutter-plugins +.packages +.pub-cache/ +.pub/ +/build/ + +# Android related +**/android/**/gradle-wrapper.jar +**/android/.gradle +**/android/captures/ +**/android/gradlew +**/android/gradlew.bat +**/android/local.properties +**/android/**/GeneratedPluginRegistrant.java + +# iOS/XCode related +**/ios/**/*.mode1v3 +**/ios/**/*.mode2v3 +**/ios/**/*.moved-aside +**/ios/**/*.pbxuser +**/ios/**/*.perspectivev3 +**/ios/**/*sync/ +**/ios/**/.sconsign.dblite +**/ios/**/.tags* +**/ios/**/.vagrant/ +**/ios/**/DerivedData/ +**/ios/**/Icon? +**/ios/**/Pods/ +**/ios/**/.symlinks/ +**/ios/**/profile +**/ios/**/xcuserdata +**/ios/.generated/ +**/ios/Flutter/App.framework +**/ios/Flutter/Flutter.framework +**/ios/Flutter/Generated.xcconfig +**/ios/Flutter/app.flx +**/ios/Flutter/app.zip +**/ios/Flutter/flutter_assets/ +**/ios/ServiceDefinitions.json +**/ios/Runner/GeneratedPluginRegistrant.* + +# Exceptions to above rules. +!**/ios/**/default.mode1v3 +!**/ios/**/default.mode2v3 +!**/ios/**/default.pbxuser +!**/ios/**/default.perspectivev3 +!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages diff --git a/extras/integration_tests/flutter_db/.metadata b/extras/integration_tests/flutter_db/.metadata new file mode 100644 index 00000000..e43399fb --- /dev/null +++ b/extras/integration_tests/flutter_db/.metadata @@ -0,0 +1,10 @@ +# 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: d51fd86cdb486192e187ccdf6f02cb2a38273d8d + channel: beta + +project_type: app diff --git a/extras/integration_tests/flutter_db/android/app/build.gradle b/extras/integration_tests/flutter_db/android/app/build.gradle new file mode 100644 index 00000000..d9c4718a --- /dev/null +++ b/extras/integration_tests/flutter_db/android/app/build.gradle @@ -0,0 +1,61 @@ +def localProperties = new Properties() +def localPropertiesFile = rootProject.file('local.properties') +if (localPropertiesFile.exists()) { + localPropertiesFile.withReader('UTF-8') { reader -> + localProperties.load(reader) + } +} + +def flutterRoot = localProperties.getProperty('flutter.sdk') +if (flutterRoot == null) { + throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") +} + +def flutterVersionCode = localProperties.getProperty('flutter.versionCode') +if (flutterVersionCode == null) { + flutterVersionCode = '1' +} + +def flutterVersionName = localProperties.getProperty('flutter.versionName') +if (flutterVersionName == null) { + flutterVersionName = '1.0' +} + +apply plugin: 'com.android.application' +apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" + +android { + compileSdkVersion 28 + + lintOptions { + disable 'InvalidPackage' + } + + defaultConfig { + // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). + applicationId "com.example.flutter_db" + minSdkVersion 16 + targetSdkVersion 28 + versionCode flutterVersionCode.toInteger() + versionName flutterVersionName + testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + // TODO: Add your own signing config for the release build. + // Signing with the debug keys for now, so `flutter run --release` works. + signingConfig signingConfigs.debug + } + } +} + +flutter { + source '../..' +} + +dependencies { + testImplementation 'junit:junit:4.12' + androidTestImplementation 'com.android.support.test:runner:1.0.2' + androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' +} diff --git a/extras/integration_tests/flutter_db/android/app/src/debug/AndroidManifest.xml b/extras/integration_tests/flutter_db/android/app/src/debug/AndroidManifest.xml new file mode 100644 index 00000000..16027795 --- /dev/null +++ b/extras/integration_tests/flutter_db/android/app/src/debug/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/extras/integration_tests/flutter_db/android/app/src/main/AndroidManifest.xml b/extras/integration_tests/flutter_db/android/app/src/main/AndroidManifest.xml new file mode 100644 index 00000000..3a3a636b --- /dev/null +++ b/extras/integration_tests/flutter_db/android/app/src/main/AndroidManifest.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + diff --git a/extras/integration_tests/flutter_db/android/app/src/main/java/com/example/flutter_db/MainActivity.java b/extras/integration_tests/flutter_db/android/app/src/main/java/com/example/flutter_db/MainActivity.java new file mode 100644 index 00000000..82c21179 --- /dev/null +++ b/extras/integration_tests/flutter_db/android/app/src/main/java/com/example/flutter_db/MainActivity.java @@ -0,0 +1,13 @@ +package com.example.flutter_db; + +import android.os.Bundle; +import io.flutter.app.FlutterActivity; +import io.flutter.plugins.GeneratedPluginRegistrant; + +public class MainActivity extends FlutterActivity { + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + GeneratedPluginRegistrant.registerWith(this); + } +} diff --git a/extras/integration_tests/flutter_db/android/app/src/main/res/drawable/launch_background.xml b/extras/integration_tests/flutter_db/android/app/src/main/res/drawable/launch_background.xml new file mode 100644 index 00000000..304732f8 --- /dev/null +++ b/extras/integration_tests/flutter_db/android/app/src/main/res/drawable/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/extras/integration_tests/flutter_db/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/extras/integration_tests/flutter_db/android/app/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 00000000..db77bb4b Binary files /dev/null and b/extras/integration_tests/flutter_db/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/extras/integration_tests/flutter_db/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/extras/integration_tests/flutter_db/android/app/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 00000000..17987b79 Binary files /dev/null and b/extras/integration_tests/flutter_db/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/extras/integration_tests/flutter_db/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/extras/integration_tests/flutter_db/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 00000000..09d43914 Binary files /dev/null and b/extras/integration_tests/flutter_db/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/extras/integration_tests/flutter_db/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/extras/integration_tests/flutter_db/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 00000000..d5f1c8d3 Binary files /dev/null and b/extras/integration_tests/flutter_db/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/extras/integration_tests/flutter_db/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/extras/integration_tests/flutter_db/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 00000000..4d6372ee Binary files /dev/null and b/extras/integration_tests/flutter_db/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/extras/integration_tests/flutter_db/android/app/src/main/res/values/styles.xml b/extras/integration_tests/flutter_db/android/app/src/main/res/values/styles.xml new file mode 100644 index 00000000..00fa4417 --- /dev/null +++ b/extras/integration_tests/flutter_db/android/app/src/main/res/values/styles.xml @@ -0,0 +1,8 @@ + + + + diff --git a/extras/integration_tests/flutter_db/android/app/src/profile/AndroidManifest.xml b/extras/integration_tests/flutter_db/android/app/src/profile/AndroidManifest.xml new file mode 100644 index 00000000..16027795 --- /dev/null +++ b/extras/integration_tests/flutter_db/android/app/src/profile/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/extras/integration_tests/flutter_db/android/build.gradle b/extras/integration_tests/flutter_db/android/build.gradle new file mode 100644 index 00000000..bb8a3038 --- /dev/null +++ b/extras/integration_tests/flutter_db/android/build.gradle @@ -0,0 +1,29 @@ +buildscript { + repositories { + google() + jcenter() + } + + dependencies { + classpath 'com.android.tools.build:gradle:3.2.1' + } +} + +allprojects { + repositories { + google() + jcenter() + } +} + +rootProject.buildDir = '../build' +subprojects { + project.buildDir = "${rootProject.buildDir}/${project.name}" +} +subprojects { + project.evaluationDependsOn(':app') +} + +task clean(type: Delete) { + delete rootProject.buildDir +} diff --git a/extras/integration_tests/flutter_db/android/gradle.properties b/extras/integration_tests/flutter_db/android/gradle.properties new file mode 100644 index 00000000..2bd6f4fd --- /dev/null +++ b/extras/integration_tests/flutter_db/android/gradle.properties @@ -0,0 +1,2 @@ +org.gradle.jvmargs=-Xmx1536M + diff --git a/extras/integration_tests/flutter_db/android/gradle/wrapper/gradle-wrapper.properties b/extras/integration_tests/flutter_db/android/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 00000000..2819f022 --- /dev/null +++ b/extras/integration_tests/flutter_db/android/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Fri Jun 23 08:50:38 CEST 2017 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip diff --git a/extras/integration_tests/flutter_db/android/settings.gradle b/extras/integration_tests/flutter_db/android/settings.gradle new file mode 100644 index 00000000..5a2f14fb --- /dev/null +++ b/extras/integration_tests/flutter_db/android/settings.gradle @@ -0,0 +1,15 @@ +include ':app' + +def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() + +def plugins = new Properties() +def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') +if (pluginsFile.exists()) { + pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } +} + +plugins.each { name, path -> + def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() + include ":$name" + project(":$name").projectDir = pluginDirectory +} diff --git a/extras/integration_tests/flutter_db/ios/Flutter/AppFrameworkInfo.plist b/extras/integration_tests/flutter_db/ios/Flutter/AppFrameworkInfo.plist new file mode 100644 index 00000000..6b4c0f78 --- /dev/null +++ b/extras/integration_tests/flutter_db/ios/Flutter/AppFrameworkInfo.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + App + CFBundleIdentifier + io.flutter.flutter.app + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + App + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + MinimumOSVersion + 8.0 + + diff --git a/extras/integration_tests/flutter_db/ios/Flutter/Debug.xcconfig b/extras/integration_tests/flutter_db/ios/Flutter/Debug.xcconfig new file mode 100644 index 00000000..592ceee8 --- /dev/null +++ b/extras/integration_tests/flutter_db/ios/Flutter/Debug.xcconfig @@ -0,0 +1 @@ +#include "Generated.xcconfig" diff --git a/extras/integration_tests/flutter_db/ios/Flutter/Release.xcconfig b/extras/integration_tests/flutter_db/ios/Flutter/Release.xcconfig new file mode 100644 index 00000000..592ceee8 --- /dev/null +++ b/extras/integration_tests/flutter_db/ios/Flutter/Release.xcconfig @@ -0,0 +1 @@ +#include "Generated.xcconfig" diff --git a/extras/integration_tests/flutter_db/ios/Runner.xcodeproj/project.pbxproj b/extras/integration_tests/flutter_db/ios/Runner.xcodeproj/project.pbxproj new file mode 100644 index 00000000..6a227e18 --- /dev/null +++ b/extras/integration_tests/flutter_db/ios/Runner.xcodeproj/project.pbxproj @@ -0,0 +1,512 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; + 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; }; + 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; }; + 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; }; + 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; }; + 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; }; + 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 PBXCopyFilesBuildPhase section */ + 9705A1C41CF9048500538489 /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */, + 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */, + ); + 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 = ""; }; + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; + 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; }; + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; + 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; 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 = ""; }; + 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; }; + 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 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 = ( + 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */, + 3B80C3941E831B6300D905FE /* App.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 9740EEB11CF90186004384FC /* Flutter */ = { + isa = PBXGroup; + children = ( + 3B80C3931E831B6300D905FE /* App.framework */, + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, + 9740EEBA1CF902C7004384FC /* Flutter.framework */, + 9740EEB21CF90195004384FC /* Debug.xcconfig */, + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, + 9740EEB31CF90195004384FC /* Generated.xcconfig */, + ); + name = Flutter; + sourceTree = ""; + }; + 97C146E51CF9000F007C117D = { + isa = PBXGroup; + children = ( + 9740EEB11CF90186004384FC /* Flutter */, + 97C146F01CF9000F007C117D /* Runner */, + 97C146EF1CF9000F007C117D /* Products */, + CF3B75C9A7D2FA2A4C99F110 /* Frameworks */, + ); + sourceTree = ""; + }; + 97C146EF1CF9000F007C117D /* Products */ = { + isa = PBXGroup; + children = ( + 97C146EE1CF9000F007C117D /* Runner.app */, + ); + name = Products; + sourceTree = ""; + }; + 97C146F01CF9000F007C117D /* Runner */ = { + isa = PBXGroup; + children = ( + 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */, + 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */, + 97C146FA1CF9000F007C117D /* Main.storyboard */, + 97C146FD1CF9000F007C117D /* Assets.xcassets */, + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, + 97C147021CF9000F007C117D /* Info.plist */, + 97C146F11CF9000F007C117D /* Supporting Files */, + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, + ); + path = Runner; + sourceTree = ""; + }; + 97C146F11CF9000F007C117D /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 97C146F21CF9000F007C117D /* main.m */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 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; + productName = Runner; + productReference = 97C146EE1CF9000F007C117D /* Runner.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 97C146E61CF9000F007C117D /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 1020; + ORGANIZATIONNAME = "The Chromium Authors"; + TargetAttributes = { + 97C146ED1CF9000F007C117D = { + CreatedOnToolsVersion = 7.3.1; + }; + }; + }; + buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 97C146E51CF9000F007C117D; + productRefGroup = 97C146EF1CF9000F007C117D /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 97C146ED1CF9000F007C117D /* Runner */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 97C146EC1CF9000F007C117D /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, + 9740EEB41CF90195004384FC /* Debug.xcconfig 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; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Thin Binary"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin"; + }; + 9740EEB61CF901F6004384FC /* Run Script */ = { + isa = PBXShellScriptBuildPhase; + 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 */ + 97C146EA1CF9000F007C117D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */, + 97C146F31CF9000F007C117D /* main.m in Sources */, + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase 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; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + 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; + 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 = 8.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = 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; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = S8QB4VV633; + ENABLE_BITCODE = NO; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterDb; + PRODUCT_NAME = "$(TARGET_NAME)"; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Profile; + }; + 97C147031CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + 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; + 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 = 8.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 97C147041CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + 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; + 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 = 8.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 97C147061CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterDb; + PRODUCT_NAME = "$(TARGET_NAME)"; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Debug; + }; + 97C147071CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterDb; + PRODUCT_NAME = "$(TARGET_NAME)"; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 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 */ + }; + rootObject = 97C146E61CF9000F007C117D /* Project object */; +} diff --git a/extras/integration_tests/flutter_db/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/extras/integration_tests/flutter_db/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 00000000..1d526a16 --- /dev/null +++ b/extras/integration_tests/flutter_db/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/extras/integration_tests/flutter_db/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/extras/integration_tests/flutter_db/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme new file mode 100644 index 00000000..a28140cf --- /dev/null +++ b/extras/integration_tests/flutter_db/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extras/integration_tests/flutter_db/ios/Runner.xcworkspace/contents.xcworkspacedata b/extras/integration_tests/flutter_db/ios/Runner.xcworkspace/contents.xcworkspacedata new file mode 100644 index 00000000..1d526a16 --- /dev/null +++ b/extras/integration_tests/flutter_db/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/extras/integration_tests/flutter_db/ios/Runner/AppDelegate.h b/extras/integration_tests/flutter_db/ios/Runner/AppDelegate.h new file mode 100644 index 00000000..36e21bbf --- /dev/null +++ b/extras/integration_tests/flutter_db/ios/Runner/AppDelegate.h @@ -0,0 +1,6 @@ +#import +#import + +@interface AppDelegate : FlutterAppDelegate + +@end diff --git a/extras/integration_tests/flutter_db/ios/Runner/AppDelegate.m b/extras/integration_tests/flutter_db/ios/Runner/AppDelegate.m new file mode 100644 index 00000000..59a72e90 --- /dev/null +++ b/extras/integration_tests/flutter_db/ios/Runner/AppDelegate.m @@ -0,0 +1,13 @@ +#include "AppDelegate.h" +#include "GeneratedPluginRegistrant.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application + didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + [GeneratedPluginRegistrant registerWithRegistry:self]; + // Override point for customization after application launch. + return [super application:application didFinishLaunchingWithOptions:launchOptions]; +} + +@end diff --git a/extras/integration_tests/flutter_db/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/extras/integration_tests/flutter_db/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 00000000..d36b1fab --- /dev/null +++ b/extras/integration_tests/flutter_db/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/extras/integration_tests/flutter_db/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/extras/integration_tests/flutter_db/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png new file mode 100644 index 00000000..3d43d11e Binary files /dev/null and b/extras/integration_tests/flutter_db/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png differ diff --git a/extras/integration_tests/flutter_db/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/extras/integration_tests/flutter_db/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png new file mode 100644 index 00000000..28c6bf03 Binary files /dev/null and b/extras/integration_tests/flutter_db/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png differ diff --git a/extras/integration_tests/flutter_db/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/extras/integration_tests/flutter_db/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png new file mode 100644 index 00000000..2ccbfd96 Binary files /dev/null and b/extras/integration_tests/flutter_db/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png differ diff --git a/extras/integration_tests/flutter_db/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/extras/integration_tests/flutter_db/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png new file mode 100644 index 00000000..f091b6b0 Binary files /dev/null and b/extras/integration_tests/flutter_db/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png differ diff --git a/extras/integration_tests/flutter_db/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/extras/integration_tests/flutter_db/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png new file mode 100644 index 00000000..4cde1211 Binary files /dev/null and b/extras/integration_tests/flutter_db/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png differ diff --git a/extras/integration_tests/flutter_db/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/extras/integration_tests/flutter_db/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png new file mode 100644 index 00000000..d0ef06e7 Binary files /dev/null and b/extras/integration_tests/flutter_db/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png differ diff --git a/extras/integration_tests/flutter_db/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/extras/integration_tests/flutter_db/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png new file mode 100644 index 00000000..dcdc2306 Binary files /dev/null and b/extras/integration_tests/flutter_db/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png differ diff --git a/extras/integration_tests/flutter_db/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/extras/integration_tests/flutter_db/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png new file mode 100644 index 00000000..2ccbfd96 Binary files /dev/null and b/extras/integration_tests/flutter_db/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png differ diff --git a/extras/integration_tests/flutter_db/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/extras/integration_tests/flutter_db/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png new file mode 100644 index 00000000..c8f9ed8f Binary files /dev/null and b/extras/integration_tests/flutter_db/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png differ diff --git a/extras/integration_tests/flutter_db/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/extras/integration_tests/flutter_db/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png new file mode 100644 index 00000000..a6d6b860 Binary files /dev/null and b/extras/integration_tests/flutter_db/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png differ diff --git a/extras/integration_tests/flutter_db/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/extras/integration_tests/flutter_db/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png new file mode 100644 index 00000000..a6d6b860 Binary files /dev/null and b/extras/integration_tests/flutter_db/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png differ diff --git a/extras/integration_tests/flutter_db/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/extras/integration_tests/flutter_db/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png new file mode 100644 index 00000000..75b2d164 Binary files /dev/null and b/extras/integration_tests/flutter_db/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png differ diff --git a/extras/integration_tests/flutter_db/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/extras/integration_tests/flutter_db/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png new file mode 100644 index 00000000..c4df70d3 Binary files /dev/null and b/extras/integration_tests/flutter_db/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png differ diff --git a/extras/integration_tests/flutter_db/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/extras/integration_tests/flutter_db/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png new file mode 100644 index 00000000..6a84f41e Binary files /dev/null and b/extras/integration_tests/flutter_db/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png differ diff --git a/extras/integration_tests/flutter_db/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/extras/integration_tests/flutter_db/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png new file mode 100644 index 00000000..d0e1f585 Binary files /dev/null and b/extras/integration_tests/flutter_db/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ diff --git a/extras/integration_tests/flutter_db/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/extras/integration_tests/flutter_db/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json new file mode 100644 index 00000000..0bedcf2f --- /dev/null +++ b/extras/integration_tests/flutter_db/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/extras/integration_tests/flutter_db/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/extras/integration_tests/flutter_db/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png new file mode 100644 index 00000000..9da19eac Binary files /dev/null and b/extras/integration_tests/flutter_db/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png differ diff --git a/extras/integration_tests/flutter_db/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/extras/integration_tests/flutter_db/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png new file mode 100644 index 00000000..9da19eac Binary files /dev/null and b/extras/integration_tests/flutter_db/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png differ diff --git a/extras/integration_tests/flutter_db/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/extras/integration_tests/flutter_db/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png new file mode 100644 index 00000000..9da19eac Binary files /dev/null and b/extras/integration_tests/flutter_db/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png differ diff --git a/extras/integration_tests/flutter_db/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/extras/integration_tests/flutter_db/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md new file mode 100644 index 00000000..89c2725b --- /dev/null +++ b/extras/integration_tests/flutter_db/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/extras/integration_tests/flutter_db/ios/Runner/Base.lproj/LaunchScreen.storyboard b/extras/integration_tests/flutter_db/ios/Runner/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 00000000..f2e259c7 --- /dev/null +++ b/extras/integration_tests/flutter_db/ios/Runner/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extras/integration_tests/flutter_db/ios/Runner/Base.lproj/Main.storyboard b/extras/integration_tests/flutter_db/ios/Runner/Base.lproj/Main.storyboard new file mode 100644 index 00000000..f3c28516 --- /dev/null +++ b/extras/integration_tests/flutter_db/ios/Runner/Base.lproj/Main.storyboard @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extras/integration_tests/flutter_db/ios/Runner/Info.plist b/extras/integration_tests/flutter_db/ios/Runner/Info.plist new file mode 100644 index 00000000..b83f8662 --- /dev/null +++ b/extras/integration_tests/flutter_db/ios/Runner/Info.plist @@ -0,0 +1,45 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + flutter_db + 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 + + UIViewControllerBasedStatusBarAppearance + + + diff --git a/extras/integration_tests/flutter_db/ios/Runner/main.m b/extras/integration_tests/flutter_db/ios/Runner/main.m new file mode 100644 index 00000000..dff6597e --- /dev/null +++ b/extras/integration_tests/flutter_db/ios/Runner/main.m @@ -0,0 +1,9 @@ +#import +#import +#import "AppDelegate.h" + +int main(int argc, char* argv[]) { + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/extras/integration_tests/flutter_db/lib/main.dart b/extras/integration_tests/flutter_db/lib/main.dart new file mode 100644 index 00000000..a7c75bff --- /dev/null +++ b/extras/integration_tests/flutter_db/lib/main.dart @@ -0,0 +1,27 @@ +import 'dart:io'; + +import 'package:tests/tests.dart'; +import 'package:moor_flutter/moor_flutter.dart'; +import 'package:sqflite/sqflite.dart' show getDatabasesPath; +import 'package:path/path.dart'; + +class SqfliteExecutor extends TestExecutor { + @override + QueryExecutor createExecutor() { + return FlutterQueryExecutor.inDatabaseFolder(path: 'app.db'); + } + + @override + Future deleteData() async { + final folder = await getDatabasesPath(); + final file = File(join(folder, 'app.db')); + + if (await file.exists()) { + await file.delete(); + } + } +} + +void main() { + runAllTests(SqfliteExecutor()); +} diff --git a/extras/integration_tests/flutter_db/pubspec.lock b/extras/integration_tests/flutter_db/pubspec.lock new file mode 100644 index 00000000..0222aea9 --- /dev/null +++ b/extras/integration_tests/flutter_db/pubspec.lock @@ -0,0 +1,408 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + analyzer: + dependency: transitive + description: + name: analyzer + url: "https://pub.dartlang.org" + source: hosted + version: "0.36.4" + args: + dependency: transitive + description: + name: args + url: "https://pub.dartlang.org" + source: hosted + version: "1.5.2" + async: + dependency: transitive + description: + name: async + url: "https://pub.dartlang.org" + source: hosted + version: "2.2.0" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.4" + charcode: + dependency: transitive + description: + name: charcode + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.2" + collection: + dependency: transitive + description: + name: collection + url: "https://pub.dartlang.org" + source: hosted + version: "1.14.11" + convert: + dependency: transitive + description: + name: convert + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.1" + crypto: + dependency: transitive + description: + name: crypto + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.6" + csslib: + dependency: transitive + description: + name: csslib + url: "https://pub.dartlang.org" + source: hosted + version: "0.16.1" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + front_end: + dependency: transitive + description: + name: front_end + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.19" + glob: + dependency: transitive + description: + name: glob + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.7" + html: + dependency: transitive + description: + name: html + url: "https://pub.dartlang.org" + source: hosted + version: "0.14.0+2" + http: + dependency: transitive + description: + name: http + url: "https://pub.dartlang.org" + source: hosted + version: "0.12.0+2" + http_multi_server: + dependency: transitive + description: + name: http_multi_server + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + http_parser: + dependency: transitive + description: + name: http_parser + url: "https://pub.dartlang.org" + source: hosted + version: "3.1.3" + io: + dependency: transitive + description: + name: io + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.3" + js: + dependency: transitive + description: + name: js + url: "https://pub.dartlang.org" + source: hosted + version: "0.6.1+1" + json_annotation: + dependency: transitive + description: + name: json_annotation + url: "https://pub.dartlang.org" + source: hosted + version: "2.4.0" + json_rpc_2: + dependency: transitive + description: + name: json_rpc_2 + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + kernel: + dependency: transitive + description: + name: kernel + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.19" + matcher: + dependency: transitive + description: + name: matcher + url: "https://pub.dartlang.org" + source: hosted + version: "0.12.5" + meta: + dependency: transitive + description: + name: meta + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.6" + mime: + dependency: transitive + description: + name: mime + url: "https://pub.dartlang.org" + source: hosted + version: "0.9.6+3" + moor: + dependency: "direct overridden" + description: + path: "../../../moor" + relative: true + source: path + version: "1.6.0" + moor_flutter: + dependency: "direct main" + description: + path: "../../../moor_flutter" + relative: true + source: path + version: "1.6.0" + multi_server_socket: + dependency: transitive + description: + name: multi_server_socket + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.2" + node_preamble: + dependency: transitive + description: + name: node_preamble + url: "https://pub.dartlang.org" + source: hosted + version: "1.4.5" + package_config: + dependency: transitive + description: + name: package_config + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.5" + package_resolver: + dependency: transitive + description: + name: package_resolver + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.10" + path: + dependency: transitive + description: + name: path + url: "https://pub.dartlang.org" + source: hosted + version: "1.6.2" + pedantic: + dependency: transitive + description: + name: pedantic + url: "https://pub.dartlang.org" + source: hosted + version: "1.7.0" + pool: + dependency: transitive + description: + name: pool + url: "https://pub.dartlang.org" + source: hosted + version: "1.4.0" + pub_semver: + dependency: transitive + description: + name: pub_semver + url: "https://pub.dartlang.org" + source: hosted + version: "1.4.2" + shelf: + dependency: transitive + description: + name: shelf + url: "https://pub.dartlang.org" + source: hosted + version: "0.7.5" + shelf_packages_handler: + dependency: transitive + description: + name: shelf_packages_handler + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.4" + shelf_static: + dependency: transitive + description: + name: shelf_static + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.8" + shelf_web_socket: + dependency: transitive + description: + name: shelf_web_socket + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.3" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.99" + source_map_stack_trace: + dependency: transitive + description: + name: source_map_stack_trace + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.5" + source_maps: + dependency: transitive + description: + name: source_maps + url: "https://pub.dartlang.org" + source: hosted + version: "0.10.8" + source_span: + dependency: transitive + description: + name: source_span + url: "https://pub.dartlang.org" + source: hosted + version: "1.5.5" + sqflite: + dependency: transitive + description: + name: sqflite + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.6+2" + stack_trace: + dependency: transitive + description: + name: stack_trace + url: "https://pub.dartlang.org" + source: hosted + version: "1.9.3" + stream_channel: + dependency: transitive + description: + name: stream_channel + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" + string_scanner: + dependency: transitive + description: + name: string_scanner + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.4" + synchronized: + dependency: transitive + description: + name: synchronized + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0+1" + term_glyph: + dependency: transitive + description: + name: term_glyph + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + test: + dependency: "direct dev" + description: + name: test + url: "https://pub.dartlang.org" + source: hosted + version: "1.6.3" + test_api: + dependency: transitive + description: + name: test_api + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.5" + test_core: + dependency: transitive + description: + name: test_core + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.5" + tests: + dependency: "direct main" + description: + path: "../tests" + relative: true + source: path + version: "0.0.0" + typed_data: + dependency: transitive + description: + name: typed_data + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.6" + vector_math: + dependency: transitive + description: + name: vector_math + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.8" + vm_service_client: + dependency: transitive + description: + name: vm_service_client + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.6+2" + watcher: + dependency: transitive + description: + name: watcher + url: "https://pub.dartlang.org" + source: hosted + version: "0.9.7+12" + web_socket_channel: + dependency: transitive + description: + name: web_socket_channel + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.13" + yaml: + dependency: transitive + description: + name: yaml + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.16" +sdks: + dart: ">=2.4.0 <3.0.0" + flutter: ">=1.2.1 <2.0.0" diff --git a/extras/integration_tests/flutter_db/pubspec.yaml b/extras/integration_tests/flutter_db/pubspec.yaml new file mode 100644 index 00000000..55a06b19 --- /dev/null +++ b/extras/integration_tests/flutter_db/pubspec.yaml @@ -0,0 +1,22 @@ +name: flutter_db +description: Moor integration tests running on sqflite +version: 1.0.0+1 + +environment: + sdk: ">=2.1.0 <3.0.0" + +dependencies: + flutter: + sdk: flutter + moor_flutter: + tests: + path: ../tests + +dev_dependencies: + test: + +dependency_overrides: + moor_flutter: + path: ../../../moor_flutter + moor: + path: ../../../moor \ No newline at end of file diff --git a/extras/integration_tests/tests/.gitignore b/extras/integration_tests/tests/.gitignore new file mode 100644 index 00000000..50602ac6 --- /dev/null +++ b/extras/integration_tests/tests/.gitignore @@ -0,0 +1,11 @@ +# Files and directories created by pub +.dart_tool/ +.packages +# Remove the following pattern if you wish to check in your lock file +pubspec.lock + +# Conventional directory for build outputs +build/ + +# Directory created by dartdoc +doc/api/ diff --git a/extras/integration_tests/tests/lib/data/sample_data.dart b/extras/integration_tests/tests/lib/data/sample_data.dart new file mode 100644 index 00000000..06852c26 --- /dev/null +++ b/extras/integration_tests/tests/lib/data/sample_data.dart @@ -0,0 +1,27 @@ +import 'package:moor/moor.dart'; +import 'package:tests/database/database.dart'; + +class People { + static const int dashId = 1, dukeId = 2, gopherId = 3; + + static UsersCompanion dash = UsersCompanion( + name: const Value('Dash'), + birthDate: Value(DateTime(2011, 10, 11)), + ); + + static UsersCompanion duke = UsersCompanion( + name: const Value('Duke'), + birthDate: Value(DateTime(1996, 1, 23)), + ); + + static UsersCompanion gopher = UsersCompanion( + name: const Value('Go Gopher'), + birthDate: Value(DateTime(2012, 3, 28)), + ); + + static UsersCompanion florian = UsersCompanion( + name: const Value( + 'Florian, the fluffy Ferret from Florida familiar with Flutter'), + birthDate: Value(DateTime(2015, 4, 29)), + ); +} diff --git a/extras/integration_tests/tests/lib/database/database.dart b/extras/integration_tests/tests/lib/database/database.dart new file mode 100644 index 00000000..2665d670 --- /dev/null +++ b/extras/integration_tests/tests/lib/database/database.dart @@ -0,0 +1,138 @@ +import 'dart:convert'; + +import 'package:json_annotation/json_annotation.dart' as j; +import 'package:moor/moor.dart'; + +import 'package:tests/data/sample_data.dart'; + +part 'database.g.dart'; + +class Users extends Table { + IntColumn get id => integer().autoIncrement()(); + TextColumn get name => text()(); + @JsonKey('born_on') + DateTimeColumn get birthDate => dateTime()(); + + BlobColumn get profilePicture => blob().nullable()(); + + // todo enable custom column example. The feature isn't stable yet. + //TextColumn get preferences => + // text().map(const PreferenceConverter()).nullable()(); +} + +class Friendships extends Table { + IntColumn get firstUser => integer()(); + IntColumn get secondUser => integer()(); + + BoolColumn get reallyGoodFriends => + boolean().withDefault(const Constant(false))(); + + @override + Set get primaryKey => {firstUser, secondUser}; +} + +@j.JsonSerializable() +class Preferences { + bool receiveEmails; + + Preferences(this.receiveEmails); + + factory Preferences.fromJson(Map json) => + _$PreferencesFromJson(json); + + Map toJson() => _$PreferencesToJson(this); +} + +class PreferenceConverter extends TypeConverter { + const PreferenceConverter(); + @override + Preferences mapToDart(String fromDb) { + if (fromDb == null) { + return null; + } + return Preferences.fromJson(json.decode(fromDb) as Map); + } + + @override + String mapToSql(Preferences value) { + if (value == null) { + return null; + } + + return json.encode(json.encode(value.toJson())); + } +} + +@UseMoor( + tables: [Users, Friendships], + queries: { + 'mostPopularUsers': + 'SELECT * FROM users u ORDER BY (SELECT COUNT(*) FROM friendships WHERE first_user = u.id OR second_user = u.id) DESC LIMIT :amount', + 'amountOfGoodFriends': + 'SELECT COUNT(*) FROM friendships f WHERE f.really_good_friends AND (f.first_user = :user OR f.second_user = :user)', + 'userCount': 'SELECT COUNT(id) FROM users', + }, +) +class Database extends _$Database { + /// We make the schema version configurable to test migrations + @override + final int schemaVersion; + + Database(QueryExecutor e, {this.schemaVersion = 2}) : super(e); + + @override + MigrationStrategy get migration { + return MigrationStrategy( + onCreate: (m) async { + await m.createTable(users); + if (schemaVersion >= 2) { + await m.createTable(friendships); + } + }, + onUpgrade: (m, from, to) async { + if (from == 1) { + await m.createTable(friendships); + } + }, + beforeOpen: (_, details) async { + if (details.wasCreated) { + await into(users) + .insertAll([People.dash, People.duke, People.gopher]); + } + }, + ); + } + + Future deleteUser(User user, {bool fail = false}) { + return transaction((_) async { + final id = user.id; + delete(friendships) + .where((f) => or(f.firstUser.equals(id), f.secondUser.equals(id))); + + if (fail) { + throw Exception('oh no, the query misteriously failed!'); + } + + await delete(users).delete(user); + }); + } + + Stream watchUserById(int id) { + return (select(users)..where((u) => u.id.equals(id))).watchSingle(); + } + + Future makeFriends(User a, User b, {bool goodFriends}) async { + var friendsValue = const Value.absent(); + if (goodFriends != null) { + friendsValue = Value(goodFriends); + } + + final companion = FriendshipsCompanion( + firstUser: Value(a.id), + secondUser: Value(b.id), + reallyGoodFriends: friendsValue, + ); + + await into(friendships).insert(companion, orReplace: true); + } +} diff --git a/extras/integration_tests/tests/lib/database/database.g.dart b/extras/integration_tests/tests/lib/database/database.g.dart new file mode 100644 index 00000000..9ee2d20f --- /dev/null +++ b/extras/integration_tests/tests/lib/database/database.g.dart @@ -0,0 +1,560 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'database.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +Preferences _$PreferencesFromJson(Map json) { + return Preferences( + json['receiveEmails'] as bool, + ); +} + +Map _$PreferencesToJson(Preferences instance) => + { + 'receiveEmails': instance.receiveEmails, + }; + +// ************************************************************************** +// MoorGenerator +// ************************************************************************** + +// ignore_for_file: unnecessary_brace_in_string_interps +class User extends DataClass implements Insertable { + final int id; + final String name; + final DateTime birthDate; + final Uint8List profilePicture; + User( + {@required this.id, + @required this.name, + @required this.birthDate, + this.profilePicture}); + factory User.fromData(Map data, GeneratedDatabase db, + {String prefix}) { + final effectivePrefix = prefix ?? ''; + final intType = db.typeSystem.forDartType(); + final stringType = db.typeSystem.forDartType(); + final dateTimeType = db.typeSystem.forDartType(); + final uint8ListType = db.typeSystem.forDartType(); + return User( + id: intType.mapFromDatabaseResponse(data['${effectivePrefix}id']), + name: stringType.mapFromDatabaseResponse(data['${effectivePrefix}name']), + birthDate: dateTimeType + .mapFromDatabaseResponse(data['${effectivePrefix}birth_date']), + profilePicture: uint8ListType + .mapFromDatabaseResponse(data['${effectivePrefix}profile_picture']), + ); + } + factory User.fromJson(Map json, + {ValueSerializer serializer = const ValueSerializer.defaults()}) { + return User( + id: serializer.fromJson(json['id']), + name: serializer.fromJson(json['name']), + birthDate: serializer.fromJson(json['born_on']), + profilePicture: serializer.fromJson(json['profilePicture']), + ); + } + @override + Map toJson( + {ValueSerializer serializer = const ValueSerializer.defaults()}) { + return { + 'id': serializer.toJson(id), + 'name': serializer.toJson(name), + 'born_on': serializer.toJson(birthDate), + 'profilePicture': serializer.toJson(profilePicture), + }; + } + + @override + T createCompanion>(bool nullToAbsent) { + return UsersCompanion( + id: id == null && nullToAbsent ? const Value.absent() : Value(id), + name: name == null && nullToAbsent ? const Value.absent() : Value(name), + birthDate: birthDate == null && nullToAbsent + ? const Value.absent() + : Value(birthDate), + profilePicture: profilePicture == null && nullToAbsent + ? const Value.absent() + : Value(profilePicture), + ) as T; + } + + User copyWith( + {int id, + String name, + DateTime birthDate, + Uint8List profilePicture}) => + User( + id: id ?? this.id, + name: name ?? this.name, + birthDate: birthDate ?? this.birthDate, + profilePicture: profilePicture ?? this.profilePicture, + ); + @override + String toString() { + return (StringBuffer('User(') + ..write('id: $id, ') + ..write('name: $name, ') + ..write('birthDate: $birthDate, ') + ..write('profilePicture: $profilePicture') + ..write(')')) + .toString(); + } + + @override + int get hashCode => $mrjf($mrjc( + id.hashCode, + $mrjc( + name.hashCode, $mrjc(birthDate.hashCode, profilePicture.hashCode)))); + @override + bool operator ==(other) => + identical(this, other) || + (other is User && + other.id == id && + other.name == name && + other.birthDate == birthDate && + other.profilePicture == profilePicture); +} + +class UsersCompanion extends UpdateCompanion { + final Value id; + final Value name; + final Value birthDate; + final Value profilePicture; + const UsersCompanion({ + this.id = const Value.absent(), + this.name = const Value.absent(), + this.birthDate = const Value.absent(), + this.profilePicture = const Value.absent(), + }); +} + +class $UsersTable extends Users with TableInfo<$UsersTable, User> { + final GeneratedDatabase _db; + final String _alias; + $UsersTable(this._db, [this._alias]); + final VerificationMeta _idMeta = const VerificationMeta('id'); + GeneratedIntColumn _id; + @override + GeneratedIntColumn get id => _id ??= _constructId(); + GeneratedIntColumn _constructId() { + return GeneratedIntColumn('id', $tableName, false, hasAutoIncrement: true); + } + + final VerificationMeta _nameMeta = const VerificationMeta('name'); + GeneratedTextColumn _name; + @override + GeneratedTextColumn get name => _name ??= _constructName(); + GeneratedTextColumn _constructName() { + return GeneratedTextColumn( + 'name', + $tableName, + false, + ); + } + + final VerificationMeta _birthDateMeta = const VerificationMeta('birthDate'); + GeneratedDateTimeColumn _birthDate; + @override + GeneratedDateTimeColumn get birthDate => _birthDate ??= _constructBirthDate(); + GeneratedDateTimeColumn _constructBirthDate() { + return GeneratedDateTimeColumn( + 'birth_date', + $tableName, + false, + ); + } + + final VerificationMeta _profilePictureMeta = + const VerificationMeta('profilePicture'); + GeneratedBlobColumn _profilePicture; + @override + GeneratedBlobColumn get profilePicture => + _profilePicture ??= _constructProfilePicture(); + GeneratedBlobColumn _constructProfilePicture() { + return GeneratedBlobColumn( + 'profile_picture', + $tableName, + true, + ); + } + + @override + List get $columns => [id, name, birthDate, profilePicture]; + @override + $UsersTable get asDslTable => this; + @override + String get $tableName => _alias ?? 'users'; + @override + final String actualTableName = 'users'; + @override + VerificationContext validateIntegrity(UsersCompanion d, + {bool isInserting = false}) { + final context = VerificationContext(); + if (d.id.present) { + context.handle(_idMeta, id.isAcceptableValue(d.id.value, _idMeta)); + } else if (id.isRequired && isInserting) { + context.missing(_idMeta); + } + if (d.name.present) { + context.handle( + _nameMeta, name.isAcceptableValue(d.name.value, _nameMeta)); + } else if (name.isRequired && isInserting) { + context.missing(_nameMeta); + } + if (d.birthDate.present) { + context.handle(_birthDateMeta, + birthDate.isAcceptableValue(d.birthDate.value, _birthDateMeta)); + } else if (birthDate.isRequired && isInserting) { + context.missing(_birthDateMeta); + } + if (d.profilePicture.present) { + context.handle( + _profilePictureMeta, + profilePicture.isAcceptableValue( + d.profilePicture.value, _profilePictureMeta)); + } else if (profilePicture.isRequired && isInserting) { + context.missing(_profilePictureMeta); + } + return context; + } + + @override + Set get $primaryKey => {id}; + @override + User map(Map data, {String tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : null; + return User.fromData(data, _db, prefix: effectivePrefix); + } + + @override + Map entityToSql(UsersCompanion d) { + final map = {}; + if (d.id.present) { + map['id'] = Variable(d.id.value); + } + if (d.name.present) { + map['name'] = Variable(d.name.value); + } + if (d.birthDate.present) { + map['birth_date'] = Variable(d.birthDate.value); + } + if (d.profilePicture.present) { + map['profile_picture'] = + Variable(d.profilePicture.value); + } + return map; + } + + @override + $UsersTable createAlias(String alias) { + return $UsersTable(_db, alias); + } +} + +class Friendship extends DataClass implements Insertable { + final int firstUser; + final int secondUser; + final bool reallyGoodFriends; + Friendship( + {@required this.firstUser, + @required this.secondUser, + @required this.reallyGoodFriends}); + factory Friendship.fromData(Map data, GeneratedDatabase db, + {String prefix}) { + final effectivePrefix = prefix ?? ''; + final intType = db.typeSystem.forDartType(); + final boolType = db.typeSystem.forDartType(); + return Friendship( + firstUser: + intType.mapFromDatabaseResponse(data['${effectivePrefix}first_user']), + secondUser: intType + .mapFromDatabaseResponse(data['${effectivePrefix}second_user']), + reallyGoodFriends: boolType.mapFromDatabaseResponse( + data['${effectivePrefix}really_good_friends']), + ); + } + factory Friendship.fromJson(Map json, + {ValueSerializer serializer = const ValueSerializer.defaults()}) { + return Friendship( + firstUser: serializer.fromJson(json['firstUser']), + secondUser: serializer.fromJson(json['secondUser']), + reallyGoodFriends: serializer.fromJson(json['reallyGoodFriends']), + ); + } + @override + Map toJson( + {ValueSerializer serializer = const ValueSerializer.defaults()}) { + return { + 'firstUser': serializer.toJson(firstUser), + 'secondUser': serializer.toJson(secondUser), + 'reallyGoodFriends': serializer.toJson(reallyGoodFriends), + }; + } + + @override + T createCompanion>(bool nullToAbsent) { + return FriendshipsCompanion( + firstUser: firstUser == null && nullToAbsent + ? const Value.absent() + : Value(firstUser), + secondUser: secondUser == null && nullToAbsent + ? const Value.absent() + : Value(secondUser), + reallyGoodFriends: reallyGoodFriends == null && nullToAbsent + ? const Value.absent() + : Value(reallyGoodFriends), + ) as T; + } + + Friendship copyWith( + {int firstUser, int secondUser, bool reallyGoodFriends}) => + Friendship( + firstUser: firstUser ?? this.firstUser, + secondUser: secondUser ?? this.secondUser, + reallyGoodFriends: reallyGoodFriends ?? this.reallyGoodFriends, + ); + @override + String toString() { + return (StringBuffer('Friendship(') + ..write('firstUser: $firstUser, ') + ..write('secondUser: $secondUser, ') + ..write('reallyGoodFriends: $reallyGoodFriends') + ..write(')')) + .toString(); + } + + @override + int get hashCode => $mrjf($mrjc(firstUser.hashCode, + $mrjc(secondUser.hashCode, reallyGoodFriends.hashCode))); + @override + bool operator ==(other) => + identical(this, other) || + (other is Friendship && + other.firstUser == firstUser && + other.secondUser == secondUser && + other.reallyGoodFriends == reallyGoodFriends); +} + +class FriendshipsCompanion extends UpdateCompanion { + final Value firstUser; + final Value secondUser; + final Value reallyGoodFriends; + const FriendshipsCompanion({ + this.firstUser = const Value.absent(), + this.secondUser = const Value.absent(), + this.reallyGoodFriends = const Value.absent(), + }); +} + +class $FriendshipsTable extends Friendships + with TableInfo<$FriendshipsTable, Friendship> { + final GeneratedDatabase _db; + final String _alias; + $FriendshipsTable(this._db, [this._alias]); + final VerificationMeta _firstUserMeta = const VerificationMeta('firstUser'); + GeneratedIntColumn _firstUser; + @override + GeneratedIntColumn get firstUser => _firstUser ??= _constructFirstUser(); + GeneratedIntColumn _constructFirstUser() { + return GeneratedIntColumn( + 'first_user', + $tableName, + false, + ); + } + + final VerificationMeta _secondUserMeta = const VerificationMeta('secondUser'); + GeneratedIntColumn _secondUser; + @override + GeneratedIntColumn get secondUser => _secondUser ??= _constructSecondUser(); + GeneratedIntColumn _constructSecondUser() { + return GeneratedIntColumn( + 'second_user', + $tableName, + false, + ); + } + + final VerificationMeta _reallyGoodFriendsMeta = + const VerificationMeta('reallyGoodFriends'); + GeneratedBoolColumn _reallyGoodFriends; + @override + GeneratedBoolColumn get reallyGoodFriends => + _reallyGoodFriends ??= _constructReallyGoodFriends(); + GeneratedBoolColumn _constructReallyGoodFriends() { + return GeneratedBoolColumn('really_good_friends', $tableName, false, + defaultValue: const Constant(false)); + } + + @override + List get $columns => + [firstUser, secondUser, reallyGoodFriends]; + @override + $FriendshipsTable get asDslTable => this; + @override + String get $tableName => _alias ?? 'friendships'; + @override + final String actualTableName = 'friendships'; + @override + VerificationContext validateIntegrity(FriendshipsCompanion d, + {bool isInserting = false}) { + final context = VerificationContext(); + if (d.firstUser.present) { + context.handle(_firstUserMeta, + firstUser.isAcceptableValue(d.firstUser.value, _firstUserMeta)); + } else if (firstUser.isRequired && isInserting) { + context.missing(_firstUserMeta); + } + if (d.secondUser.present) { + context.handle(_secondUserMeta, + secondUser.isAcceptableValue(d.secondUser.value, _secondUserMeta)); + } else if (secondUser.isRequired && isInserting) { + context.missing(_secondUserMeta); + } + if (d.reallyGoodFriends.present) { + context.handle( + _reallyGoodFriendsMeta, + reallyGoodFriends.isAcceptableValue( + d.reallyGoodFriends.value, _reallyGoodFriendsMeta)); + } else if (reallyGoodFriends.isRequired && isInserting) { + context.missing(_reallyGoodFriendsMeta); + } + return context; + } + + @override + Set get $primaryKey => {firstUser, secondUser}; + @override + Friendship map(Map data, {String tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : null; + return Friendship.fromData(data, _db, prefix: effectivePrefix); + } + + @override + Map entityToSql(FriendshipsCompanion d) { + final map = {}; + if (d.firstUser.present) { + map['first_user'] = Variable(d.firstUser.value); + } + if (d.secondUser.present) { + map['second_user'] = Variable(d.secondUser.value); + } + if (d.reallyGoodFriends.present) { + map['really_good_friends'] = + Variable(d.reallyGoodFriends.value); + } + return map; + } + + @override + $FriendshipsTable createAlias(String alias) { + return $FriendshipsTable(_db, alias); + } +} + +class AmountOfGoodFriendsResult { + final int count; + AmountOfGoodFriendsResult({ + this.count, + }); +} + +class UserCountResult { + final int cOUNTid; + UserCountResult({ + this.cOUNTid, + }); +} + +abstract class _$Database extends GeneratedDatabase { + _$Database(QueryExecutor e) : super(const SqlTypeSystem.withDefaults(), e); + $UsersTable _users; + $UsersTable get users => _users ??= $UsersTable(this); + $FriendshipsTable _friendships; + $FriendshipsTable get friendships => _friendships ??= $FriendshipsTable(this); + User _rowToUser(QueryRow row) { + return User( + id: row.readInt('id'), + name: row.readString('name'), + birthDate: row.readDateTime('birth_date'), + profilePicture: row.readBlob('profile_picture'), + ); + } + + Future> mostPopularUsers( + int amount, + {@Deprecated('No longer needed with Moor 1.6 - see the changelog for details') + QueryEngine operateOn}) { + return (operateOn ?? this).customSelect( + 'SELECT * FROM users u ORDER BY (SELECT COUNT(*) FROM friendships WHERE first_user = u.id OR second_user = u.id) DESC LIMIT :amount', + variables: [ + Variable.withInt(amount), + ]).then((rows) => rows.map(_rowToUser).toList()); + } + + Stream> watchMostPopularUsers(int amount) { + return customSelectStream( + 'SELECT * FROM users u ORDER BY (SELECT COUNT(*) FROM friendships WHERE first_user = u.id OR second_user = u.id) DESC LIMIT :amount', + variables: [ + Variable.withInt(amount), + ], + readsFrom: { + users, + friendships + }).map((rows) => rows.map(_rowToUser).toList()); + } + + AmountOfGoodFriendsResult _rowToAmountOfGoodFriendsResult(QueryRow row) { + return AmountOfGoodFriendsResult( + count: row.readInt('COUNT(*)'), + ); + } + + Future> amountOfGoodFriends( + int user, + {@Deprecated('No longer needed with Moor 1.6 - see the changelog for details') + QueryEngine operateOn}) { + return (operateOn ?? this).customSelect( + 'SELECT COUNT(*) FROM friendships f WHERE f.really_good_friends AND (f.first_user = :user OR f.second_user = :user)', + variables: [ + Variable.withInt(user), + ]).then((rows) => rows.map(_rowToAmountOfGoodFriendsResult).toList()); + } + + Stream> watchAmountOfGoodFriends(int user) { + return customSelectStream( + 'SELECT COUNT(*) FROM friendships f WHERE f.really_good_friends AND (f.first_user = :user OR f.second_user = :user)', + variables: [ + Variable.withInt(user), + ], + readsFrom: { + friendships + }).map((rows) => rows.map(_rowToAmountOfGoodFriendsResult).toList()); + } + + UserCountResult _rowToUserCountResult(QueryRow row) { + return UserCountResult( + cOUNTid: row.readInt('COUNT(id)'), + ); + } + + Future> userCount( + {@Deprecated('No longer needed with Moor 1.6 - see the changelog for details') + QueryEngine operateOn}) { + return (operateOn ?? this).customSelect('SELECT COUNT(id) FROM users', + variables: []).then((rows) => rows.map(_rowToUserCountResult).toList()); + } + + Stream> watchUserCount() { + return customSelectStream('SELECT COUNT(id) FROM users', + variables: [], readsFrom: {users}) + .map((rows) => rows.map(_rowToUserCountResult).toList()); + } + + @override + List get allTables => [users, friendships]; +} diff --git a/extras/integration_tests/tests/lib/suite/migrations.dart b/extras/integration_tests/tests/lib/suite/migrations.dart new file mode 100644 index 00000000..a5db4529 --- /dev/null +++ b/extras/integration_tests/tests/lib/suite/migrations.dart @@ -0,0 +1,14 @@ +import 'package:test/test.dart'; +import 'package:tests/database/database.dart'; + +import 'suite.dart'; + +void migrationTests(TestExecutor executor) { + test('creates users table when opening version 1', () async { + final database = Database(executor.createExecutor(), schemaVersion: 1); + + // we write 3 users when the database is created + final count = await database.userCount(); + expect(count.single.cOUNTid, 3); + }); +} diff --git a/extras/integration_tests/tests/lib/suite/suite.dart b/extras/integration_tests/tests/lib/suite/suite.dart new file mode 100644 index 00000000..e5aefd46 --- /dev/null +++ b/extras/integration_tests/tests/lib/suite/suite.dart @@ -0,0 +1,19 @@ +import 'package:moor/moor.dart'; +import 'package:test/test.dart'; + +import 'package:tests/suite/migrations.dart'; + +abstract class TestExecutor { + QueryExecutor createExecutor(); + + /// Delete the data that would be written by the executor. + Future deleteData(); +} + +void runAllTests(TestExecutor executor) { + tearDown(() async { + await executor.deleteData(); + }); + + migrationTests(executor); +} diff --git a/extras/integration_tests/tests/lib/tests.dart b/extras/integration_tests/tests/lib/tests.dart new file mode 100644 index 00000000..0cd973cd --- /dev/null +++ b/extras/integration_tests/tests/lib/tests.dart @@ -0,0 +1,7 @@ +library tests; + +export 'package:moor/moor.dart'; + +export 'data/sample_data.dart'; +export 'database/database.dart'; +export 'suite/suite.dart'; diff --git a/extras/integration_tests/tests/pubspec.yaml b/extras/integration_tests/tests/pubspec.yaml new file mode 100644 index 00000000..f2c1b74e --- /dev/null +++ b/extras/integration_tests/tests/pubspec.yaml @@ -0,0 +1,25 @@ +name: tests +description: A sample command-line application. +# version: 1.0.0 +# homepage: https://www.example.com +# author: Simon Binder + +environment: + sdk: '>=2.4.0 <3.0.0' + +dependencies: + moor: + path: + ../../../moor + json_annotation: +dev_dependencies: + build_runner: + moor_generator: + json_serializable: + test: + +dependency_overrides: + moor: + path: ../../../moor + moor_generator: + path: ../../../moor_generator \ No newline at end of file diff --git a/moor/lib/src/runtime/executor/helpers/engines.dart b/moor/lib/src/runtime/executor/helpers/engines.dart index 5de5c3fa..135ebab9 100644 --- a/moor/lib/src/runtime/executor/helpers/engines.dart +++ b/moor/lib/src/runtime/executor/helpers/engines.dart @@ -208,7 +208,7 @@ class DelegatedDatabase extends QueryExecutor with _ExecutorWithQueryDelegate { Completer _openingCompleter; @override - final bool logStatements; + bool logStatements; @override final bool isSequential; @@ -216,7 +216,10 @@ class DelegatedDatabase extends QueryExecutor with _ExecutorWithQueryDelegate { QueryDelegate get impl => delegate; DelegatedDatabase(this.delegate, - {this.logStatements = false, this.isSequential = false}); + {this.logStatements, this.isSequential = false}) { + // not using default value because it's commonly set to null + logStatements ??= false; + } @override Future ensureOpen() async {