mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
Search all the build configurations for sky_snapshot
Previously, we assumed the first build configuration would have one. Now we keep looking until we find one. Also, re-ordered the configurations so that you'll get the Android one if you have both, which is probably what you would expect. Fixes #100
This commit is contained in:
parent
aafce51e05
commit
7e8b111bcc
@ -195,19 +195,19 @@ class FlutterCommandRunner extends CommandRunner {
|
||||
configs.add(new BuildConfiguration.local(
|
||||
type: BuildType.debug,
|
||||
hostPlatform: hostPlatform,
|
||||
targetPlatform: hostPlatformAsTarget,
|
||||
targetPlatform: TargetPlatform.android,
|
||||
enginePath: enginePath,
|
||||
buildPath: globalResults['host-debug-build-path'],
|
||||
testable: true
|
||||
buildPath: globalResults['android-debug-build-path'],
|
||||
deviceId: globalResults['android-device-id']
|
||||
));
|
||||
|
||||
configs.add(new BuildConfiguration.local(
|
||||
type: BuildType.debug,
|
||||
hostPlatform: hostPlatform,
|
||||
targetPlatform: TargetPlatform.android,
|
||||
targetPlatform: hostPlatformAsTarget,
|
||||
enginePath: enginePath,
|
||||
buildPath: globalResults['android-debug-build-path'],
|
||||
deviceId: globalResults['android-device-id']
|
||||
buildPath: globalResults['host-debug-build-path'],
|
||||
testable: true
|
||||
));
|
||||
|
||||
if (Platform.isMacOS) {
|
||||
@ -233,19 +233,19 @@ class FlutterCommandRunner extends CommandRunner {
|
||||
configs.add(new BuildConfiguration.local(
|
||||
type: BuildType.release,
|
||||
hostPlatform: hostPlatform,
|
||||
targetPlatform: hostPlatformAsTarget,
|
||||
targetPlatform: TargetPlatform.android,
|
||||
enginePath: enginePath,
|
||||
buildPath: globalResults['host-release-build-path'],
|
||||
testable: true
|
||||
buildPath: globalResults['android-release-build-path'],
|
||||
deviceId: globalResults['android-device-id']
|
||||
));
|
||||
|
||||
configs.add(new BuildConfiguration.local(
|
||||
type: BuildType.release,
|
||||
hostPlatform: hostPlatform,
|
||||
targetPlatform: TargetPlatform.android,
|
||||
targetPlatform: hostPlatformAsTarget,
|
||||
enginePath: enginePath,
|
||||
buildPath: globalResults['android-release-build-path'],
|
||||
deviceId: globalResults['android-device-id']
|
||||
buildPath: globalResults['host-release-build-path'],
|
||||
testable: true
|
||||
));
|
||||
|
||||
if (Platform.isMacOS) {
|
||||
|
@ -3,6 +3,7 @@
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'dart:async';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:path/path.dart' as path;
|
||||
|
||||
@ -29,8 +30,12 @@ class Compiler {
|
||||
}
|
||||
|
||||
Future<String> _getCompilerPath(BuildConfiguration config) async {
|
||||
if (config.type != BuildType.prebuilt)
|
||||
return path.join(config.buildDir, 'clang_x64', 'sky_snapshot');
|
||||
if (config.type != BuildType.prebuilt) {
|
||||
String compilerPath = path.join(config.buildDir, 'clang_x64', 'sky_snapshot');
|
||||
if (FileSystemEntity.isFileSync(compilerPath))
|
||||
return compilerPath;
|
||||
return null;
|
||||
}
|
||||
Artifact artifact = ArtifactStore.getArtifact(
|
||||
type: ArtifactType.snapshot, hostPlatform: config.hostPlatform);
|
||||
return await ArtifactStore.getPath(artifact);
|
||||
@ -42,8 +47,11 @@ class Toolchain {
|
||||
final Compiler compiler;
|
||||
|
||||
static Future<Toolchain> forConfigs(List<BuildConfiguration> configs) async {
|
||||
// TODO(abarth): Shouldn't we consider all the configs?
|
||||
String compilerPath = await _getCompilerPath(configs.first);
|
||||
return new Toolchain(compiler: new Compiler(compilerPath));
|
||||
for (BuildConfiguration config in configs) {
|
||||
String compilerPath = await _getCompilerPath(config);
|
||||
if (compilerPath != null)
|
||||
return new Toolchain(compiler: new Compiler(compilerPath));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user