From c87fbf93d0c9329a1f14da55aa96a27547ae0df6 Mon Sep 17 00:00:00 2001 From: Hal Canary Date: Wed, 7 Feb 2018 14:56:29 -0500 Subject: Android Tools: build x86_64 correctly. - Fix some naming confusion between `x64` and `x86-64`. - SkQP Universal (multi-arch apk) Build Script [tools/skqp/make_universal_apk] - skqp/build.gradle: add `universal` product flavor - skqp manifest: make debug build optional. No-Try: true Change-Id: Ic8cd88719a34786ab2d53771749b2beb9db98be5 Reviewed-on: https://skia-review.googlesource.com/105023 Commit-Queue: Hal Canary Reviewed-by: Stephan Altmueller --- platform_tools/android/apps/build.gradle | 2 +- platform_tools/android/apps/skqp/build.gradle | 2 +- .../android/apps/skqp/src/main/AndroidManifest.xml | 3 +-- platform_tools/android/bin/android_build_app | 16 ++-------------- 4 files changed, 5 insertions(+), 18 deletions(-) (limited to 'platform_tools') diff --git a/platform_tools/android/apps/build.gradle b/platform_tools/android/apps/build.gradle index 0bf9461d7b..9f285e5b06 100644 --- a/platform_tools/android/apps/build.gradle +++ b/platform_tools/android/apps/build.gradle @@ -67,7 +67,7 @@ def getVariantOutDir(project, variant) { } else if (variant.name.startsWith("arm")) { variantPrefix = "arm" androidLibDir = "armeabi-v7a" - } else if (variant.name.startsWith("x86_64")) { + } else if (variant.name.startsWith("x64")) { variantPrefix = "x64" androidLibDir = "x86_64" } else if (variant.name.startsWith("x86")) { diff --git a/platform_tools/android/apps/skqp/build.gradle b/platform_tools/android/apps/skqp/build.gradle index 3ebfb76bf0..e368a66ef6 100644 --- a/platform_tools/android/apps/skqp/build.gradle +++ b/platform_tools/android/apps/skqp/build.gradle @@ -24,6 +24,6 @@ android { } sourceSets.main.jni.srcDirs = [] sourceSets.main.jniLibs.srcDir "src/main/libs" - productFlavors { arm {}; arm64 {}; x86 {}; x64 {}; arm64vulkan{}; } + productFlavors { universal{}; arm {}; arm64 {}; x86 {}; x64 {}; arm64vulkan{}; } setupSkiaLibraryBuild(project, applicationVariants, "libskqp_app") } diff --git a/platform_tools/android/apps/skqp/src/main/AndroidManifest.xml b/platform_tools/android/apps/skqp/src/main/AndroidManifest.xml index f39fddad56..0459522ad3 100644 --- a/platform_tools/android/apps/skqp/src/main/AndroidManifest.xml +++ b/platform_tools/android/apps/skqp/src/main/AndroidManifest.xml @@ -9,8 +9,7 @@ + android:label="SkQP"> diff --git a/platform_tools/android/bin/android_build_app b/platform_tools/android/bin/android_build_app index 5f47ff20a0..bee8cf508a 100755 --- a/platform_tools/android/bin/android_build_app +++ b/platform_tools/android/bin/android_build_app @@ -19,7 +19,6 @@ parser.add_argument('app_name') args = parser.parse_args() target_cpu = "arm64" -android_variant = "" android_buildtype = "debug" if args.output_dir == None: @@ -32,21 +31,10 @@ if os.path.exists(args_gn_path): if m: target_cpu = m.group(1) -if target_cpu == "arm": - android_variant = "arm" -elif target_cpu == "arm64": - android_variant = "arm64" -elif target_cpu == "x86": - android_variant = "x86" -elif target_cpu == "x64": - android_variant = "x86_64" -else: - sys.exit("unknown target_cpu") - # build the apk using gradle try: subprocess.check_call(['./apps/gradlew', - ':' + args.app_name + ':assemble' + android_variant + android_buildtype, + ':' + args.app_name + ':assemble' + target_cpu + android_buildtype, '-papps/' + args.app_name, '-P' + target_cpu + '.out.dir=' + os.path.abspath(args.output_dir), '--daemon'], cwd=os.path.join(os.path.dirname(__file__), "..")) @@ -57,6 +45,6 @@ except subprocess.CalledProcessError as error: # copy apk back into the main out directory current_dir = os.path.dirname(__file__) apk_src = os.path.join(current_dir, "..", "apps", args.app_name, "build", "outputs", "apk", - args.app_name + "-" + android_variant + "-" + android_buildtype + ".apk") + args.app_name + "-" + target_cpu + "-" + android_buildtype + ".apk") apk_dst = os.path.join(args.output_dir, args.app_name + ".apk") shutil.copyfile(apk_src, apk_dst) -- cgit v1.2.3