mirror of
https://github.com/flutter/flutter
synced 2024-10-13 03:32:55 +00:00
Enable --no-http by default
We still have the --http option as a fallback for now. Once we're confident the --no-http version works, we'll drop the --http support. Also, create the FLX in a temp directory and then delete the temp directory when we're done. Finally, pull the Linux artifacts from the cloud storage bucket that the buildbot is uploading to.
This commit is contained in:
parent
856f04bee2
commit
3804107e2d
|
@ -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 {
|
||||
|
|
|
@ -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))
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue