diff --git a/dev/bots/analyze.dart b/dev/bots/analyze.dart index e987a6445b..4376bc7c6c 100644 --- a/dev/bots/analyze.dart +++ b/dev/bots/analyze.dart @@ -605,6 +605,7 @@ Future verifyNoTrailingSpaces(String workingDirectory, { int minimumMatche .where((File file) => path.extension(file.path) != '.jpg') .where((File file) => path.extension(file.path) != '.ico') .where((File file) => path.extension(file.path) != '.jar') + .where((File file) => path.extension(file.path) != '.swp') .toList(); final List problems = []; for (final File file in files) { @@ -1299,5 +1300,6 @@ bool _isGeneratedPluginRegistrant(File file) { return !file.path.contains('.pub-cache') && (filename == 'GeneratedPluginRegistrant.java' || filename == 'GeneratedPluginRegistrant.h' || - filename == 'GeneratedPluginRegistrant.m'); + filename == 'GeneratedPluginRegistrant.m' || + filename == 'generated_plugin_registrant.dart'); } diff --git a/dev/bots/test.dart b/dev/bots/test.dart index 4ab96eadaf..a640536f15 100644 --- a/dev/bots/test.dart +++ b/dev/bots/test.dart @@ -9,6 +9,7 @@ import 'dart:math' as math; import 'package:googleapis/bigquery/v2.dart' as bq; import 'package:googleapis_auth/auth_io.dart' as auth; import 'package:http/http.dart' as http; +import 'package:meta/meta.dart'; import 'package:path/path.dart' as path; import 'browser.dart'; @@ -287,21 +288,27 @@ Future _runToolTests() async { /// we can build when there are spaces in the path name for the Flutter SDK and /// target app. Future _runBuildTests() async { - final Stream exampleDirectories = Directory(path.join(flutterRoot, 'examples')).list(); - await for (final FileSystemEntity fileEntity in exampleDirectories) { + final List exampleDirectories = Directory(path.join(flutterRoot, 'examples')).listSync() + ..add(Directory(path.join(flutterRoot, 'dev', 'integration_tests', 'non_nullable'))); + for (final FileSystemEntity fileEntity in exampleDirectories) { if (fileEntity is! Directory) { continue; } final String examplePath = fileEntity.path; + final bool hasNullSafety = File(path.join(examplePath, 'null_safety')).existsSync(); + final List additionalArgs = hasNullSafety + ? ['--enable-experiment', 'non-nullable'] + : []; if (Directory(path.join(examplePath, 'android')).existsSync()) { - await _flutterBuildAot(examplePath); - await _flutterBuildApk(examplePath); + await _flutterBuildApk(examplePath, release: false, additionalArgs: additionalArgs); + await _flutterBuildApk(examplePath, release: true, additionalArgs: additionalArgs); } else { - print('Example project ${path.basename(examplePath)} has no android directory, skipping aot and apk'); + print('Example project ${path.basename(examplePath)} has no android directory, skipping apk'); } if (Platform.isMacOS) { if (Directory(path.join(examplePath, 'ios')).existsSync()) { - await _flutterBuildIpa(examplePath); + await _flutterBuildIpa(examplePath, release: false, additionalArgs: additionalArgs); + await _flutterBuildIpa(examplePath, release: true, additionalArgs: additionalArgs); } else { print('Example project ${path.basename(examplePath)} has no ios directory, skipping ipa'); } @@ -323,23 +330,30 @@ Future _runBuildTests() async { } } -Future _flutterBuildAot(String relativePathToApplication) async { - print('${green}Testing AOT build$reset for $cyan$relativePathToApplication$reset...'); - await runCommand(flutter, - ['build', 'aot', '-v'], - workingDirectory: path.join(flutterRoot, relativePathToApplication), - ); -} - -Future _flutterBuildApk(String relativePathToApplication) async { +Future _flutterBuildApk(String relativePathToApplication, { + @required bool release, + List additionalArgs = const [], +}) async { print('${green}Testing APK --debug build$reset for $cyan$relativePathToApplication$reset...'); await runCommand(flutter, - ['build', 'apk', '--debug', '-v'], + [ + 'build', + 'apk', + ...additionalArgs, + if (release) + '--release' + else + '--debug', + '-v', + ], workingDirectory: path.join(flutterRoot, relativePathToApplication), ); } -Future _flutterBuildIpa(String relativePathToApplication) async { +Future _flutterBuildIpa(String relativePathToApplication, { + @required bool release, + List additionalArgs = const [], +}) async { assert(Platform.isMacOS); print('${green}Testing IPA build$reset for $cyan$relativePathToApplication$reset...'); // Install Cocoapods. We don't have these checked in for the examples, @@ -355,7 +369,17 @@ Future _flutterBuildIpa(String relativePathToApplication) async { ); } await runCommand(flutter, - ['build', 'ios', '--no-codesign', '--debug', '-v'], + [ + 'build', + 'ios', + ...additionalArgs, + '--no-codesign', + if (release) + '--release' + else + '--debug', + '-v', + ], workingDirectory: path.join(flutterRoot, relativePathToApplication), ); } @@ -590,6 +614,7 @@ Future _runWebIntegrationTests() async { await _runWebDebugTest('lib/stack_trace.dart'); await _runWebDebugTest('lib/web_directory_loading.dart'); await _runWebDebugTest('test/test.dart'); + await _runWebDebugTest('lib/null_safe_main.dart', enableNullSafety: true); await _runWebDebugTest('lib/web_define_loading.dart', additionalArguments: [ '--dart-define=test.valueA=Example', @@ -692,6 +717,7 @@ Future _runWebReleaseTest(String target, { /// /// Instead, we use `flutter run --debug` and sniff out the standard output. Future _runWebDebugTest(String target, { + bool enableNullSafety = false, List additionalArguments = const[], }) async { final String testAppDirectory = path.join(flutterRoot, 'dev', 'integration_tests', 'web'); @@ -702,6 +728,11 @@ Future _runWebDebugTest(String target, { [ 'run', '--debug', + if (enableNullSafety) + ...[ + '--enable-experiment', + 'non-nullable', + ], '-d', 'chrome', '--web-run-headless', diff --git a/dev/integration_tests/non_nullable/.gitignore b/dev/integration_tests/non_nullable/.gitignore new file mode 100644 index 0000000000..f3c205341e --- /dev/null +++ b/dev/integration_tests/non_nullable/.gitignore @@ -0,0 +1,44 @@ +# 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/ +**/ios/Flutter/.last_build_id +.dart_tool/ +.flutter-plugins +.flutter-plugins-dependencies +.packages +.pub-cache/ +.pub/ +/build/ + +# Web related +lib/generated_plugin_registrant.dart + +# Symbolication related +app.*.symbols + +# Obfuscation related +app.*.map.json + +# Exceptions to above rules. +!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages diff --git a/dev/integration_tests/non_nullable/analysis_options.yaml b/dev/integration_tests/non_nullable/analysis_options.yaml new file mode 100644 index 0000000000..2388a77af4 --- /dev/null +++ b/dev/integration_tests/non_nullable/analysis_options.yaml @@ -0,0 +1,5 @@ +# Exclude lib/main.dart to avoid warnings about the non_nullable +# experiment before it is enabled. +analyzer: + exclude: + - lib/main.dart diff --git a/dev/integration_tests/non_nullable/android/.gitignore b/dev/integration_tests/non_nullable/android/.gitignore new file mode 100644 index 0000000000..bc2100d8f7 --- /dev/null +++ b/dev/integration_tests/non_nullable/android/.gitignore @@ -0,0 +1,7 @@ +gradle-wrapper.jar +/.gradle +/captures/ +/gradlew +/gradlew.bat +/local.properties +GeneratedPluginRegistrant.java diff --git a/dev/integration_tests/non_nullable/android/app/build.gradle b/dev/integration_tests/non_nullable/android/app/build.gradle new file mode 100644 index 0000000000..51ab145d4c --- /dev/null +++ b/dev/integration_tests/non_nullable/android/app/build.gradle @@ -0,0 +1,67 @@ +// Copyright 2014 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +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 plugin: 'kotlin-android' +apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" + +android { + compileSdkVersion 28 + + sourceSets { + main.java.srcDirs += 'src/main/kotlin' + } + + lintOptions { + disable 'InvalidPackage' + } + + defaultConfig { + // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). + applicationId "com.example.non_nullable" + minSdkVersion 16 + targetSdkVersion 28 + versionCode flutterVersionCode.toInteger() + versionName flutterVersionName + } + + 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 { + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" +} diff --git a/dev/integration_tests/non_nullable/android/app/src/debug/AndroidManifest.xml b/dev/integration_tests/non_nullable/android/app/src/debug/AndroidManifest.xml new file mode 100644 index 0000000000..4ef3b6d9d2 --- /dev/null +++ b/dev/integration_tests/non_nullable/android/app/src/debug/AndroidManifest.xml @@ -0,0 +1,11 @@ + + + + + + diff --git a/dev/integration_tests/non_nullable/android/app/src/main/AndroidManifest.xml b/dev/integration_tests/non_nullable/android/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000000..f47cf1641f --- /dev/null +++ b/dev/integration_tests/non_nullable/android/app/src/main/AndroidManifest.xml @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + diff --git a/dev/integration_tests/non_nullable/android/app/src/main/kotlin/com/example/non_nullable/MainActivity.kt b/dev/integration_tests/non_nullable/android/app/src/main/kotlin/com/example/non_nullable/MainActivity.kt new file mode 100644 index 0000000000..60bdc72f0a --- /dev/null +++ b/dev/integration_tests/non_nullable/android/app/src/main/kotlin/com/example/non_nullable/MainActivity.kt @@ -0,0 +1,6 @@ +package com.example.non_nullable + +import io.flutter.embedding.android.FlutterActivity + +class MainActivity: FlutterActivity() { +} diff --git a/dev/integration_tests/non_nullable/android/app/src/main/res/drawable/launch_background.xml b/dev/integration_tests/non_nullable/android/app/src/main/res/drawable/launch_background.xml new file mode 100644 index 0000000000..32d7798786 --- /dev/null +++ b/dev/integration_tests/non_nullable/android/app/src/main/res/drawable/launch_background.xml @@ -0,0 +1,16 @@ + + + + + + + + + + diff --git a/dev/integration_tests/non_nullable/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/dev/integration_tests/non_nullable/android/app/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 0000000000..db77bb4b7b Binary files /dev/null and b/dev/integration_tests/non_nullable/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/dev/integration_tests/non_nullable/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/dev/integration_tests/non_nullable/android/app/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 0000000000..17987b79bb Binary files /dev/null and b/dev/integration_tests/non_nullable/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/dev/integration_tests/non_nullable/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/dev/integration_tests/non_nullable/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 0000000000..09d4391482 Binary files /dev/null and b/dev/integration_tests/non_nullable/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/dev/integration_tests/non_nullable/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/dev/integration_tests/non_nullable/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 0000000000..d5f1c8d34e Binary files /dev/null and b/dev/integration_tests/non_nullable/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/dev/integration_tests/non_nullable/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/dev/integration_tests/non_nullable/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 0000000000..4d6372eebd Binary files /dev/null and b/dev/integration_tests/non_nullable/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/dev/integration_tests/non_nullable/android/app/src/main/res/values/styles.xml b/dev/integration_tests/non_nullable/android/app/src/main/res/values/styles.xml new file mode 100644 index 0000000000..aac0d5ba20 --- /dev/null +++ b/dev/integration_tests/non_nullable/android/app/src/main/res/values/styles.xml @@ -0,0 +1,15 @@ + + + + + + diff --git a/dev/integration_tests/non_nullable/android/app/src/profile/AndroidManifest.xml b/dev/integration_tests/non_nullable/android/app/src/profile/AndroidManifest.xml new file mode 100644 index 0000000000..4ef3b6d9d2 --- /dev/null +++ b/dev/integration_tests/non_nullable/android/app/src/profile/AndroidManifest.xml @@ -0,0 +1,11 @@ + + + + + + diff --git a/dev/integration_tests/non_nullable/android/build.gradle b/dev/integration_tests/non_nullable/android/build.gradle new file mode 100644 index 0000000000..1c2d2db3e0 --- /dev/null +++ b/dev/integration_tests/non_nullable/android/build.gradle @@ -0,0 +1,35 @@ +// Copyright 2014 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +buildscript { + ext.kotlin_version = '1.3.50' + repositories { + google() + jcenter() + } + + dependencies { + classpath 'com.android.tools.build:gradle:3.5.0' + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + } +} + +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/dev/integration_tests/non_nullable/android/gradle.properties b/dev/integration_tests/non_nullable/android/gradle.properties new file mode 100644 index 0000000000..38c8d4544f --- /dev/null +++ b/dev/integration_tests/non_nullable/android/gradle.properties @@ -0,0 +1,4 @@ +org.gradle.jvmargs=-Xmx1536M +android.enableR8=true +android.useAndroidX=true +android.enableJetifier=true diff --git a/dev/integration_tests/non_nullable/android/gradle/wrapper/gradle-wrapper.properties b/dev/integration_tests/non_nullable/android/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000000..296b146b73 --- /dev/null +++ b/dev/integration_tests/non_nullable/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-5.6.2-all.zip diff --git a/dev/integration_tests/non_nullable/android/settings.gradle b/dev/integration_tests/non_nullable/android/settings.gradle new file mode 100644 index 0000000000..d3b6a4013d --- /dev/null +++ b/dev/integration_tests/non_nullable/android/settings.gradle @@ -0,0 +1,15 @@ +// Copyright 2014 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +include ':app' + +def localPropertiesFile = new File(rootProject.projectDir, "local.properties") +def properties = new Properties() + +assert localPropertiesFile.exists() +localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } + +def flutterSdkPath = properties.getProperty("flutter.sdk") +assert flutterSdkPath != null, "flutter.sdk not set in local.properties" +apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" diff --git a/dev/integration_tests/non_nullable/ios/.gitignore b/dev/integration_tests/non_nullable/ios/.gitignore new file mode 100644 index 0000000000..e96ef602b8 --- /dev/null +++ b/dev/integration_tests/non_nullable/ios/.gitignore @@ -0,0 +1,32 @@ +*.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/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/dev/integration_tests/non_nullable/ios/Flutter/AppFrameworkInfo.plist b/dev/integration_tests/non_nullable/ios/Flutter/AppFrameworkInfo.plist new file mode 100644 index 0000000000..6b4c0f78a7 --- /dev/null +++ b/dev/integration_tests/non_nullable/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/dev/integration_tests/non_nullable/ios/Flutter/Debug.xcconfig b/dev/integration_tests/non_nullable/ios/Flutter/Debug.xcconfig new file mode 100644 index 0000000000..592ceee85b --- /dev/null +++ b/dev/integration_tests/non_nullable/ios/Flutter/Debug.xcconfig @@ -0,0 +1 @@ +#include "Generated.xcconfig" diff --git a/dev/integration_tests/non_nullable/ios/Flutter/Release.xcconfig b/dev/integration_tests/non_nullable/ios/Flutter/Release.xcconfig new file mode 100644 index 0000000000..592ceee85b --- /dev/null +++ b/dev/integration_tests/non_nullable/ios/Flutter/Release.xcconfig @@ -0,0 +1 @@ +#include "Generated.xcconfig" diff --git a/dev/integration_tests/non_nullable/ios/Runner.xcodeproj/project.pbxproj b/dev/integration_tests/non_nullable/ios/Runner.xcodeproj/project.pbxproj new file mode 100644 index 0000000000..e053237ae9 --- /dev/null +++ b/dev/integration_tests/non_nullable/ios/Runner.xcodeproj/project.pbxproj @@ -0,0 +1,503 @@ +// !$*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 */; }; + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; + 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 = ( + ); + 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 = ""; }; + 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 = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 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 */, + ); + sourceTree = ""; + }; + 97C146EF1CF9000F007C117D /* Products */ = { + isa = PBXGroup; + children = ( + 97C146EE1CF9000F007C117D /* Runner.app */, + ); + name = Products; + sourceTree = ""; + }; + 97C146F01CF9000F007C117D /* Runner */ = { + isa = PBXGroup; + children = ( + 97C146FA1CF9000F007C117D /* Main.storyboard */, + 97C146FD1CF9000F007C117D /* Assets.xcassets */, + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, + 97C147021CF9000F007C117D /* Info.plist */, + 97C146F11CF9000F007C117D /* Supporting Files */, + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, + ); + path = Runner; + sourceTree = ""; + }; + 97C146F11CF9000F007C117D /* Supporting Files */ = { + isa = PBXGroup; + children = ( + ); + 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 = ""; + TargetAttributes = { + 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; + 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 */, + 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\" embed_and_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 = ( + 74858FAF1ED2DC5600515810 /* AppDelegate.swift 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; + 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; + 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; + 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.nonNullable; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Profile; + }; + 97C147031CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + 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; + 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; + SUPPORTED_PLATFORMS = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + 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; + 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.nonNullable; + 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; + 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.nonNullable; + 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 */ + 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/dev/integration_tests/non_nullable/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/dev/integration_tests/non_nullable/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000000..1d526a16ed --- /dev/null +++ b/dev/integration_tests/non_nullable/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/dev/integration_tests/non_nullable/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/dev/integration_tests/non_nullable/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000000..18d981003d --- /dev/null +++ b/dev/integration_tests/non_nullable/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/dev/integration_tests/non_nullable/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/dev/integration_tests/non_nullable/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000000..f9b0d7c5ea --- /dev/null +++ b/dev/integration_tests/non_nullable/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/dev/integration_tests/non_nullable/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/dev/integration_tests/non_nullable/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme new file mode 100644 index 0000000000..a28140cfdb --- /dev/null +++ b/dev/integration_tests/non_nullable/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dev/integration_tests/non_nullable/ios/Runner.xcworkspace/contents.xcworkspacedata b/dev/integration_tests/non_nullable/ios/Runner.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000000..1d526a16ed --- /dev/null +++ b/dev/integration_tests/non_nullable/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/dev/integration_tests/non_nullable/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/dev/integration_tests/non_nullable/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000000..18d981003d --- /dev/null +++ b/dev/integration_tests/non_nullable/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/dev/integration_tests/non_nullable/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/dev/integration_tests/non_nullable/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000000..f9b0d7c5ea --- /dev/null +++ b/dev/integration_tests/non_nullable/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/dev/integration_tests/non_nullable/ios/Runner/AppDelegate.swift b/dev/integration_tests/non_nullable/ios/Runner/AppDelegate.swift new file mode 100644 index 0000000000..d815fed684 --- /dev/null +++ b/dev/integration_tests/non_nullable/ios/Runner/AppDelegate.swift @@ -0,0 +1,17 @@ +// Copyright 2014 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import UIKit +import Flutter + +@UIApplicationMain +@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/dev/integration_tests/non_nullable/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/dev/integration_tests/non_nullable/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000000..d36b1fab2d --- /dev/null +++ b/dev/integration_tests/non_nullable/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/dev/integration_tests/non_nullable/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/dev/integration_tests/non_nullable/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png new file mode 100644 index 0000000000..dc9ada4725 Binary files /dev/null and b/dev/integration_tests/non_nullable/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png differ diff --git a/dev/integration_tests/non_nullable/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/dev/integration_tests/non_nullable/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png new file mode 100644 index 0000000000..28c6bf0301 Binary files /dev/null and b/dev/integration_tests/non_nullable/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png differ diff --git a/dev/integration_tests/non_nullable/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/dev/integration_tests/non_nullable/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png new file mode 100644 index 0000000000..2ccbfd967d Binary files /dev/null and b/dev/integration_tests/non_nullable/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png differ diff --git a/dev/integration_tests/non_nullable/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/dev/integration_tests/non_nullable/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png new file mode 100644 index 0000000000..f091b6b0bc Binary files /dev/null and b/dev/integration_tests/non_nullable/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png differ diff --git a/dev/integration_tests/non_nullable/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/dev/integration_tests/non_nullable/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png new file mode 100644 index 0000000000..4cde12118d Binary files /dev/null and b/dev/integration_tests/non_nullable/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png differ diff --git a/dev/integration_tests/non_nullable/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/dev/integration_tests/non_nullable/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png new file mode 100644 index 0000000000..d0ef06e7ed Binary files /dev/null and b/dev/integration_tests/non_nullable/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png differ diff --git a/dev/integration_tests/non_nullable/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/dev/integration_tests/non_nullable/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png new file mode 100644 index 0000000000..dcdc2306c2 Binary files /dev/null and b/dev/integration_tests/non_nullable/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png differ diff --git a/dev/integration_tests/non_nullable/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/dev/integration_tests/non_nullable/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png new file mode 100644 index 0000000000..2ccbfd967d Binary files /dev/null and b/dev/integration_tests/non_nullable/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png differ diff --git a/dev/integration_tests/non_nullable/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/dev/integration_tests/non_nullable/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png new file mode 100644 index 0000000000..c8f9ed8f5c Binary files /dev/null and b/dev/integration_tests/non_nullable/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png differ diff --git a/dev/integration_tests/non_nullable/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/dev/integration_tests/non_nullable/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png new file mode 100644 index 0000000000..a6d6b8609d Binary files /dev/null and b/dev/integration_tests/non_nullable/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png differ diff --git a/dev/integration_tests/non_nullable/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/dev/integration_tests/non_nullable/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png new file mode 100644 index 0000000000..a6d6b8609d Binary files /dev/null and b/dev/integration_tests/non_nullable/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png differ diff --git a/dev/integration_tests/non_nullable/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/dev/integration_tests/non_nullable/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png new file mode 100644 index 0000000000..75b2d164a5 Binary files /dev/null and b/dev/integration_tests/non_nullable/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png differ diff --git a/dev/integration_tests/non_nullable/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/dev/integration_tests/non_nullable/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png new file mode 100644 index 0000000000..c4df70d39d Binary files /dev/null and b/dev/integration_tests/non_nullable/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png differ diff --git a/dev/integration_tests/non_nullable/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/dev/integration_tests/non_nullable/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png new file mode 100644 index 0000000000..6a84f41e14 Binary files /dev/null and b/dev/integration_tests/non_nullable/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png differ diff --git a/dev/integration_tests/non_nullable/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/dev/integration_tests/non_nullable/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png new file mode 100644 index 0000000000..d0e1f58536 Binary files /dev/null and b/dev/integration_tests/non_nullable/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ diff --git a/dev/integration_tests/non_nullable/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/dev/integration_tests/non_nullable/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json new file mode 100644 index 0000000000..0bedcf2fd4 --- /dev/null +++ b/dev/integration_tests/non_nullable/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/dev/integration_tests/non_nullable/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/dev/integration_tests/non_nullable/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png new file mode 100644 index 0000000000..9da19eacad Binary files /dev/null and b/dev/integration_tests/non_nullable/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png differ diff --git a/dev/integration_tests/non_nullable/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/dev/integration_tests/non_nullable/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png new file mode 100644 index 0000000000..9da19eacad Binary files /dev/null and b/dev/integration_tests/non_nullable/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png differ diff --git a/dev/integration_tests/non_nullable/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/dev/integration_tests/non_nullable/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png new file mode 100644 index 0000000000..9da19eacad Binary files /dev/null and b/dev/integration_tests/non_nullable/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png differ diff --git a/dev/integration_tests/non_nullable/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/dev/integration_tests/non_nullable/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md new file mode 100644 index 0000000000..89c2725b70 --- /dev/null +++ b/dev/integration_tests/non_nullable/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/dev/integration_tests/non_nullable/ios/Runner/Base.lproj/LaunchScreen.storyboard b/dev/integration_tests/non_nullable/ios/Runner/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000000..f2e259c7c9 --- /dev/null +++ b/dev/integration_tests/non_nullable/ios/Runner/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dev/integration_tests/non_nullable/ios/Runner/Base.lproj/Main.storyboard b/dev/integration_tests/non_nullable/ios/Runner/Base.lproj/Main.storyboard new file mode 100644 index 0000000000..f3c28516fb --- /dev/null +++ b/dev/integration_tests/non_nullable/ios/Runner/Base.lproj/Main.storyboard @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dev/integration_tests/non_nullable/ios/Runner/Info.plist b/dev/integration_tests/non_nullable/ios/Runner/Info.plist new file mode 100644 index 0000000000..3d1faf81fd --- /dev/null +++ b/dev/integration_tests/non_nullable/ios/Runner/Info.plist @@ -0,0 +1,45 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + non_nullable + 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/dev/integration_tests/non_nullable/ios/Runner/Runner-Bridging-Header.h b/dev/integration_tests/non_nullable/ios/Runner/Runner-Bridging-Header.h new file mode 100644 index 0000000000..95b7baf386 --- /dev/null +++ b/dev/integration_tests/non_nullable/ios/Runner/Runner-Bridging-Header.h @@ -0,0 +1,5 @@ +// Copyright 2014 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#import "GeneratedPluginRegistrant.h" diff --git a/dev/integration_tests/non_nullable/lib/main.dart b/dev/integration_tests/non_nullable/lib/main.dart new file mode 100644 index 0000000000..32ce3b72be --- /dev/null +++ b/dev/integration_tests/non_nullable/lib/main.dart @@ -0,0 +1,26 @@ +// Copyright 2014 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// @dart=2.9 +import 'package:flutter/material.dart'; + +String? unused; + +void main() { + runApp(MyApp()); +} + +class MyApp extends StatelessWidget { + @override + Widget build(BuildContext context) { + return MaterialApp( + title: 'Flutter Demo', + theme: ThemeData( + primarySwatch: Colors.blue, + visualDensity: VisualDensity.adaptivePlatformDensity, + ), + home: const Center(child: Text('hello, world')) + ); + } +} diff --git a/dev/integration_tests/non_nullable/null_safety b/dev/integration_tests/non_nullable/null_safety new file mode 100644 index 0000000000..e69de29bb2 diff --git a/dev/integration_tests/non_nullable/pubspec.yaml b/dev/integration_tests/non_nullable/pubspec.yaml new file mode 100644 index 0000000000..d479b2d1d9 --- /dev/null +++ b/dev/integration_tests/non_nullable/pubspec.yaml @@ -0,0 +1,41 @@ +name: non_nullable +description: A new Flutter project. + +publish_to: 'none' # Remove this line if you wish to publish to pub.dev +version: 1.0.0+1 + +environment: + sdk: ">=2.7.0 <3.0.0" + +dependencies: + flutter: + sdk: flutter + cupertino_icons: 0.1.3 + + collection: 1.14.12 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" + meta: 1.1.8 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" + typed_data: 1.1.6 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" + vector_math: 2.0.8 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" + +dev_dependencies: + flutter_test: + sdk: flutter + + async: 2.4.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" + boolean_selector: 2.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" + charcode: 1.1.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" + clock: 1.0.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" + fake_async: 1.1.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" + matcher: 0.12.6 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" + path: 1.7.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" + source_span: 1.7.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" + stack_trace: 1.9.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" + stream_channel: 2.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" + string_scanner: 1.0.5 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" + term_glyph: 1.1.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" + test_api: 0.2.15 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" + +flutter: + uses-material-design: true + +# PUBSPEC CHECKSUM: 7c67 diff --git a/dev/integration_tests/non_nullable/web/favicon.png b/dev/integration_tests/non_nullable/web/favicon.png new file mode 100644 index 0000000000..8aaa46ac1a Binary files /dev/null and b/dev/integration_tests/non_nullable/web/favicon.png differ diff --git a/dev/integration_tests/non_nullable/web/icons/Icon-192.png b/dev/integration_tests/non_nullable/web/icons/Icon-192.png new file mode 100644 index 0000000000..b749bfef07 Binary files /dev/null and b/dev/integration_tests/non_nullable/web/icons/Icon-192.png differ diff --git a/dev/integration_tests/non_nullable/web/icons/Icon-512.png b/dev/integration_tests/non_nullable/web/icons/Icon-512.png new file mode 100644 index 0000000000..88cfd48dff Binary files /dev/null and b/dev/integration_tests/non_nullable/web/icons/Icon-512.png differ diff --git a/dev/integration_tests/non_nullable/web/index.html b/dev/integration_tests/non_nullable/web/index.html new file mode 100644 index 0000000000..aae9e6efad --- /dev/null +++ b/dev/integration_tests/non_nullable/web/index.html @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + non_nullable + + + + + + + + diff --git a/dev/integration_tests/non_nullable/web/manifest.json b/dev/integration_tests/non_nullable/web/manifest.json new file mode 100644 index 0000000000..0887f55ce1 --- /dev/null +++ b/dev/integration_tests/non_nullable/web/manifest.json @@ -0,0 +1,23 @@ +{ + "name": "non_nullable", + "short_name": "non_nullable", + "start_url": ".", + "display": "minimal-ui", + "background_color": "#0175C2", + "theme_color": "#0175C2", + "description": "A new Flutter project.", + "orientation": "portrait-primary", + "prefer_related_applications": false, + "icons": [ + { + "src": "icons/Icon-192.png", + "sizes": "192x192", + "type": "image/png" + }, + { + "src": "icons/Icon-512.png", + "sizes": "512x512", + "type": "image/png" + } + ] +} diff --git a/dev/integration_tests/web/analysis_options.yaml b/dev/integration_tests/web/analysis_options.yaml new file mode 100644 index 0000000000..8c534b5588 --- /dev/null +++ b/dev/integration_tests/web/analysis_options.yaml @@ -0,0 +1,5 @@ +# Exclude lib/main.dart to avoid warnings about the non_nullable +# experiment before it is enabled. +analyzer: + exclude: + - lib/null_safe_main.dart diff --git a/dev/integration_tests/web/lib/null_safe_main.dart b/dev/integration_tests/web/lib/null_safe_main.dart new file mode 100644 index 0000000000..7d548d4f80 --- /dev/null +++ b/dev/integration_tests/web/lib/null_safe_main.dart @@ -0,0 +1,11 @@ +// Copyright 2014 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// @dart=2.9 + +String? x; + +void main() { + print('--- TEST SUCCEEDED ---'); +} diff --git a/dev/integration_tests/web/pubspec.yaml b/dev/integration_tests/web/pubspec.yaml index 22d1a5c44c..eae11e0821 100644 --- a/dev/integration_tests/web/pubspec.yaml +++ b/dev/integration_tests/web/pubspec.yaml @@ -3,7 +3,7 @@ description: Integration test for web compilation. environment: # The pub client defaults to an <2.0.0 sdk constraint which we need to explicitly overwrite. - sdk: ">=2.0.0-dev.68.0 <3.0.0" + sdk: ">=2.6.0 <3.0.0" dependencies: flutter: diff --git a/packages/flutter_tools/bin/macos_assemble.sh b/packages/flutter_tools/bin/macos_assemble.sh index ad90d9f615..704f691d34 100755 --- a/packages/flutter_tools/bin/macos_assemble.sh +++ b/packages/flutter_tools/bin/macos_assemble.sh @@ -84,6 +84,7 @@ RunCommand "${FLUTTER_ROOT}/bin/flutter" \ -dDartObfuscation="${dart_obfuscation_flag}" \ -dSplitDebugInfo="${SPLIT_DEBUG_INFO}" \ --DartDefines="${DART_DEFINES}" \ + --ExtraGenSnapshotOptions="${EXTRA_GEN_SNAPSHOT_OPTIONS}" \ -dExtraFrontEndOptions="${EXTRA_FRONT_END_OPTIONS}" \ --build-inputs="${build_inputs_path}" \ --build-outputs="${build_outputs_path}" \ diff --git a/packages/flutter_tools/bin/xcode_backend.sh b/packages/flutter_tools/bin/xcode_backend.sh index 37806d550b..888bd70cb2 100755 --- a/packages/flutter_tools/bin/xcode_backend.sh +++ b/packages/flutter_tools/bin/xcode_backend.sh @@ -186,6 +186,7 @@ BuildApp() { -dTrackWidgetCreation="${track_widget_creation_flag}" \ -dDartObfuscation="${dart_obfuscation_flag}" \ -dEnableBitcode="${bitcode_flag}" \ + --ExtraGenSnapshotOptions="${EXTRA_GEN_SNAPSHOT_OPTIONS}" \ --DartDefines="${DART_DEFINES}" \ -dExtraFrontEndOptions="${EXTRA_FRONT_END_OPTIONS}" \ "${build_mode}_ios_bundle_flutter_assets" diff --git a/packages/flutter_tools/lib/src/android/gradle.dart b/packages/flutter_tools/lib/src/android/gradle.dart index 61f253d52a..16c12a130e 100644 --- a/packages/flutter_tools/lib/src/android/gradle.dart +++ b/packages/flutter_tools/lib/src/android/gradle.dart @@ -315,7 +315,7 @@ Future buildGradleApp({ command.add('-Pextra-front-end-options=${buildInfo.extraFrontEndOptions.join(',')}'); } if (buildInfo.extraGenSnapshotOptions != null) { - command.add('-Pextra-gen-snapshot-options=${buildInfo.extraGenSnapshotOptions}'); + command.add('-Pextra-gen-snapshot-options=${buildInfo.extraGenSnapshotOptions.join(',')}'); } if (buildInfo.fileSystemRoots != null && buildInfo.fileSystemRoots.isNotEmpty) { command.add('-Pfilesystem-roots=${buildInfo.fileSystemRoots.join('|')}'); diff --git a/packages/flutter_tools/lib/src/build_info.dart b/packages/flutter_tools/lib/src/build_info.dart index 324c77268e..70e45ccc04 100644 --- a/packages/flutter_tools/lib/src/build_info.dart +++ b/packages/flutter_tools/lib/src/build_info.dart @@ -24,6 +24,7 @@ class BuildInfo { this.splitDebugInfoPath, this.dartObfuscation = false, this.dartDefines = const [], + this.dartExperiments = const [], @required this.treeShakeIcons, }); @@ -79,6 +80,9 @@ class BuildInfo { /// [bool], [String], [int], and [double]. final List dartDefines; + /// A list of Dart experiments. + final List dartExperiments; + static const BuildInfo debug = BuildInfo(BuildMode.debug, null, treeShakeIcons: false); static const BuildInfo profile = BuildInfo(BuildMode.profile, null, treeShakeIcons: kIconTreeShakerEnabledDefault); static const BuildInfo jitRelease = BuildInfo(BuildMode.jitRelease, null, treeShakeIcons: kIconTreeShakerEnabledDefault); diff --git a/packages/flutter_tools/lib/src/build_runner/resident_web_runner.dart b/packages/flutter_tools/lib/src/build_runner/resident_web_runner.dart index 4508c37e50..b7dd68c83d 100644 --- a/packages/flutter_tools/lib/src/build_runner/resident_web_runner.dart +++ b/packages/flutter_tools/lib/src/build_runner/resident_web_runner.dart @@ -435,6 +435,7 @@ class _ResidentWebRunner extends ResidentWebRunner { debuggingOptions.buildInfo, debuggingOptions.initializePlatform, false, + debuggingOptions.buildInfo.dartExperiments, ); } await device.device.startApp( @@ -496,6 +497,7 @@ class _ResidentWebRunner extends ResidentWebRunner { debuggingOptions.buildInfo, debuggingOptions.initializePlatform, false, + debuggingOptions.buildInfo.dartExperiments, ); } on ToolExit { return OperationResult(1, 'Failed to recompile application.'); diff --git a/packages/flutter_tools/lib/src/build_system/targets/ios.dart b/packages/flutter_tools/lib/src/build_system/targets/ios.dart index 8d1943d9a6..241e330be7 100644 --- a/packages/flutter_tools/lib/src/build_system/targets/ios.dart +++ b/packages/flutter_tools/lib/src/build_system/targets/ios.dart @@ -46,8 +46,7 @@ abstract class AotAssemblyBase extends Target { if (environment.defines[kTargetPlatform] == null) { throw MissingDefineException(kTargetPlatform, 'aot_assembly'); } - final List extraGenSnapshotOptions = environment - .defines[kExtraGenSnapshotOptions]?.split(',') ?? const []; + final List extraGenSnapshotOptions = parseExtraGenSnapshotOptions(environment); final bool bitcode = environment.defines[kBitcodeFlag] == 'true'; final BuildMode buildMode = getBuildModeForName(environment.defines[kBuildMode]); final TargetPlatform targetPlatform = getTargetPlatformForName(environment.defines[kTargetPlatform]); @@ -438,3 +437,13 @@ Future createStubAppFramework(File outputFile, SdkType sdk, { bool in } } } + +/// iOS and macOS build scripts may pass extraGenSnapshotOptions as an empty +/// string. +List parseExtraGenSnapshotOptions(Environment environment) { + final String value = environment.defines[kExtraGenSnapshotOptions]; + if (value == null || value.trim().isEmpty) { + return []; + } + return value.split(','); +} diff --git a/packages/flutter_tools/lib/src/build_system/targets/macos.dart b/packages/flutter_tools/lib/src/build_system/targets/macos.dart index 447212c57d..317610f886 100644 --- a/packages/flutter_tools/lib/src/build_system/targets/macos.dart +++ b/packages/flutter_tools/lib/src/build_system/targets/macos.dart @@ -15,6 +15,7 @@ import '../exceptions.dart'; import 'assets.dart'; import 'dart.dart'; import 'icon_tree_shaker.dart'; +import 'ios.dart'; /// Copy the macOS framework to the correct copy dir by invoking 'cp -R'. /// @@ -198,6 +199,7 @@ class CompileMacOSFramework extends Target { } final String splitDebugInfo = environment.defines[kSplitDebugInfo]; final bool dartObfuscation = environment.defines[kDartObfuscation] == 'true'; + final List extraGenSnapshotOptions = parseExtraGenSnapshotOptions(environment); final AOTSnapshotter snapshotter = AOTSnapshotter( reportTimings: false, fileSystem: globals.fs, @@ -216,6 +218,7 @@ class CompileMacOSFramework extends Target { packagesPath: environment.projectDir.childFile('.packages').path, splitDebugInfo: splitDebugInfo, dartObfuscation: dartObfuscation, + extraGenSnapshotOptions: extraGenSnapshotOptions, ); if (result != 0) { throw Exception('gen shapshot failed.'); diff --git a/packages/flutter_tools/lib/src/build_system/targets/web.dart b/packages/flutter_tools/lib/src/build_system/targets/web.dart index f31e25f2b5..607f7efd35 100644 --- a/packages/flutter_tools/lib/src/build_system/targets/web.dart +++ b/packages/flutter_tools/lib/src/build_system/targets/web.dart @@ -27,6 +27,11 @@ const String kHasWebPlugins = 'HasWebPlugins'; /// Valid values are O1 (lowest, profile default) to O4 (highest, release default). const String kDart2jsOptimization = 'Dart2jsOptimization'; +/// Allow specifying experiments for dart2js. +/// +/// Multiple values should be encoded as a comma-separated list. +const String kEnableExperiment = 'EnableExperiment'; + /// Whether to disable dynamic generation code to satisfy csp policies. const String kCspMode = 'cspMode'; @@ -152,11 +157,13 @@ class Dart2JSTarget extends Target { final String dart2jsOptimization = environment.defines[kDart2jsOptimization]; final bool csp = environment.defines[kCspMode] == 'true'; final BuildMode buildMode = getBuildModeForName(environment.defines[kBuildMode]); - final String specPath = globals.fs.path.join(globals.artifacts.getArtifactPath(Artifact.flutterWebSdk), 'libraries.json'); + final String specPath = globals.fs.path.join( + globals.artifacts.getArtifactPath(Artifact.flutterWebSdk), 'libraries.json'); final String packageFile = globalPackagesPath; final File outputKernel = environment.buildDir.childFile('app.dill'); final File outputFile = environment.buildDir.childFile('main.dart.js'); final List dartDefines = parseDartDefines(environment); + final String enabledExperiments = environment.defines[kEnableExperiment]; // Run the dart2js compilation in two stages, so that icon tree shaking can // parse the kernel file for web builds. @@ -164,11 +171,17 @@ class Dart2JSTarget extends Target { globals.artifacts.getArtifactPath(Artifact.engineDartBinary), globals.artifacts.getArtifactPath(Artifact.dart2jsSnapshot), '--libraries-spec=$specPath', + if (enabledExperiments != null) + '--enable-experiment=$enabledExperiments', '-o', outputKernel.path, + '--packages=$packageFile', + if (buildMode == BuildMode.profile) + '-Ddart.vm.profile=true' + else + '-Ddart.vm.product=true', for (final String dartDefine in dartDefines) '-D$dartDefine', - '--packages=$packageFile', '--cfe-only', environment.buildDir.childFile('main.dart').path, ]); @@ -179,6 +192,8 @@ class Dart2JSTarget extends Target { globals.artifacts.getArtifactPath(Artifact.engineDartBinary), globals.artifacts.getArtifactPath(Artifact.dart2jsSnapshot), '--libraries-spec=$specPath', + if (enabledExperiments != null) + '--enable-experiment=$enabledExperiments', if (dart2jsOptimization != null) '-$dart2jsOptimization' else diff --git a/packages/flutter_tools/lib/src/commands/analyze.dart b/packages/flutter_tools/lib/src/commands/analyze.dart index 286a620dce..05035f13f4 100644 --- a/packages/flutter_tools/lib/src/commands/analyze.dart +++ b/packages/flutter_tools/lib/src/commands/analyze.dart @@ -30,7 +30,7 @@ class AnalyzeCommand extends FlutterCommand { _logger = logger, _terminal = terminal, _platform = platform { - addEnableExperimentation(verbose: verboseHelp); + addEnableExperimentation(hide: !verboseHelp); argParser.addFlag('flutter-repo', negatable: false, help: 'Include all the examples and tests from the Flutter repository.', diff --git a/packages/flutter_tools/lib/src/commands/build.dart b/packages/flutter_tools/lib/src/commands/build.dart index 24cc9cc34d..b2051c9f2b 100644 --- a/packages/flutter_tools/lib/src/commands/build.dart +++ b/packages/flutter_tools/lib/src/commands/build.dart @@ -21,19 +21,19 @@ import 'build_ios_framework.dart'; import 'build_web.dart'; class BuildCommand extends FlutterCommand { - BuildCommand({bool verboseHelp = false}) { + BuildCommand({ bool verboseHelp = false }) { addSubcommand(BuildAarCommand()); addSubcommand(BuildApkCommand(verboseHelp: verboseHelp)); addSubcommand(BuildAppBundleCommand(verboseHelp: verboseHelp)); addSubcommand(BuildAotCommand()); - addSubcommand(BuildIOSCommand()); + addSubcommand(BuildIOSCommand(verboseHelp: verboseHelp)); addSubcommand(BuildIOSFrameworkCommand( buildSystem: globals.buildSystem, bundleBuilder: BundleBuilder(), )); addSubcommand(BuildBundleCommand(verboseHelp: verboseHelp)); - addSubcommand(BuildWebCommand()); - addSubcommand(BuildMacosCommand()); + addSubcommand(BuildWebCommand(verboseHelp: verboseHelp)); + addSubcommand(BuildMacosCommand(verboseHelp: verboseHelp)); addSubcommand(BuildLinuxCommand()); addSubcommand(BuildWindowsCommand()); addSubcommand(BuildFuchsiaCommand(verboseHelp: verboseHelp)); diff --git a/packages/flutter_tools/lib/src/commands/build_apk.dart b/packages/flutter_tools/lib/src/commands/build_apk.dart index b24e78368d..9e0cb633e9 100644 --- a/packages/flutter_tools/lib/src/commands/build_apk.dart +++ b/packages/flutter_tools/lib/src/commands/build_apk.dart @@ -30,6 +30,7 @@ class BuildApkCommand extends BuildSubCommand { addDartObfuscationOption(); usesDartDefineOption(); usesExtraFrontendOptions(); + addEnableExperimentation(hide: !verboseHelp); argParser ..addFlag('split-per-abi', negatable: false, diff --git a/packages/flutter_tools/lib/src/commands/build_ios.dart b/packages/flutter_tools/lib/src/commands/build_ios.dart index ee319903dd..1bfab41245 100644 --- a/packages/flutter_tools/lib/src/commands/build_ios.dart +++ b/packages/flutter_tools/lib/src/commands/build_ios.dart @@ -4,6 +4,8 @@ import 'dart:async'; +import 'package:meta/meta.dart'; + import '../application_package.dart'; import '../base/common.dart'; import '../base/utils.dart'; @@ -17,7 +19,7 @@ import 'build.dart'; /// or simulator. Can only be run on a macOS host. For producing deployment /// .ipas, see https://flutter.dev/docs/deployment/ios. class BuildIOSCommand extends BuildSubCommand { - BuildIOSCommand() { + BuildIOSCommand({ @required bool verboseHelp }) { addTreeShakeIconsFlag(); addSplitDebugInfoOption(); addBuildModeFlags(defaultToRelease: false); @@ -29,6 +31,7 @@ class BuildIOSCommand extends BuildSubCommand { addDartObfuscationOption(); usesDartDefineOption(); usesExtraFrontendOptions(); + addEnableExperimentation(hide: !verboseHelp); argParser ..addFlag('simulator', help: 'Build for the iOS simulator instead of the device.', diff --git a/packages/flutter_tools/lib/src/commands/build_macos.dart b/packages/flutter_tools/lib/src/commands/build_macos.dart index af66d4d37c..1e8eade175 100644 --- a/packages/flutter_tools/lib/src/commands/build_macos.dart +++ b/packages/flutter_tools/lib/src/commands/build_macos.dart @@ -4,6 +4,8 @@ import 'dart:async'; +import 'package:meta/meta.dart'; + import '../base/common.dart'; import '../build_info.dart'; import '../cache.dart'; @@ -16,7 +18,7 @@ import 'build.dart'; /// A command to build a macOS desktop target through a build shell script. class BuildMacosCommand extends BuildSubCommand { - BuildMacosCommand() { + BuildMacosCommand({ @required bool verboseHelp }) { addTreeShakeIconsFlag(); addSplitDebugInfoOption(); usesTargetOption(); @@ -25,6 +27,7 @@ class BuildMacosCommand extends BuildSubCommand { usesExtraFrontendOptions(); usesBuildNumberOption(); usesBuildNameOption(); + addEnableExperimentation(hide: !verboseHelp); } @override diff --git a/packages/flutter_tools/lib/src/commands/build_web.dart b/packages/flutter_tools/lib/src/commands/build_web.dart index 95b09e504c..9ad38319e1 100644 --- a/packages/flutter_tools/lib/src/commands/build_web.dart +++ b/packages/flutter_tools/lib/src/commands/build_web.dart @@ -4,22 +4,27 @@ import 'dart:async'; +import 'package:meta/meta.dart'; + import '../base/common.dart'; import '../build_info.dart'; import '../features.dart'; import '../project.dart'; import '../runner/flutter_command.dart' - show DevelopmentArtifact, FlutterCommandResult; + show DevelopmentArtifact, FlutterCommandResult, FlutterOptions; import '../web/compile.dart'; import 'build.dart'; class BuildWebCommand extends BuildSubCommand { - BuildWebCommand() { + BuildWebCommand({ + @required bool verboseHelp, + }) { addTreeShakeIconsFlag(); usesTargetOption(); usesPubOption(); addBuildModeFlags(excludeDebug: true); usesDartDefineOption(); + addEnableExperimentation(hide: !verboseHelp); argParser.addFlag('web-initialize-platform', defaultsTo: true, negatable: true, @@ -66,6 +71,7 @@ class BuildWebCommand extends BuildSubCommand { buildInfo, boolArg('web-initialize-platform'), boolArg('csp'), + stringsArg(FlutterOptions.kEnableExperiment), ); return FlutterCommandResult.success(); } diff --git a/packages/flutter_tools/lib/src/commands/run.dart b/packages/flutter_tools/lib/src/commands/run.dart index 01b48a8d82..2b2e38c633 100644 --- a/packages/flutter_tools/lib/src/commands/run.dart +++ b/packages/flutter_tools/lib/src/commands/run.dart @@ -80,6 +80,8 @@ class RunCommand extends RunCommandBase { RunCommand({ bool verboseHelp = false }) : super(verboseHelp: verboseHelp) { requiresPubspecYaml(); usesFilesystemOptions(hide: !verboseHelp); + usesExtraFrontendOptions(); + addEnableExperimentation(hide: !verboseHelp); argParser ..addFlag('start-paused', negatable: false, @@ -208,11 +210,6 @@ class RunCommand extends RunCommandBase { help: 'Whether to quickly bootstrap applications with a minimal app. ' 'Currently this is only supported on Android devices. This option ' 'cannot be paired with --use-application-binary.' - ) - ..addOption(FlutterOptions.kExtraFrontEndOptions, hide: true) - ..addMultiOption(FlutterOptions.kEnableExperiment, - splitCommas: true, - hide: true, ); } diff --git a/packages/flutter_tools/lib/src/ios/xcodeproj.dart b/packages/flutter_tools/lib/src/ios/xcodeproj.dart index b100f36374..1282681e5f 100644 --- a/packages/flutter_tools/lib/src/ios/xcodeproj.dart +++ b/packages/flutter_tools/lib/src/ios/xcodeproj.dart @@ -239,7 +239,16 @@ List _xcodeBuildSettingsLines({ } if (buildInfo.extraFrontEndOptions?.isNotEmpty ?? false) { - xcodeBuildSettings.add('EXTRA_FRONT_END_OPTIONS=${buildInfo.extraFrontEndOptions.join(',')}'); + xcodeBuildSettings.add( + 'EXTRA_FRONT_END_OPTIONS=' + '${buildInfo.extraFrontEndOptions.join(',')}', + ); + } + if (buildInfo.extraGenSnapshotOptions?.isNotEmpty ?? false) { + xcodeBuildSettings.add( + 'EXTRA_GEN_SNAPSHOT_OPTIONS=' + '${buildInfo.extraGenSnapshotOptions.join(',')}', + ); } return xcodeBuildSettings; diff --git a/packages/flutter_tools/lib/src/runner/flutter_command.dart b/packages/flutter_tools/lib/src/runner/flutter_command.dart index 5d5aa78c89..d7cd98ddb3 100644 --- a/packages/flutter_tools/lib/src/runner/flutter_command.dart +++ b/packages/flutter_tools/lib/src/runner/flutter_command.dart @@ -470,14 +470,14 @@ abstract class FlutterCommand extends Command { ); } - void addEnableExperimentation({ bool verbose }) { + void addEnableExperimentation({ bool hide = false }) { argParser.addMultiOption( FlutterOptions.kEnableExperiment, help: 'The name of an experimental Dart feature to enable. For more info ' 'see: https://github.com/dart-lang/sdk/blob/master/docs/process/' 'experimental-flags.md', - hide: !verbose, + hide: hide, ); } @@ -542,18 +542,27 @@ abstract class FlutterCommand extends Command { boolArg('track-widget-creation'); final String buildNumber = argParser.options.containsKey('build-number') - ? stringArg('build-number') - : null; + ? stringArg('build-number') + : null; + final List experiments = + argParser.options.containsKey(FlutterOptions.kEnableExperiment) + ? stringsArg(FlutterOptions.kEnableExperiment) + : []; + final List extraGenSnapshotOptions = + argParser.options.containsKey(FlutterOptions.kExtraGenSnapshotOptions) + ? stringsArg(FlutterOptions.kExtraGenSnapshotOptions) + : []; final List extraFrontEndOptions = - argParser.options.containsKey(FlutterOptions.kExtraFrontEndOptions) - ? stringsArg(FlutterOptions.kExtraFrontEndOptions) - : []; - if (argParser.options.containsKey(FlutterOptions.kEnableExperiment) && - argResults[FlutterOptions.kEnableExperiment] != null) { - for (final String expFlag in stringsArg(FlutterOptions.kEnableExperiment)) { + argParser.options.containsKey(FlutterOptions.kExtraFrontEndOptions) + ? stringsArg(FlutterOptions.kExtraFrontEndOptions) + : []; + + if (experiments.isNotEmpty) { + for (final String expFlag in experiments) { final String flag = '--enable-experiment=' + expFlag; extraFrontEndOptions.add(flag); + extraGenSnapshotOptions.add(flag); } } @@ -579,8 +588,8 @@ abstract class FlutterCommand extends Command { extraFrontEndOptions: extraFrontEndOptions?.isNotEmpty ?? false ? extraFrontEndOptions : null, - extraGenSnapshotOptions: argParser.options.containsKey(FlutterOptions.kExtraGenSnapshotOptions) - ? stringsArg(FlutterOptions.kExtraGenSnapshotOptions) + extraGenSnapshotOptions: extraGenSnapshotOptions?.isNotEmpty ?? false + ? extraGenSnapshotOptions : null, fileSystemRoots: argParser.options.containsKey(FlutterOptions.kFileSystemRoot) ? stringsArg(FlutterOptions.kFileSystemRoot) @@ -600,6 +609,7 @@ abstract class FlutterCommand extends Command { dartDefines: argParser.options.containsKey(FlutterOptions.kDartDefinesOption) ? stringsArg(FlutterOptions.kDartDefinesOption) : const [], + dartExperiments: experiments, ); } diff --git a/packages/flutter_tools/lib/src/web/compile.dart b/packages/flutter_tools/lib/src/web/compile.dart index 80db559840..e6156f7cc4 100644 --- a/packages/flutter_tools/lib/src/web/compile.dart +++ b/packages/flutter_tools/lib/src/web/compile.dart @@ -28,6 +28,7 @@ Future buildWeb( BuildInfo buildInfo, bool initializePlatform, bool csp, + List experiments, ) async { if (!flutterProject.web.existsSync()) { throwToolExit('Missing index.html.'); @@ -52,6 +53,8 @@ Future buildWeb( kDartDefines: buildInfo.dartDefines.join(','), kCspMode: csp.toString(), kIconTreeShakerFlag: buildInfo.treeShakeIcons.toString(), + if (experiments.isNotEmpty) + kEnableExperiment: experiments?.join(','), }, artifacts: globals.artifacts, fileSystem: globals.fs, diff --git a/packages/flutter_tools/test/commands.shard/hermetic/build_macos_test.dart b/packages/flutter_tools/test/commands.shard/hermetic/build_macos_test.dart index a9d97ad815..9447a5b458 100644 --- a/packages/flutter_tools/test/commands.shard/hermetic/build_macos_test.dart +++ b/packages/flutter_tools/test/commands.shard/hermetic/build_macos_test.dart @@ -249,14 +249,14 @@ void main() { }); testUsingContext('hidden when not enabled on macOS host', () { - expect(BuildMacosCommand().hidden, true); + expect(BuildMacosCommand(verboseHelp: false).hidden, true); }, overrides: { FeatureFlags: () => TestFeatureFlags(isMacOSEnabled: false), Platform: () => macosPlatform, }); testUsingContext('Not hidden when enabled and on macOS host', () { - expect(BuildMacosCommand().hidden, false); + expect(BuildMacosCommand(verboseHelp: false).hidden, false); }, overrides: { FeatureFlags: () => TestFeatureFlags(isMacOSEnabled: true), Platform: () => macosPlatform, diff --git a/packages/flutter_tools/test/commands.shard/hermetic/build_web_test.dart b/packages/flutter_tools/test/commands.shard/hermetic/build_web_test.dart index cb3e741b54..2bc342c3bc 100644 --- a/packages/flutter_tools/test/commands.shard/hermetic/build_web_test.dart +++ b/packages/flutter_tools/test/commands.shard/hermetic/build_web_test.dart @@ -59,6 +59,7 @@ void main() { BuildInfo.debug, false, false, + [], ), throwsToolExit()); }, overrides: { Platform: () => fakePlatform, @@ -186,7 +187,7 @@ class UrlLauncherPlugin {} }); testUsingContext('hidden if feature flag is not enabled', () async { - expect(BuildWebCommand().hidden, true); + expect(BuildWebCommand(verboseHelp: false).hidden, true); }, overrides: { Platform: () => fakePlatform, FileSystem: () => fileSystem, @@ -196,7 +197,7 @@ class UrlLauncherPlugin {} }); testUsingContext('not hidden if feature flag is enabled', () async { - expect(BuildWebCommand().hidden, false); + expect(BuildWebCommand(verboseHelp: false).hidden, false); }, overrides: { Platform: () => fakePlatform, FileSystem: () => fileSystem, diff --git a/packages/flutter_tools/test/general.shard/build_system/targets/web_test.dart b/packages/flutter_tools/test/general.shard/build_system/targets/web_test.dart index 330ea597f2..183a4dbeb9 100644 --- a/packages/flutter_tools/test/general.shard/build_system/targets/web_test.dart +++ b/packages/flutter_tools/test/general.shard/build_system/targets/web_test.dart @@ -229,7 +229,8 @@ void main() { ...kDart2jsLinuxArgs, '-o', environment.buildDir.childFile('app.dill').absolute.path, - '--packages=${globals.fs.path.join('foo', '.packages')}', + '--packages=${globals.fs.path.join('foo', '.packages')}', + '-Ddart.vm.profile=true', '--cfe-only', environment.buildDir.childFile('main.dart').absolute.path, ] @@ -253,6 +254,39 @@ void main() { })); + test('Dart2JSTarget calls dart2js with expected args with enabled experiment', () => testbed.run(() async { + environment.defines[kBuildMode] = 'profile'; + environment.defines[kEnableExperiment] = 'non-nullable'; + processManager.addCommand(FakeCommand( + command: [ + ...kDart2jsLinuxArgs, + '--enable-experiment=non-nullable', + '-o', + environment.buildDir.childFile('app.dill').absolute.path, + '--packages=${globals.fs.path.join('foo', '.packages')}', + '-Ddart.vm.profile=true', + '--cfe-only', + environment.buildDir.childFile('main.dart').absolute.path, + ] + )); + processManager.addCommand(FakeCommand( + command: [ + ...kDart2jsLinuxArgs, + '--enable-experiment=non-nullable', + '-O4', + '-Ddart.vm.profile=true', + '--no-minify', + '-o', + environment.buildDir.childFile('main.dart.js').absolute.path, + environment.buildDir.childFile('app.dill').absolute.path, + ] + )); + + await const Dart2JSTarget().build(environment); + }, overrides: { + ProcessManager: () => processManager, + })); + test('Dart2JSTarget calls dart2js with expected args in profile mode', () => testbed.run(() async { environment.defines[kBuildMode] = 'profile'; processManager.addCommand(FakeCommand( @@ -260,7 +294,8 @@ void main() { ...kDart2jsLinuxArgs, '-o', environment.buildDir.childFile('app.dill').absolute.path, - '--packages=${globals.fs.path.join('foo', '.packages')}', + '--packages=${globals.fs.path.join('foo', '.packages')}', + '-Ddart.vm.profile=true', '--cfe-only', environment.buildDir.childFile('main.dart').absolute.path, ] @@ -289,7 +324,8 @@ void main() { ...kDart2jsLinuxArgs, '-o', environment.buildDir.childFile('app.dill').absolute.path, - '--packages=${globals.fs.path.join('foo', '.packages')}', + '--packages=${globals.fs.path.join('foo', '.packages')}', + '-Ddart.vm.product=true', '--cfe-only', environment.buildDir.childFile('main.dart').absolute.path, ] @@ -318,7 +354,8 @@ void main() { ...kDart2jsLinuxArgs, '-o', environment.buildDir.childFile('app.dill').absolute.path, - '--packages=${globals.fs.path.join('foo', '.packages')}', + '--packages=${globals.fs.path.join('foo', '.packages')}', + '-Ddart.vm.product=true', '--cfe-only', environment.buildDir.childFile('main.dart').absolute.path, ] @@ -366,10 +403,11 @@ void main() { ...kDart2jsLinuxArgs, '-o', environment.buildDir.childFile('app.dill').absolute.path, + '--packages=${globals.fs.path.join('foo', '.packages')}', + '-Ddart.vm.product=true', '-DFOO=bar', '-DBAZ=qux', - '--packages=${globals.fs.path.join('foo', '.packages')}', - '--cfe-only', + '--cfe-only', environment.buildDir.childFile('main.dart').absolute.path, ] )); @@ -399,9 +437,10 @@ void main() { ...kDart2jsLinuxArgs, '-o', environment.buildDir.childFile('app.dill').absolute.path, + '--packages=${globals.fs.path.join('foo', '.packages')}', + '-Ddart.vm.profile=true', '-DFOO=bar', '-DBAZ=qux', - '--packages=${globals.fs.path.join('foo', '.packages')}', '--cfe-only', environment.buildDir.childFile('main.dart').absolute.path, ]