Commit 1311ae6f authored by Devon Carew's avatar Devon Carew

add a target for android-x64 (#3224)

* add a target for android-x64

* update armeabi-v7a to x86_64
parent 2115f987
...@@ -100,15 +100,17 @@ Future<Null> main(List<String> args) async { ...@@ -100,15 +100,17 @@ Future<Null> main(List<String> args) async {
} else { } else {
// We've crashed; emit a log report. // We've crashed; emit a log report.
stderr.writeln(); stderr.writeln();
if (Platform.environment.containsKey('FLUTTER_DEV')) {
// If we're working on the tools themselves, just print the stack trace.
stderr.writeln('$error');
stderr.writeln(chain.terse.toString());
} else {
if (error is String) if (error is String)
stderr.writeln('Oops; flutter has exited unexpectedly: "$error".'); stderr.writeln('Oops; flutter has exited unexpectedly: "$error".');
else else
stderr.writeln('Oops; flutter has exited unexpectedly.'); stderr.writeln('Oops; flutter has exited unexpectedly.');
if (Platform.environment.containsKey('FLUTTER_DEV')) {
// If we're working in the tools themselves, just print the stack trace.
stderr.writeln(chain.terse.toString());
} else {
File file = _createCrashReport(args, error, chain); File file = _createCrashReport(args, error, chain);
stderr.writeln( stderr.writeln(
......
...@@ -325,9 +325,8 @@ class AndroidDevice extends Device { ...@@ -325,9 +325,8 @@ class AndroidDevice extends Device {
return runCommandAndStreamOutput(command).then((int exitCode) => exitCode == 0); return runCommandAndStreamOutput(command).then((int exitCode) => exitCode == 0);
} }
// TODO(devoncarew): Use isLocalEmulator to return android_arm or android_x64.
@override @override
TargetPlatform get platform => TargetPlatform.android_arm; TargetPlatform get platform => isLocalEmulator ? TargetPlatform.android_x64 : TargetPlatform.android_arm;
@override @override
void clearLogs() { void clearLogs() {
......
...@@ -108,6 +108,7 @@ class ApplicationPackageStore { ...@@ -108,6 +108,7 @@ class ApplicationPackageStore {
ApplicationPackage getPackageForPlatform(TargetPlatform platform) { ApplicationPackage getPackageForPlatform(TargetPlatform platform) {
switch (platform) { switch (platform) {
case TargetPlatform.android_arm: case TargetPlatform.android_arm:
case TargetPlatform.android_x64:
return android; return android;
case TargetPlatform.ios: case TargetPlatform.ios:
return iOS; return iOS;
...@@ -124,6 +125,7 @@ class ApplicationPackageStore { ...@@ -124,6 +125,7 @@ class ApplicationPackageStore {
for (BuildConfiguration config in configs) { for (BuildConfiguration config in configs) {
switch (config.targetPlatform) { switch (config.targetPlatform) {
case TargetPlatform.android_arm: case TargetPlatform.android_arm:
case TargetPlatform.android_x64:
android ??= new AndroidApk.fromBuildConfiguration(config); android ??= new AndroidApk.fromBuildConfiguration(config);
break; break;
......
...@@ -23,6 +23,8 @@ String getNameForTargetPlatform(TargetPlatform platform) { ...@@ -23,6 +23,8 @@ String getNameForTargetPlatform(TargetPlatform platform) {
switch (platform) { switch (platform) {
case TargetPlatform.android_arm: case TargetPlatform.android_arm:
return 'android-arm'; return 'android-arm';
case TargetPlatform.android_x64:
return 'android-x64';
case TargetPlatform.ios: case TargetPlatform.ios:
return 'ios'; return 'ios';
case TargetPlatform.darwin_x64: case TargetPlatform.darwin_x64:
...@@ -132,6 +134,32 @@ class ArtifactStore { ...@@ -132,6 +134,32 @@ class ArtifactStore {
targetPlatform: TargetPlatform.android_arm targetPlatform: TargetPlatform.android_arm
), ),
// android-x86
const Artifact._(
name: 'Compiled Java code',
fileName: 'classes.dex.jar',
type: ArtifactType.androidClassesJar,
targetPlatform: TargetPlatform.android_x64
),
const Artifact._(
name: 'ICU data table',
fileName: 'icudtl.dat',
type: ArtifactType.androidIcuData,
targetPlatform: TargetPlatform.android_x64
),
const Artifact._(
name: 'Key Store',
fileName: 'chromium-debug.keystore',
type: ArtifactType.androidKeystore,
targetPlatform: TargetPlatform.android_x64
),
const Artifact._(
name: 'Compiled C++ code',
fileName: 'libsky_shell.so',
type: ArtifactType.androidLibSkyShell,
targetPlatform: TargetPlatform.android_x64
),
// iOS // iOS
const Artifact._( const Artifact._(
name: 'iOS Runner (Xcode Project)', name: 'iOS Runner (Xcode Project)',
......
...@@ -21,6 +21,7 @@ enum HostPlatform { ...@@ -21,6 +21,7 @@ enum HostPlatform {
enum TargetPlatform { enum TargetPlatform {
android_arm, android_arm,
android_x64,
ios, ios,
darwin_x64, darwin_x64,
linux_x64 linux_x64
......
...@@ -209,15 +209,19 @@ class BuildApkCommand extends FlutterCommand { ...@@ -209,15 +209,19 @@ class BuildApkCommand extends FlutterCommand {
} }
Future<_ApkComponents> _findApkComponents( Future<_ApkComponents> _findApkComponents(
BuildConfiguration config, String enginePath, String manifest, String resources TargetPlatform platform,
BuildConfiguration config,
String enginePath,
String manifest,
String resources
) async { ) async {
List<String> artifactPaths; List<String> artifactPaths;
if (enginePath != null) { if (enginePath != null) {
// TODO(devoncarew): Support x64. String abiDir = platform == TargetPlatform.android_arm ? 'armeabi-v7a' : 'x86_64';
artifactPaths = [ artifactPaths = [
'$enginePath/third_party/icu/android/icudtl.dat', '$enginePath/third_party/icu/android/icudtl.dat',
'${config.buildDir}/gen/sky/shell/shell/classes.dex.jar', '${config.buildDir}/gen/sky/shell/shell/classes.dex.jar',
'${config.buildDir}/gen/sky/shell/shell/shell/libs/armeabi-v7a/libsky_shell.so', '${config.buildDir}/gen/sky/shell/shell/shell/libs/$abiDir/libsky_shell.so',
'$enginePath/build/android/ant/chromium-debug.keystore', '$enginePath/build/android/ant/chromium-debug.keystore',
]; ];
} else { } else {
...@@ -283,8 +287,7 @@ int _buildApk( ...@@ -283,8 +287,7 @@ int _buildApk(
_AssetBuilder artifactBuilder = new _AssetBuilder(tempDir, 'artifacts'); _AssetBuilder artifactBuilder = new _AssetBuilder(tempDir, 'artifacts');
artifactBuilder.add(classesDex, 'classes.dex'); artifactBuilder.add(classesDex, 'classes.dex');
// x86? x86_64? String abiDir = platform == TargetPlatform.android_arm ? 'armeabi-v7a' : 'x86_64';
String abiDir = platform == TargetPlatform.android_arm ? 'armeabi-v7a' : 'x86';
artifactBuilder.add(components.libSkyShell, 'lib/$abiDir/libsky_shell.so'); artifactBuilder.add(components.libSkyShell, 'lib/$abiDir/libsky_shell.so');
File unalignedApk = new File('${tempDir.path}/app.apk.unaligned'); File unalignedApk = new File('${tempDir.path}/app.apk.unaligned');
...@@ -413,7 +416,7 @@ Future<int> buildAndroid( ...@@ -413,7 +416,7 @@ Future<int> buildAndroid(
} }
BuildConfiguration config = configs.firstWhere((BuildConfiguration bc) => bc.targetPlatform == platform); BuildConfiguration config = configs.firstWhere((BuildConfiguration bc) => bc.targetPlatform == platform);
_ApkComponents components = await _findApkComponents(config, enginePath, manifest, resources); _ApkComponents components = await _findApkComponents(platform, config, enginePath, manifest, resources);
if (components == null) { if (components == null) {
printError('Failure building APK. Unable to find components.'); printError('Failure building APK. Unable to find components.');
......
...@@ -275,6 +275,11 @@ class FlutterCommandRunner extends CommandRunner { ...@@ -275,6 +275,11 @@ class FlutterCommandRunner extends CommandRunner {
targetPlatform: TargetPlatform.android_arm targetPlatform: TargetPlatform.android_arm
)); ));
configs.add(new BuildConfiguration.prebuilt(
hostPlatform: hostPlatform,
targetPlatform: TargetPlatform.android_x64
));
if (hostPlatform == HostPlatform.linux) { if (hostPlatform == HostPlatform.linux) {
configs.add(new BuildConfiguration.prebuilt( configs.add(new BuildConfiguration.prebuilt(
hostPlatform: HostPlatform.linux, hostPlatform: HostPlatform.linux,
......
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