Keep provisioning step (#10736)
This commit is contained in:
committed by
GitHub
parent
bd67926f84
commit
4b957bf028
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user