diff --git a/packages/flutter_tools/lib/src/artifacts.dart b/packages/flutter_tools/lib/src/artifacts.dart index 24d97b7555b..e8309f64444 100644 --- a/packages/flutter_tools/lib/src/artifacts.dart +++ b/packages/flutter_tools/lib/src/artifacts.dart @@ -38,15 +38,16 @@ String _getNameForTargetPlatform(TargetPlatform platform) { } } -// Keep in sync with https://github.com/flutter/engine/blob/master/sky/tools/big_red_button.py#L50 +// Keep in sync with https://github.com/flutter/engine/blob/master/sky/tools/release_engine.py +// and https://github.com/flutter/buildbot/blob/master/travis/build.sh String _getCloudStorageBaseUrl({String category, String platform, String revision}) { - if (platform == 'darwin-x64') { + if (platform == 'android-arm') { // In the fullness of time, we'll have a consistent URL pattern for all of - // our artifacts, but, for the time being, darwin artifacts are stored in a + // our artifacts, but, for the time being, Android artifacts are stored in a // different cloud storage bucket. - return 'https://storage.googleapis.com/mojo_infra/flutter/${platform}/${revision}/'; + return 'https://storage.googleapis.com/mojo/sky/${category}/${platform}/${revision}/'; } - return 'https://storage.googleapis.com/mojo/sky/${category}/${platform}/${revision}/'; + return 'https://storage.googleapis.com/mojo_infra/flutter/${platform}/${revision}/'; } enum ArtifactType { diff --git a/packages/flutter_tools/lib/src/commands/start.dart b/packages/flutter_tools/lib/src/commands/start.dart index 2fb4701f426..d8515933730 100644 --- a/packages/flutter_tools/lib/src/commands/start.dart +++ b/packages/flutter_tools/lib/src/commands/start.dart @@ -16,8 +16,8 @@ import 'install.dart'; import 'stop.dart'; final Logger _logging = new Logger('sky_tools.start'); -const String _localBundlePath = 'app.flx'; -const bool _kUseServer = true; +const String _localBundleName = 'app.flx'; +const String _localSnapshotName = 'snapshot_blob.bin'; class StartCommand extends FlutterCommand { final String name = 'start'; @@ -37,7 +37,6 @@ class StartCommand extends FlutterCommand { help: 'Target app path or filename to start.'); argParser.addFlag('http', negatable: true, - defaultsTo: true, help: 'Use a local HTTP server to serve your app to your device.'); argParser.addFlag('boot', help: 'Boot the iOS Simulator if it isn\'t already running.'); @@ -79,9 +78,20 @@ class StartCommand extends FlutterCommand { mainPath = path.join(target, 'lib', 'main.dart'); BuildCommand builder = new BuildCommand(); builder.inheritFromParent(this); - await builder.build(outputPath: _localBundlePath, mainPath: mainPath); - if (device.startBundle(package, _localBundlePath, poke, argResults['checked'])) - startedSomething = true; + + Directory tempDir = await Directory.systemTemp.createTemp('flutter_tools'); + try { + String localBundlePath = path.join(tempDir.path, _localBundleName); + String localSnapshotPath = path.join(tempDir.path, _localSnapshotName); + await builder.build( + snapshotPath: localSnapshotPath, + outputPath: localBundlePath, + mainPath: mainPath); + if (device.startBundle(package, localBundlePath, poke, argResults['checked'])) + startedSomething = true; + } finally { + tempDir.deleteSync(recursive: true); + } } } else { if (await device.startApp(package)) diff --git a/packages/flutter_tools/test/start_test.dart b/packages/flutter_tools/test/start_test.dart index f9719c5e820..f3868ccffbb 100644 --- a/packages/flutter_tools/test/start_test.dart +++ b/packages/flutter_tools/test/start_test.dart @@ -21,7 +21,7 @@ defineTests() { when(mockDevices.android.isConnected()).thenReturn(true); when(mockDevices.android.isAppInstalled(any)).thenReturn(false); when(mockDevices.android.installApp(any)).thenReturn(true); - when(mockDevices.android.startServer(any, any, any, any)).thenReturn(true); + when(mockDevices.android.startBundle(any, any, any, any)).thenReturn(true); when(mockDevices.android.stopApp(any)).thenReturn(true); when(mockDevices.iOS.isConnected()).thenReturn(false); @@ -49,7 +49,7 @@ defineTests() { when(mockDevices.android.isConnected()).thenReturn(false); when(mockDevices.android.isAppInstalled(any)).thenReturn(false); when(mockDevices.android.installApp(any)).thenReturn(false); - when(mockDevices.android.startServer(any, any, any, any)).thenReturn(false); + when(mockDevices.android.startBundle(any, any, any, any)).thenReturn(false); when(mockDevices.android.stopApp(any)).thenReturn(false); when(mockDevices.iOS.isConnected()).thenReturn(true);