diff --git a/dev/devicelab/lib/framework/ios.dart b/dev/devicelab/lib/framework/ios.dart index b3b68cfdca..28f726316c 100644 --- a/dev/devicelab/lib/framework/ios.dart +++ b/dev/devicelab/lib/framework/ios.dart @@ -9,6 +9,8 @@ import 'package:file/file.dart'; import 'package:file/local.dart' as io; import 'package:path/path.dart' as path; +import 'utils.dart'; + const String _kProvisioningConfigFileEnvironmentVariable = 'FLUTTER_DEVICELAB_XCODE_PROVISIONING_CONFIG'; const String _kTestXcconfigFileName = 'TestConfig.xcconfig'; const FileSystem _fs = const io.LocalFileSystem(); @@ -23,6 +25,11 @@ Future prepareProvisioningCertificates(String flutterProjectPath) async { await testXcconfig.writeAsString(certificateConfig); } +Future runPodInstallForCustomPodfile(String flutterProjectPath) async { + final String iosPath = path.join(flutterProjectPath, 'ios'); + exec('pod', ['install', '--project-directory=$iosPath']); +} + Future _patchXcconfigFilesIfNotPatched(String flutterProjectPath) async { final List xcconfigFiles = [ _fs.file(path.join(flutterProjectPath, 'ios/Flutter/Flutter.xcconfig')), diff --git a/dev/devicelab/lib/tasks/perf_tests.dart b/dev/devicelab/lib/tasks/perf_tests.dart index 4cf7f53e4d..1754b0c8ed 100644 --- a/dev/devicelab/lib/tasks/perf_tests.dart +++ b/dev/devicelab/lib/tasks/perf_tests.dart @@ -72,6 +72,9 @@ 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, ); } @@ -79,10 +82,14 @@ TaskFunction createFlutterViewStartupTest() { class StartupTest { static const Duration _startupTimeout = const Duration(minutes: 5); - StartupTest(this.testDirectory, { this.reportMetrics: true }); + StartupTest(this.testDirectory, { this.reportMetrics: true, this.runPodInstall: false }); 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 { @@ -90,6 +97,8 @@ class StartupTest { await flutter('packages', options: ['get']); if (deviceOperatingSystem == DeviceOperatingSystem.ios) { + if (runPodInstall) + await runPodInstallForCustomPodfile(testDirectory); await prepareProvisioningCertificates(testDirectory); // This causes an Xcode project to be created. await flutter('build', options: ['ios', '--profile']); diff --git a/examples/flutter_view/ios/Podfile.lock b/examples/flutter_view/ios/Podfile.lock deleted file mode 100644 index 55767e1c13..0000000000 --- a/examples/flutter_view/ios/Podfile.lock +++ /dev/null @@ -1,3 +0,0 @@ -PODFILE CHECKSUM: 638dc8f58cade4b6f922e82e3c1008f507581efd - -COCOAPODS: 1.2.0 diff --git a/examples/flutter_view/ios/Runner.xcodeproj/project.pbxproj b/examples/flutter_view/ios/Runner.xcodeproj/project.pbxproj index 37a465e6f4..b7aa0bf66e 100644 --- a/examples/flutter_view/ios/Runner.xcodeproj/project.pbxproj +++ b/examples/flutter_view/ios/Runner.xcodeproj/project.pbxproj @@ -161,14 +161,11 @@ isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( - AB1344B0443C71CD721E1BB7 /* [CP] Check Pods Manifest.lock */, 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, 97C146EC1CF9000F007C117D /* Resources */, 9705A1C41CF9048500538489 /* Embed Frameworks */, - 95BB15E9E1769C0D146AA592 /* [CP] Embed Pods Frameworks */, - 532EA9D341340B1DCD08293D /* [CP] Copy Pods Resources */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, ); buildRules = ( @@ -246,36 +243,6 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin"; }; - 532EA9D341340B1DCD08293D /* [CP] Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "[CP] Copy Pods Resources"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; - 95BB15E9E1769C0D146AA592 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "[CP] Embed Pods Frameworks"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -290,21 +257,6 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; }; - AB1344B0443C71CD721E1BB7 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "[CP] Check Pods Manifest.lock"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; - showEnvVarsInLog = 0; - }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */