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';
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<Null> 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];
......
......@@ -31,11 +31,8 @@ class GalleryTransitionTest {
await inDirectory(galleryDirectory, () async {
await flutter('packages', options: <String>['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: <String>['ios', '--profile']);
}
final String testDriver = semanticsEnabled
? 'transitions_perf_with_semantics.dart'
......
......@@ -37,11 +37,8 @@ class DriverTest {
final String deviceId = device.deviceId;
await flutter('packages', options: <String>['get']);
if (deviceOperatingSystem == DeviceOperatingSystem.ios) {
if (deviceOperatingSystem == DeviceOperatingSystem.ios)
await prepareProvisioningCertificates(testDirectory);
// This causes an Xcode project to be created.
await flutter('build', options: <String>['ios', '--profile']);
}
await flutter('drive', options: <String>[
'-v',
......
......@@ -18,11 +18,8 @@ Future<TaskResult> runEndToEndTests() async {
await inDirectory(testDirectory, () async {
await flutter('packages', options: <String>['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: <String>['ios', 'lib/keyboard_resize.dart']);
}
await flutter('drive', options: <String>['-d', deviceId, '-t', 'lib/keyboard_resize.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<TaskResult> call() async {
return await inDirectory(testDirectory, () async {
final String deviceId = (await devices.workingDevice).deviceId;
await flutter('packages', options: <String>['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: <String>['ios', '--profile']);
}
await flutter('run', options: <String>[
'--verbose',
......@@ -141,11 +129,8 @@ class PerfTest {
final String deviceId = device.deviceId;
await flutter('packages', options: <String>['get']);
if (deviceOperatingSystem == DeviceOperatingSystem.ios) {
if (deviceOperatingSystem == DeviceOperatingSystem.ios)
await prepareProvisioningCertificates(testDirectory);
// This causes an Xcode project to be created.
await flutter('build', options: <String>['ios', '--profile']);
}
await flutter('drive', options: <String>[
'-v',
......@@ -280,11 +265,8 @@ class MemoryTest {
final String deviceId = device.deviceId;
await flutter('packages', options: <String>['get']);
if (deviceOperatingSystem == DeviceOperatingSystem.ios) {
if (deviceOperatingSystem == DeviceOperatingSystem.ios)
await prepareProvisioningCertificates(testDirectory);
// This causes an Xcode project to be created.
await flutter('build', options: <String>['ios', '--profile']);
}
final int observatoryPort = await findAvailablePort();
......
#include "Generated.xcconfig"
#include "TestConfig.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 @@
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 = "<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>"; };
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>"; };
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>"; };
......@@ -91,6 +91,7 @@
9740EEB11CF90186004384FC /* Flutter */,
97C146F01CF9000F007C117D /* Runner */,
97C146EF1CF9000F007C117D /* Products */,
CF3B75C9A7D2FA2A4C99F110 /* Frameworks */,
);
sourceTree = "<group>";
};
......@@ -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 = "<group>";
......@@ -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;
};
......
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