Commit 4b957bf0 authored by Michael Goderbauer's avatar Michael Goderbauer Committed by GitHub

Keep provisioning step (#10736)

parent bd67926f
...@@ -16,11 +16,17 @@ const String _kTestXcconfigFileName = 'TestConfig.xcconfig'; ...@@ -16,11 +16,17 @@ const String _kTestXcconfigFileName = 'TestConfig.xcconfig';
const FileSystem _fs = const io.LocalFileSystem(); const FileSystem _fs = const io.LocalFileSystem();
/// Patches the given Xcode project adding provisioning certificates and team /// 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<Null> prepareProvisioningCertificates(String flutterProjectPath) async { Future<Null> prepareProvisioningCertificates(String flutterProjectPath) async {
final String certificateConfig = await _readProvisioningConfigFile(); 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')); final File testXcconfig = _fs.file(path.join(flutterProjectPath, 'ios/Flutter/$_kTestXcconfigFileName'));
await testXcconfig.writeAsString(certificateConfig); await testXcconfig.writeAsString(certificateConfig);
} }
...@@ -76,18 +82,11 @@ $specificMessage ...@@ -76,18 +82,11 @@ $specificMessage
} }
if (!dart_io.Platform.environment.containsKey(_kProvisioningConfigFileEnvironmentVariable)) { if (!dart_io.Platform.environment.containsKey(_kProvisioningConfigFileEnvironmentVariable)) {
throwUsageError(''' print('''
$_kProvisioningConfigFileEnvironmentVariable variable is not defined in your $_kProvisioningConfigFileEnvironmentVariable variable is not defined in your
environment. Please, define it and try again. environment. Relying on automatic signing by Xcode...
Example provisioning xcconfig:
ProvisioningStyle=Manual
CODE_SIGN_IDENTITY=...
PROVISIONING_PROFILE=...
DEVELOPMENT_TEAM=...
PROVISIONING_PROFILE_SPECIFIER=...
'''.trim()); '''.trim());
return null;
} }
final String filePath = dart_io.Platform.environment[_kProvisioningConfigFileEnvironmentVariable]; final String filePath = dart_io.Platform.environment[_kProvisioningConfigFileEnvironmentVariable];
......
...@@ -31,11 +31,8 @@ class GalleryTransitionTest { ...@@ -31,11 +31,8 @@ class GalleryTransitionTest {
await inDirectory(galleryDirectory, () async { await inDirectory(galleryDirectory, () async {
await flutter('packages', options: <String>['get']); await flutter('packages', options: <String>['get']);
if (deviceOperatingSystem == DeviceOperatingSystem.ios) { if (deviceOperatingSystem == DeviceOperatingSystem.ios)
await prepareProvisioningCertificates(galleryDirectory.path); await prepareProvisioningCertificates(galleryDirectory.path);
// This causes an Xcode project to be created.
await flutter('build', options: <String>['ios', '--profile']);
}
final String testDriver = semanticsEnabled final String testDriver = semanticsEnabled
? 'transitions_perf_with_semantics.dart' ? 'transitions_perf_with_semantics.dart'
......
...@@ -37,11 +37,8 @@ class DriverTest { ...@@ -37,11 +37,8 @@ class DriverTest {
final String deviceId = device.deviceId; final String deviceId = device.deviceId;
await flutter('packages', options: <String>['get']); await flutter('packages', options: <String>['get']);
if (deviceOperatingSystem == DeviceOperatingSystem.ios) { if (deviceOperatingSystem == DeviceOperatingSystem.ios)
await prepareProvisioningCertificates(testDirectory); await prepareProvisioningCertificates(testDirectory);
// This causes an Xcode project to be created.
await flutter('build', options: <String>['ios', '--profile']);
}
await flutter('drive', options: <String>[ await flutter('drive', options: <String>[
'-v', '-v',
......
...@@ -18,11 +18,8 @@ Future<TaskResult> runEndToEndTests() async { ...@@ -18,11 +18,8 @@ Future<TaskResult> runEndToEndTests() async {
await inDirectory(testDirectory, () async { await inDirectory(testDirectory, () async {
await flutter('packages', options: <String>['get']); await flutter('packages', options: <String>['get']);
if (deviceOperatingSystem == DeviceOperatingSystem.ios) { if (deviceOperatingSystem == DeviceOperatingSystem.ios)
await prepareProvisioningCertificates(testDirectory.path); await prepareProvisioningCertificates(testDirectory.path);
// This causes an Xcode project to be created.
await flutter('build', options: <String>['ios', 'lib/keyboard_resize.dart']);
}
await flutter('drive', options: <String>['-d', deviceId, '-t', 'lib/keyboard_resize.dart']); await flutter('drive', options: <String>['-d', deviceId, '-t', 'lib/keyboard_resize.dart']);
}); });
......
...@@ -73,9 +73,6 @@ TaskFunction createFlutterViewStartupTest() { ...@@ -73,9 +73,6 @@ TaskFunction createFlutterViewStartupTest() {
return new StartupTest( return new StartupTest(
'${flutterDirectory.path}/examples/flutter_view', '${flutterDirectory.path}/examples/flutter_view',
reportMetrics: false, 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() { ...@@ -83,27 +80,18 @@ TaskFunction createFlutterViewStartupTest() {
class StartupTest { class StartupTest {
static const Duration _startupTimeout = const Duration(minutes: 5); 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 String testDirectory;
final bool reportMetrics; 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<TaskResult> call() async { Future<TaskResult> call() async {
return await inDirectory(testDirectory, () async { return await inDirectory(testDirectory, () async {
final String deviceId = (await devices.workingDevice).deviceId; final String deviceId = (await devices.workingDevice).deviceId;
await flutter('packages', options: <String>['get']); await flutter('packages', options: <String>['get']);
if (deviceOperatingSystem == DeviceOperatingSystem.ios) { if (deviceOperatingSystem == DeviceOperatingSystem.ios)
if (runPodInstall)
await runPodInstallForCustomPodfile(testDirectory);
await prepareProvisioningCertificates(testDirectory); await prepareProvisioningCertificates(testDirectory);
// This causes an Xcode project to be created.
await flutter('build', options: <String>['ios', '--profile']);
}
await flutter('run', options: <String>[ await flutter('run', options: <String>[
'--verbose', '--verbose',
...@@ -141,11 +129,8 @@ class PerfTest { ...@@ -141,11 +129,8 @@ class PerfTest {
final String deviceId = device.deviceId; final String deviceId = device.deviceId;
await flutter('packages', options: <String>['get']); await flutter('packages', options: <String>['get']);
if (deviceOperatingSystem == DeviceOperatingSystem.ios) { if (deviceOperatingSystem == DeviceOperatingSystem.ios)
await prepareProvisioningCertificates(testDirectory); await prepareProvisioningCertificates(testDirectory);
// This causes an Xcode project to be created.
await flutter('build', options: <String>['ios', '--profile']);
}
await flutter('drive', options: <String>[ await flutter('drive', options: <String>[
'-v', '-v',
...@@ -280,11 +265,8 @@ class MemoryTest { ...@@ -280,11 +265,8 @@ class MemoryTest {
final String deviceId = device.deviceId; final String deviceId = device.deviceId;
await flutter('packages', options: <String>['get']); await flutter('packages', options: <String>['get']);
if (deviceOperatingSystem == DeviceOperatingSystem.ios) { if (deviceOperatingSystem == DeviceOperatingSystem.ios)
await prepareProvisioningCertificates(testDirectory); await prepareProvisioningCertificates(testDirectory);
// This causes an Xcode project to be created.
await flutter('build', options: <String>['ios', '--profile']);
}
final int observatoryPort = await findAvailablePort(); final int observatoryPort = await findAvailablePort();
......
#include "Generated.xcconfig" #include "Generated.xcconfig"
#include "TestConfig.xcconfig"
#include "Generated.xcconfig" #include "Generated.xcconfig"
#include "TestConfig.xcconfig"
ProvisioningStyle=Manual
CODE_SIGN_IDENTITY=iPhone Developer
PROVISIONING_PROFILE=Xcode Managed Profile
DEVELOPMENT_TEAM=...
PROVISIONING_PROFILE_SPECIFIER=...
...@@ -7,10 +7,10 @@ ...@@ -7,10 +7,10 @@
objects = { objects = {
/* Begin PBXBuildFile section */ /* 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 */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; }; 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, ); }; }; 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 */; }; 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, ); }; }; 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 */; }; 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; };
...@@ -39,10 +39,10 @@ ...@@ -39,10 +39,10 @@
/* End PBXCopyFilesBuildPhase section */ /* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */ /* Begin PBXFileReference section */
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = "<group>"; }; 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = "<group>"; };
74970F721EDC3266000507F3 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
74970F731EDC3266000507F3 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; }; 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; }; 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
...@@ -91,6 +91,7 @@ ...@@ -91,6 +91,7 @@
9740EEB11CF90186004384FC /* Flutter */, 9740EEB11CF90186004384FC /* Flutter */,
97C146F01CF9000F007C117D /* Runner */, 97C146F01CF9000F007C117D /* Runner */,
97C146EF1CF9000F007C117D /* Products */, 97C146EF1CF9000F007C117D /* Products */,
CF3B75C9A7D2FA2A4C99F110 /* Frameworks */,
); );
sourceTree = "<group>"; sourceTree = "<group>";
}; };
...@@ -105,8 +106,6 @@ ...@@ -105,8 +106,6 @@
97C146F01CF9000F007C117D /* Runner */ = { 97C146F01CF9000F007C117D /* Runner */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
74970F721EDC3266000507F3 /* GeneratedPluginRegistrant.h */,
74970F731EDC3266000507F3 /* GeneratedPluginRegistrant.m */,
7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */, 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */,
7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */, 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */,
97C146FA1CF9000F007C117D /* Main.storyboard */, 97C146FA1CF9000F007C117D /* Main.storyboard */,
...@@ -114,6 +113,8 @@ ...@@ -114,6 +113,8 @@
97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
97C147021CF9000F007C117D /* Info.plist */, 97C147021CF9000F007C117D /* Info.plist */,
97C146F11CF9000F007C117D /* Supporting Files */, 97C146F11CF9000F007C117D /* Supporting Files */,
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
); );
path = Runner; path = Runner;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -160,7 +161,6 @@ ...@@ -160,7 +161,6 @@
TargetAttributes = { TargetAttributes = {
97C146ED1CF9000F007C117D = { 97C146ED1CF9000F007C117D = {
CreatedOnToolsVersion = 7.3.1; CreatedOnToolsVersion = 7.3.1;
DevelopmentTeam = ...;
}; };
}; };
}; };
...@@ -237,7 +237,7 @@ ...@@ -237,7 +237,7 @@
files = ( files = (
978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */, 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */,
97C146F31CF9000F007C117D /* main.m in Sources */, 97C146F31CF9000F007C117D /* main.m in Sources */,
74970F741EDC3266000507F3 /* GeneratedPluginRegistrant.m in Sources */, 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment