From 69802c4704adaded02a5e4e0542660db9882552a Mon Sep 17 00:00:00 2001 From: Hal Canary Date: Fri, 11 Jan 2019 16:27:35 -0500 Subject: SkQP: clean up make_universal_apk.py Now works better when mixing docker and non-docker builds. CQ_INCLUDE_TRYBOTS=skia.primary:Build-Debian9-Clang-x86-devrel-Android_SKQP Change-Id: I968a855ee9e6c9899aaf514d7a19a145bc818a28 Reviewed-on: https://skia-review.googlesource.com/c/183388 Reviewed-by: Hal Canary Commit-Queue: Hal Canary --- tools/skqp/make_universal_apk.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'tools') diff --git a/tools/skqp/make_universal_apk.py b/tools/skqp/make_universal_apk.py index d2a7a175db..8dd67d7bad 100755 --- a/tools/skqp/make_universal_apk.py +++ b/tools/skqp/make_universal_apk.py @@ -63,7 +63,7 @@ def check_ninja(): def remove(p): if not os.path.islink(p) and os.path.isdir(p): shutil.rmtree(p) - elif os.path.exists(p): + elif os.path.lexists(p): os.remove(p) assert not os.path.exists(p) @@ -84,6 +84,7 @@ def make_apk(architectures, assert os.path.exists(android_ndk) assert os.path.exists(android_home) assert os.path.exists(skia_dir) + assert os.path.exists(skia_dir + '/bin/gn') # Did you `tools/git-syc-deps`? assert architectures assert all(arch in skia_to_android_arch_name_map for arch in architectures) @@ -100,10 +101,8 @@ def make_apk(architectures, build_paths = [apps_dir + '/.gradle', apps_dir + '/skqp/build', apps_dir + '/skqp/src/main/libs', - apps_dir + '/skqp/src/main/assets/resources', apps_dir + '/skqp/src/main/assets/gmkb'] remove(build_dir + '/libs') - remove(build_dir + '/resources') for path in build_paths: remove(path) newdir = os.path.join(build_dir, os.path.basename(path)) @@ -114,6 +113,11 @@ def make_apk(architectures, except OSError: pass + resources_path = apps_dir + '/skqp/src/main/assets/resources' + remove(resources_path) + os.symlink('../../../../../../../resources', resources_path) + build_paths.append(resources_path) + app = 'skqp' lib = 'libskqp_app.so' @@ -125,8 +129,6 @@ def make_apk(architectures, sys.stderr.write( '\n* * *\n\nNote: SkQP models are missing!!!!\n\n* * *\n\n') - check_call([sys.executable, 'tools/skqp/setup_resources']) - for arch in architectures: build = os.path.join(build_dir, arch) gn_args = [android_ndk, '--arch', arch] -- cgit v1.2.3