diff --git a/packages/flutter_tools/lib/src/artifacts.dart b/packages/flutter_tools/lib/src/artifacts.dart index c0e49388f6..85a66c3dd0 100644 --- a/packages/flutter_tools/lib/src/artifacts.dart +++ b/packages/flutter_tools/lib/src/artifacts.dart @@ -56,7 +56,7 @@ String _getCloudStorageBaseUrl({String category, String platform, String revisio enum ArtifactType { snapshot, shell, - viewer, + mojo, } class Artifact { @@ -121,17 +121,17 @@ class ArtifactStore { hostPlatform: HostPlatform.mac ), const Artifact._( - name: 'Sky Viewer', - fileName: 'sky_viewer.mojo', - category: _kViewerCategory, - type: ArtifactType.viewer, + name: 'Flutter for Mojo', + fileName: 'flutter.mojo', + category: _kShellCategory, + type: ArtifactType.mojo, targetPlatform: TargetPlatform.android ), const Artifact._( - name: 'Sky Viewer', - fileName: 'sky_viewer.mojo', - category: _kViewerCategory, - type: ArtifactType.viewer, + name: 'Flutter for Mojo', + fileName: 'flutter.mojo', + category: _kShellCategory, + type: ArtifactType.mojo, targetPlatform: TargetPlatform.linux ), ]; diff --git a/packages/flutter_tools/lib/src/commands/run_mojo.dart b/packages/flutter_tools/lib/src/commands/run_mojo.dart index 4cd0301033..8688dd4428 100644 --- a/packages/flutter_tools/lib/src/commands/run_mojo.dart +++ b/packages/flutter_tools/lib/src/commands/run_mojo.dart @@ -73,39 +73,39 @@ class RunMojoCommand extends FlutterCommand { } Future> _getShellConfig() async { - List args = []; + List args = []; - final useDevtools = _useDevtools(); - final command = useDevtools ? _getDevtoolsPath() : _getMojoShellPath(); + final bool useDevtools = _useDevtools(); + final String command = useDevtools ? _getDevtoolsPath() : _getMojoShellPath(); args.add(command); if (argResults['android']) { args.add('--android'); - final skyViewerUrl = ArtifactStore.getCloudStorageBaseUrl('viewer', 'android-arm'); - final appPath = _makePathAbsolute(argResults['app']); - final appName = path.basename(appPath); - final appDir = path.dirname(appPath); + final String cloudStorageBaseUrl = ArtifactStore.getCloudStorageBaseUrl('shell', 'android-arm'); + final String appPath = _makePathAbsolute(argResults['app']); + final String appName = path.basename(appPath); + final String appDir = path.dirname(appPath); args.add('http://app/$appName'); args.add('--map-origin=http://app/=$appDir'); - args.add('--map-origin=http://sky_viewer/=$skyViewerUrl'); - args.add('--url-mappings=mojo:sky_viewer=http://sky_viewer/sky_viewer.mojo'); + args.add('--map-origin=http://flutter/=$cloudStorageBaseUrl'); + args.add('--url-mappings=mojo:flutter=http://flutter/flutter.mojo'); } else { - final appPath = _makePathAbsolute(argResults['app']); - String viewerPath; + final String appPath = _makePathAbsolute(argResults['app']); + String flutterPath; BuildConfiguration config = _getCurrentHostConfig(); - if (config.type == BuildType.prebuilt) { - Artifact artifact = ArtifactStore.getArtifact(type: ArtifactType.viewer, targetPlatform: TargetPlatform.linux); - viewerPath = _makePathAbsolute(await ArtifactStore.getPath(artifact)); + if (config == null || config.type == BuildType.prebuilt) { + Artifact artifact = ArtifactStore.getArtifact(type: ArtifactType.mojo, targetPlatform: TargetPlatform.linux); + flutterPath = _makePathAbsolute(await ArtifactStore.getPath(artifact)); } else { - String localPath = path.join(config.buildDir, 'sky_viewer.mojo'); - viewerPath = _makePathAbsolute(localPath); + String localPath = path.join(config.buildDir, 'flutter.mojo'); + flutterPath = _makePathAbsolute(localPath); } args.add('file://$appPath'); - args.add('--url-mappings=mojo:sky_viewer=file://$viewerPath'); + args.add('--url-mappings=mojo:flutter=file://$flutterPath'); } if (useDevtools) { - final buildFlag = argResults['mojo-debug'] ? '--debug' : '--release'; + final String buildFlag = argResults['mojo-debug'] ? '--debug' : '--release'; args.add(buildFlag); if (_logging.level <= Level.INFO) { args.add('--verbose'); @@ -116,7 +116,7 @@ class RunMojoCommand extends FlutterCommand { } if (argResults['checked']) { - args.add('--args-for=mojo:sky_viewer --enable-checked-mode'); + args.add('--args-for=mojo:flutter --enable-checked-mode'); } args.addAll(argResults.rest); diff --git a/packages/flx/lib/bundle.dart b/packages/flx/lib/bundle.dart index f5afe4492d..12da0825ff 100644 --- a/packages/flx/lib/bundle.dart +++ b/packages/flx/lib/bundle.dart @@ -12,7 +12,7 @@ import 'package:bignum/bignum.dart'; import 'signing.dart'; // Magic string we put at the top of all bundle files. -const String kBundleMagic = '#!mojo mojo:sky_viewer\n'; +const String kBundleMagic = '#!mojo mojo:flutter\n'; // Prefix of the above, used when reading bundle files. This allows us to be // more flexbile about what we accept. @@ -135,7 +135,7 @@ class Bundle { void writeSync() { assert(_contentBytes != null); RandomAccessFile outputFile = new File(path).openSync(mode: FileMode.WRITE); - outputFile.writeStringSync('#!mojo mojo:sky_viewer\n'); + outputFile.writeStringSync(kBundleMagic); _writeBytesWithLengthSync(outputFile, signatureBytes); _writeBytesWithLengthSync(outputFile, manifestBytes); outputFile.writeFromSync(_contentBytes);