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 {
} else {
// We've crashed; emit a log report.
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)
stderr.writeln('Oops; flutter has exited unexpectedly: "$error".');
else
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);
stderr.writeln(
......
......@@ -325,9 +325,8 @@ class AndroidDevice extends Device {
return runCommandAndStreamOutput(command).then((int exitCode) => exitCode == 0);
}
// TODO(devoncarew): Use isLocalEmulator to return android_arm or android_x64.
@override
TargetPlatform get platform => TargetPlatform.android_arm;
TargetPlatform get platform => isLocalEmulator ? TargetPlatform.android_x64 : TargetPlatform.android_arm;
@override
void clearLogs() {
......
......@@ -108,6 +108,7 @@ class ApplicationPackageStore {
ApplicationPackage getPackageForPlatform(TargetPlatform platform) {
switch (platform) {
case TargetPlatform.android_arm:
case TargetPlatform.android_x64:
return android;
case TargetPlatform.ios:
return iOS;
......@@ -124,6 +125,7 @@ class ApplicationPackageStore {
for (BuildConfiguration config in configs) {
switch (config.targetPlatform) {
case TargetPlatform.android_arm:
case TargetPlatform.android_x64:
android ??= new AndroidApk.fromBuildConfiguration(config);
break;
......
......@@ -23,6 +23,8 @@ String getNameForTargetPlatform(TargetPlatform platform) {
switch (platform) {
case TargetPlatform.android_arm:
return 'android-arm';
case TargetPlatform.android_x64:
return 'android-x64';
case TargetPlatform.ios:
return 'ios';
case TargetPlatform.darwin_x64:
......@@ -132,6 +134,32 @@ class ArtifactStore {
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
const Artifact._(
name: 'iOS Runner (Xcode Project)',
......
......@@ -21,6 +21,7 @@ enum HostPlatform {
enum TargetPlatform {
android_arm,
android_x64,
ios,
darwin_x64,
linux_x64
......
......@@ -209,15 +209,19 @@ class BuildApkCommand extends FlutterCommand {
}
Future<_ApkComponents> _findApkComponents(
BuildConfiguration config, String enginePath, String manifest, String resources
TargetPlatform platform,
BuildConfiguration config,
String enginePath,
String manifest,
String resources
) async {
List<String> artifactPaths;
if (enginePath != null) {
// TODO(devoncarew): Support x64.
String abiDir = platform == TargetPlatform.android_arm ? 'armeabi-v7a' : 'x86_64';
artifactPaths = [
'$enginePath/third_party/icu/android/icudtl.dat',
'${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',
];
} else {
......@@ -283,8 +287,7 @@ int _buildApk(
_AssetBuilder artifactBuilder = new _AssetBuilder(tempDir, 'artifacts');
artifactBuilder.add(classesDex, 'classes.dex');
// x86? x86_64?
String abiDir = platform == TargetPlatform.android_arm ? 'armeabi-v7a' : 'x86';
String abiDir = platform == TargetPlatform.android_arm ? 'armeabi-v7a' : 'x86_64';
artifactBuilder.add(components.libSkyShell, 'lib/$abiDir/libsky_shell.so');
File unalignedApk = new File('${tempDir.path}/app.apk.unaligned');
......@@ -413,7 +416,7 @@ Future<int> buildAndroid(
}
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) {
printError('Failure building APK. Unable to find components.');
......
......@@ -275,6 +275,11 @@ class FlutterCommandRunner extends CommandRunner {
targetPlatform: TargetPlatform.android_arm
));
configs.add(new BuildConfiguration.prebuilt(
hostPlatform: hostPlatform,
targetPlatform: TargetPlatform.android_x64
));
if (hostPlatform == HostPlatform.linux) {
configs.add(new BuildConfiguration.prebuilt(
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