diff --git a/bin/cache/engine.version b/bin/cache/engine.version index 4bdb9db5c0..3b4733abcc 100644 --- a/bin/cache/engine.version +++ b/bin/cache/engine.version @@ -1 +1 @@ -646500663e7db5deaab2d0a8a96ace2b29d0da27 +c358ddc8f81dc1a59d01bd50420c5fc979c28f19 diff --git a/bin/cache/update_engine.sh b/bin/cache/update_engine.sh index 23ebea5eb2..bf746ea380 100755 --- a/bin/cache/update_engine.sh +++ b/bin/cache/update_engine.sh @@ -61,6 +61,7 @@ if [ ! -f "$ENGINE_STAMP_PATH" ] || [ "$ENGINE_VERSION" != `cat "$ENGINE_STAMP_P Darwin) download_artifacts darwin-x64 chmod a+x "$ENGINE_ARTIFACT_PATH/darwin-x64/sky_snapshot" + download_artifacts ios ;; Linux) download_artifacts linux-x64 diff --git a/packages/flutter_tools/lib/src/artifacts.dart b/packages/flutter_tools/lib/src/artifacts.dart index 1794057f04..513f059160 100644 --- a/packages/flutter_tools/lib/src/artifacts.dart +++ b/packages/flutter_tools/lib/src/artifacts.dart @@ -42,6 +42,7 @@ enum ArtifactType { androidIcuData, androidKeystore, androidLibSkyShell, + iosXcodeProject, } class Artifact { @@ -125,6 +126,12 @@ class ArtifactStore { type: ArtifactType.androidLibSkyShell, targetPlatform: TargetPlatform.android_arm ), + const Artifact._( + name: 'iOS Runner (Xcode Project)', + fileName: 'FlutterXcode.zip', + type: ArtifactType.iosXcodeProject, + targetPlatform: TargetPlatform.ios + ), ]; static Artifact getArtifact({ diff --git a/packages/flutter_tools/lib/src/ios/setup_xcodeproj.dart b/packages/flutter_tools/lib/src/ios/setup_xcodeproj.dart index f9853b6771..1a657a1885 100644 --- a/packages/flutter_tools/lib/src/ios/setup_xcodeproj.dart +++ b/packages/flutter_tools/lib/src/ios/setup_xcodeproj.dart @@ -8,35 +8,11 @@ import 'dart:io'; import 'package:path/path.dart' as path; import '../artifacts.dart'; +import '../build_configuration.dart'; import '../base/process.dart'; import '../globals.dart'; import '../runner/flutter_command_runner.dart'; -Uri _xcodeProjectUri(String revision) { - String uriString = 'https://storage.googleapis.com/flutter_infra/flutter/$revision/ios/FlutterXcode.zip'; - return Uri.parse(uriString); -} - -Future> _fetchXcodeArchive() async { - printStatus('Fetching the Xcode project archive from the cloud...'); - - HttpClient client = new HttpClient(); - - Uri xcodeProjectUri = _xcodeProjectUri(ArtifactStore.engineRevision); - printStatus('Downloading $xcodeProjectUri...'); - HttpClientRequest request = await client.getUrl(xcodeProjectUri); - HttpClientResponse response = await request.close(); - - if (response.statusCode != 200) - throw new Exception(response.reasonPhrase); - - BytesBuilder bytesBuilder = new BytesBuilder(copy: false); - await for (List chunk in response) - bytesBuilder.add(chunk); - - return bytesBuilder.takeBytes(); -} - Future _inflateXcodeArchive(String directory, List archiveBytes) async { printStatus('Unzipping Xcode project to local directory...'); @@ -117,7 +93,14 @@ Future setupXcodeProjectHarness(String flutterProjectPath) async { // Step 1: Fetch the archive from the cloud String iosFilesPath = path.join(flutterProjectPath, 'ios'); String xcodeprojPath = path.join(iosFilesPath, '.generated'); - List archiveBytes = await _fetchXcodeArchive(); + + Artifact xcodeProject = ArtifactStore.getArtifact( + type: ArtifactType.iosXcodeProject, + targetPlatform: TargetPlatform.ios + ); + + String xcodeProjectPath = await ArtifactStore.getPath(xcodeProject); + List archiveBytes = await new File(xcodeProjectPath).readAsBytes(); if (archiveBytes.isEmpty) { printError('Error: No archive bytes received.');