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 <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
This commit is contained in:
Hal Canary 2019-01-11 16:27:35 -05:00 committed by Skia Commit-Bot
parent a6854de5d8
commit 69802c4704

View File

@ -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]