diff --git a/dev/devicelab/lib/framework/ios.dart b/dev/devicelab/lib/framework/ios.dart index 28f726316c2..b9119acf20b 100644 --- a/dev/devicelab/lib/framework/ios.dart +++ b/dev/devicelab/lib/framework/ios.dart @@ -16,11 +16,17 @@ const String _kTestXcconfigFileName = 'TestConfig.xcconfig'; const FileSystem _fs = const io.LocalFileSystem(); /// Patches the given Xcode project adding provisioning certificates and team -/// information required to build and run the project. +/// information required to build and run the project, if +/// FLUTTER_DEVICELAB_XCODE_PROVISIONING_CONFIG is set. If it is not set, +/// we rely on automatic signing by Xcode. Future prepareProvisioningCertificates(String flutterProjectPath) async { final String certificateConfig = await _readProvisioningConfigFile(); - await _patchXcconfigFilesIfNotPatched(flutterProjectPath); + if (certificateConfig == null) { + // No cert config available, rely on automatic signing by Xcode. + return; + } + await _patchXcconfigFilesIfNotPatched(flutterProjectPath); final File testXcconfig = _fs.file(path.join(flutterProjectPath, 'ios/Flutter/$_kTestXcconfigFileName')); await testXcconfig.writeAsString(certificateConfig); } @@ -76,18 +82,11 @@ $specificMessage } if (!dart_io.Platform.environment.containsKey(_kProvisioningConfigFileEnvironmentVariable)) { - throwUsageError(''' + print(''' $_kProvisioningConfigFileEnvironmentVariable variable is not defined in your -environment. Please, define it and try again. - -Example provisioning xcconfig: - -ProvisioningStyle=Manual -CODE_SIGN_IDENTITY=... -PROVISIONING_PROFILE=... -DEVELOPMENT_TEAM=... -PROVISIONING_PROFILE_SPECIFIER=... +environment. Relying on automatic signing by Xcode... '''.trim()); + return null; } final String filePath = dart_io.Platform.environment[_kProvisioningConfigFileEnvironmentVariable]; diff --git a/dev/devicelab/lib/tasks/gallery.dart b/dev/devicelab/lib/tasks/gallery.dart index b0730033bd3..418ff3ab3bf 100644 --- a/dev/devicelab/lib/tasks/gallery.dart +++ b/dev/devicelab/lib/tasks/gallery.dart @@ -31,11 +31,8 @@ class GalleryTransitionTest { await inDirectory(galleryDirectory, () async { await flutter('packages', options: ['get']); - if (deviceOperatingSystem == DeviceOperatingSystem.ios) { + if (deviceOperatingSystem == DeviceOperatingSystem.ios) await prepareProvisioningCertificates(galleryDirectory.path); - // This causes an Xcode project to be created. - await flutter('build', options: ['ios', '--profile']); - } final String testDriver = semanticsEnabled ? 'transitions_perf_with_semantics.dart' diff --git a/dev/devicelab/lib/tasks/integration_tests.dart b/dev/devicelab/lib/tasks/integration_tests.dart index 004e7e59392..557e245bce5 100644 --- a/dev/devicelab/lib/tasks/integration_tests.dart +++ b/dev/devicelab/lib/tasks/integration_tests.dart @@ -37,11 +37,8 @@ class DriverTest { final String deviceId = device.deviceId; await flutter('packages', options: ['get']); - if (deviceOperatingSystem == DeviceOperatingSystem.ios) { + if (deviceOperatingSystem == DeviceOperatingSystem.ios) await prepareProvisioningCertificates(testDirectory); - // This causes an Xcode project to be created. - await flutter('build', options: ['ios', '--profile']); - } await flutter('drive', options: [ '-v', diff --git a/dev/devicelab/lib/tasks/integration_ui.dart b/dev/devicelab/lib/tasks/integration_ui.dart index 0bbcf1969ea..ddbab5f788f 100644 --- a/dev/devicelab/lib/tasks/integration_ui.dart +++ b/dev/devicelab/lib/tasks/integration_ui.dart @@ -18,11 +18,8 @@ Future runEndToEndTests() async { await inDirectory(testDirectory, () async { await flutter('packages', options: ['get']); - if (deviceOperatingSystem == DeviceOperatingSystem.ios) { + if (deviceOperatingSystem == DeviceOperatingSystem.ios) await prepareProvisioningCertificates(testDirectory.path); - // This causes an Xcode project to be created. - await flutter('build', options: ['ios', 'lib/keyboard_resize.dart']); - } await flutter('drive', options: ['-d', deviceId, '-t', 'lib/keyboard_resize.dart']); }); diff --git a/dev/devicelab/lib/tasks/perf_tests.dart b/dev/devicelab/lib/tasks/perf_tests.dart index 282c7cdfc87..900e0228017 100644 --- a/dev/devicelab/lib/tasks/perf_tests.dart +++ b/dev/devicelab/lib/tasks/perf_tests.dart @@ -73,9 +73,6 @@ TaskFunction createFlutterViewStartupTest() { return new StartupTest( '${flutterDirectory.path}/examples/flutter_view', reportMetrics: false, - // This project has a non-standard CocoaPods Podfile. Run pod install - // before building the project. - runPodInstall: true, ); } @@ -83,27 +80,18 @@ TaskFunction createFlutterViewStartupTest() { class StartupTest { static const Duration _startupTimeout = const Duration(minutes: 5); - const StartupTest(this.testDirectory, { this.reportMetrics: true, this.runPodInstall: false }); + const StartupTest(this.testDirectory, { this.reportMetrics: true }); final String testDirectory; final bool reportMetrics; - /// Used to trigger a `pod install` when the project has a custom Podfile and - /// flutter build ios won't automatically run `pod install` via the managed - /// plugin system. - final bool runPodInstall; Future call() async { return await inDirectory(testDirectory, () async { final String deviceId = (await devices.workingDevice).deviceId; await flutter('packages', options: ['get']); - if (deviceOperatingSystem == DeviceOperatingSystem.ios) { - if (runPodInstall) - await runPodInstallForCustomPodfile(testDirectory); + if (deviceOperatingSystem == DeviceOperatingSystem.ios) await prepareProvisioningCertificates(testDirectory); - // This causes an Xcode project to be created. - await flutter('build', options: ['ios', '--profile']); - } await flutter('run', options: [ '--verbose', @@ -141,11 +129,8 @@ class PerfTest { final String deviceId = device.deviceId; await flutter('packages', options: ['get']); - if (deviceOperatingSystem == DeviceOperatingSystem.ios) { + if (deviceOperatingSystem == DeviceOperatingSystem.ios) await prepareProvisioningCertificates(testDirectory); - // This causes an Xcode project to be created. - await flutter('build', options: ['ios', '--profile']); - } await flutter('drive', options: [ '-v', @@ -280,11 +265,8 @@ class MemoryTest { final String deviceId = device.deviceId; await flutter('packages', options: ['get']); - if (deviceOperatingSystem == DeviceOperatingSystem.ios) { + if (deviceOperatingSystem == DeviceOperatingSystem.ios) await prepareProvisioningCertificates(testDirectory); - // This causes an Xcode project to be created. - await flutter('build', options: ['ios', '--profile']); - } final int observatoryPort = await findAvailablePort(); diff --git a/dev/integration_tests/channels/ios/Flutter/Debug.xcconfig b/dev/integration_tests/channels/ios/Flutter/Debug.xcconfig index 5c0c1707526..592ceee85b8 100644 --- a/dev/integration_tests/channels/ios/Flutter/Debug.xcconfig +++ b/dev/integration_tests/channels/ios/Flutter/Debug.xcconfig @@ -1,3 +1 @@ #include "Generated.xcconfig" - -#include "TestConfig.xcconfig" diff --git a/dev/integration_tests/channels/ios/Flutter/Release.xcconfig b/dev/integration_tests/channels/ios/Flutter/Release.xcconfig index 5c0c1707526..592ceee85b8 100644 --- a/dev/integration_tests/channels/ios/Flutter/Release.xcconfig +++ b/dev/integration_tests/channels/ios/Flutter/Release.xcconfig @@ -1,3 +1 @@ #include "Generated.xcconfig" - -#include "TestConfig.xcconfig" diff --git a/dev/integration_tests/channels/ios/Flutter/TestConfig.xcconfig b/dev/integration_tests/channels/ios/Flutter/TestConfig.xcconfig deleted file mode 100644 index 6c52ef8d549..00000000000 --- a/dev/integration_tests/channels/ios/Flutter/TestConfig.xcconfig +++ /dev/null @@ -1,5 +0,0 @@ -ProvisioningStyle=Manual -CODE_SIGN_IDENTITY=iPhone Developer -PROVISIONING_PROFILE=Xcode Managed Profile -DEVELOPMENT_TEAM=... -PROVISIONING_PROFILE_SPECIFIER=... diff --git a/dev/integration_tests/channels/ios/Runner.xcodeproj/project.pbxproj b/dev/integration_tests/channels/ios/Runner.xcodeproj/project.pbxproj index 90c96d998a0..f5c72c63871 100644 --- a/dev/integration_tests/channels/ios/Runner.xcodeproj/project.pbxproj +++ b/dev/integration_tests/channels/ios/Runner.xcodeproj/project.pbxproj @@ -7,10 +7,10 @@ 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, ); }; }; - 74970F741EDC3266000507F3 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 74970F731EDC3266000507F3 /* GeneratedPluginRegistrant.m */; }; 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 */; }; @@ -39,10 +39,10 @@ /* 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 = ""; }; - 74970F721EDC3266000507F3 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; - 74970F731EDC3266000507F3 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; 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 = ""; }; @@ -91,6 +91,7 @@ 9740EEB11CF90186004384FC /* Flutter */, 97C146F01CF9000F007C117D /* Runner */, 97C146EF1CF9000F007C117D /* Products */, + CF3B75C9A7D2FA2A4C99F110 /* Frameworks */, ); sourceTree = ""; }; @@ -105,8 +106,6 @@ 97C146F01CF9000F007C117D /* Runner */ = { isa = PBXGroup; children = ( - 74970F721EDC3266000507F3 /* GeneratedPluginRegistrant.h */, - 74970F731EDC3266000507F3 /* GeneratedPluginRegistrant.m */, 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */, 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */, 97C146FA1CF9000F007C117D /* Main.storyboard */, @@ -114,6 +113,8 @@ 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 97C147021CF9000F007C117D /* Info.plist */, 97C146F11CF9000F007C117D /* Supporting Files */, + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, ); path = Runner; sourceTree = ""; @@ -160,7 +161,6 @@ TargetAttributes = { 97C146ED1CF9000F007C117D = { CreatedOnToolsVersion = 7.3.1; - DevelopmentTeam = ...; }; }; }; @@ -237,7 +237,7 @@ files = ( 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */, 97C146F31CF9000F007C117D /* main.m in Sources */, - 74970F741EDC3266000507F3 /* GeneratedPluginRegistrant.m in Sources */, + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; };