Update flutter_tools for the "unoptimized" engine build flag and the new output directory naming scheme (#3832)
This commit is contained in:
parent
6e48824991
commit
6ab77622e4
@ -101,13 +101,13 @@ class FlutterCommandRunner extends CommandRunner {
|
||||
help:
|
||||
'Path to your Android Debug out directory, if you are building Flutter locally.\n'
|
||||
'This path is relative to --engine-src-path. Not normally required.',
|
||||
defaultsTo: 'out/android_Debug/');
|
||||
defaultsTo: 'out/android_debug_unopt/');
|
||||
argParser.addOption('android-release-build-path',
|
||||
hide: !verboseHelp,
|
||||
help:
|
||||
'Path to your Android Release out directory, if you are building Flutter locally.\n'
|
||||
'This path is relative to --engine-src-path. Not normally required.',
|
||||
defaultsTo: 'out/android_Release/');
|
||||
defaultsTo: 'out/android_debug/');
|
||||
argParser.addOption('ios-debug-build-path',
|
||||
hide: !verboseHelp,
|
||||
help:
|
||||
|
@ -98,34 +98,7 @@ class ToolConfiguration {
|
||||
/// The engine mode to use (only relevent when [engineSrcPath] is set).
|
||||
bool engineRelease;
|
||||
|
||||
/// Used to override the directory calculated from engineSrcPath (--engine-out-dir).
|
||||
String engineOutDir;
|
||||
|
||||
bool get isLocalEngine => engineSrcPath != null || engineOutDir != null;
|
||||
|
||||
String get _modeStr => engineRelease ? 'Release' : 'Debug';
|
||||
|
||||
/// The directory that contains development tools for the given platform. This
|
||||
/// includes things like `sky_shell` and `sky_snapshot`.
|
||||
///
|
||||
/// If [platform] is not specified it defaults to [getCurrentHostPlatform].
|
||||
Directory getToolsDirectory({ HostPlatform platform }) {
|
||||
Directory dir = _getToolsDirectory(platform: platform);
|
||||
if (dir != null)
|
||||
printTrace('Using engine tools dir: ${dir.path}');
|
||||
return dir;
|
||||
}
|
||||
|
||||
Directory _getToolsDirectory({ HostPlatform platform }) {
|
||||
platform ??= getCurrentHostPlatform();
|
||||
|
||||
if (engineSrcPath != null) {
|
||||
return new Directory(path.join(engineSrcPath, 'out/$_modeStr'));
|
||||
} else {
|
||||
Directory engineDir = _cache.getArtifactDirectory('engine');
|
||||
return new Directory(path.join(engineDir.path, getNameForHostPlatform(platform)));
|
||||
}
|
||||
}
|
||||
bool get isLocalEngine => engineSrcPath != null;
|
||||
|
||||
/// Return the directory that contains engine artifacts for the given targets.
|
||||
/// This directory might contain artifacts like `libsky_shell.so`.
|
||||
@ -137,47 +110,46 @@ class ToolConfiguration {
|
||||
}
|
||||
|
||||
Directory _getEngineArtifactsDirectory(TargetPlatform platform, BuildMode mode) {
|
||||
if (engineOutDir != null) {
|
||||
return new Directory(engineOutDir);
|
||||
} else if (engineSrcPath != null) {
|
||||
String type;
|
||||
if (engineSrcPath != null) {
|
||||
List<String> buildDir = <String>[];
|
||||
|
||||
switch (platform) {
|
||||
case TargetPlatform.android_arm:
|
||||
case TargetPlatform.android_x64:
|
||||
case TargetPlatform.android_x86:
|
||||
type = 'android';
|
||||
buildDir.add('android');
|
||||
break;
|
||||
|
||||
// TODO(devoncarew): We will need an ios vs ios_x86 target (for ios vs. ios_sim).
|
||||
case TargetPlatform.ios:
|
||||
type = 'ios';
|
||||
buildDir.add('ios');
|
||||
break;
|
||||
|
||||
// These targets don't have engine artifacts.
|
||||
case TargetPlatform.darwin_x64:
|
||||
case TargetPlatform.linux_x64:
|
||||
return null;
|
||||
buildDir.add('host');
|
||||
break;
|
||||
}
|
||||
|
||||
// Return something like 'out/android_Release'.
|
||||
String buildOutputPath = 'out/${type}_$_modeStr';
|
||||
if (isAotBuildMode(mode))
|
||||
buildOutputPath += '_Deploy';
|
||||
buildDir.add(getModeName(mode));
|
||||
|
||||
if (!engineRelease)
|
||||
buildDir.add('unopt');
|
||||
|
||||
// Add a suffix for the target architecture.
|
||||
switch (platform) {
|
||||
case TargetPlatform.android_x64:
|
||||
buildOutputPath += '_x64';
|
||||
buildDir.add('x64');
|
||||
break;
|
||||
case TargetPlatform.android_x86:
|
||||
buildOutputPath += '_x86';
|
||||
buildDir.add('x86');
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return new Directory(path.join(engineSrcPath, buildOutputPath));
|
||||
return new Directory(path.join(engineSrcPath, 'out', buildDir.join('_')));
|
||||
} else {
|
||||
String suffix = mode != BuildMode.debug ? '-${getModeName(mode)}' : '';
|
||||
|
||||
|
@ -28,10 +28,6 @@ void main() {
|
||||
overrideCache: new Cache(rootOverride: tempDir)
|
||||
);
|
||||
|
||||
expect(
|
||||
toolConfig.getToolsDirectory(platform: HostPlatform.linux_x64).path,
|
||||
endsWith('cache/artifacts/engine/linux-x64')
|
||||
);
|
||||
expect(
|
||||
toolConfig.getEngineArtifactsDirectory(TargetPlatform.android_arm, BuildMode.debug).path,
|
||||
endsWith('cache/artifacts/engine/android-arm')
|
||||
@ -47,19 +43,9 @@ void main() {
|
||||
toolConfig.engineSrcPath = 'engine';
|
||||
toolConfig.engineRelease = true;
|
||||
|
||||
expect(
|
||||
toolConfig.getToolsDirectory(platform: HostPlatform.linux_x64).path,
|
||||
'engine/out/Release'
|
||||
);
|
||||
expect(
|
||||
toolConfig.getEngineArtifactsDirectory(TargetPlatform.android_arm, BuildMode.debug).path,
|
||||
'engine/out/android_Release'
|
||||
);
|
||||
|
||||
toolConfig.engineRelease = false;
|
||||
expect(
|
||||
toolConfig.getToolsDirectory(platform: HostPlatform.linux_x64).path,
|
||||
'engine/out/Debug'
|
||||
'engine/out/android_debug'
|
||||
);
|
||||
});
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user