Commit 003ecb67 authored by Adam Barth's avatar Adam Barth

Merge pull request #819 from abarth/travis_artifacts

Switch over to the Travis-built artifacts
parents 5cdfb2d7 2b6b781c
...@@ -40,11 +40,7 @@ String _getNameForTargetPlatform(TargetPlatform platform) { ...@@ -40,11 +40,7 @@ String _getNameForTargetPlatform(TargetPlatform platform) {
// Keep in sync with https://github.com/flutter/engine/blob/master/sky/tools/release_engine.py // 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 // and https://github.com/flutter/buildbot/blob/master/travis/build.sh
String _getCloudStorageBaseUrl({String platform, String revision}) { String _getCloudStorageBaseUrl({String platform, String revision}) {
// In the fullness of time, we'll have a consistent URL pattern for all of return 'https://storage.googleapis.com/mojo_infra/flutter/$revision/$platform/';
// our artifacts, but, for the time being, Mac OS X artifacts are stored in a
// different cloud storage bucket.
String bucket = (platform == 'darwin-x64') ? "mojo_infra" : "mojo";
return 'https://storage.googleapis.com/$bucket/flutter/$revision/$platform/';
} }
enum ArtifactType { enum ArtifactType {
......
...@@ -88,31 +88,30 @@ class RunMojoCommand extends FlutterCommand { ...@@ -88,31 +88,30 @@ class RunMojoCommand extends FlutterCommand {
args.add(command); args.add(command);
BuildConfiguration config = _getCurrentHostConfig(); BuildConfiguration config = _getCurrentHostConfig();
if (argResults['android']) {
args.add('--android');
final String appPath = _makePathAbsolute(bundlePath);
final String appName = path.basename(appPath);
final String appDir = path.dirname(appPath);
args.add('http://app/$appName');
args.add('--map-origin=http://app/=$appDir');
if (config == null || config.type == BuildType.prebuilt) {
final String cloudStorageBaseUrl = ArtifactStore.getCloudStorageBaseUrl('android-arm');
args.add('--map-origin=http://flutter/=$cloudStorageBaseUrl');
} else {
args.add('--map-origin=http://flutter/=${config.buildDir}');
}
args.add('--url-mappings=mojo:flutter=http://flutter/flutter.mojo');
} else {
final String appPath = _makePathAbsolute(bundlePath); final String appPath = _makePathAbsolute(bundlePath);
String flutterPath; String flutterPath;
if (config == null || config.type == BuildType.prebuilt) { if (config == null || config.type == BuildType.prebuilt) {
Artifact artifact = ArtifactStore.getArtifact(type: ArtifactType.mojo, targetPlatform: TargetPlatform.linux); TargetPlatform targetPlatform = argResults['android'] ? TargetPlatform.android : TargetPlatform.linux;
Artifact artifact = ArtifactStore.getArtifact(type: ArtifactType.mojo, targetPlatform: targetPlatform);
flutterPath = _makePathAbsolute(await ArtifactStore.getPath(artifact)); flutterPath = _makePathAbsolute(await ArtifactStore.getPath(artifact));
} else { } else {
String localPath = path.join(config.buildDir, 'flutter.mojo'); String localPath = path.join(config.buildDir, 'flutter.mojo');
flutterPath = _makePathAbsolute(localPath); flutterPath = _makePathAbsolute(localPath);
} }
if (argResults['android']) {
args.add('--android');
final String appName = path.basename(appPath);
final String appDir = path.dirname(appPath);
args.add('http://app/$appName');
args.add('--map-origin=http://app/=$appDir');
final String flutterName = path.basename(flutterPath);
final String flutterDir = path.dirname(flutterPath);
args.add('--map-origin=http://flutter/=$flutterDir');
args.add('--url-mappings=mojo:flutter=http://flutter/$flutterName');
} else {
args.add('file://$appPath'); args.add('file://$appPath');
args.add('--url-mappings=mojo:flutter=file://$flutterPath'); args.add('--url-mappings=mojo:flutter=file://$flutterPath');
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment