Updates to viewer gradle scripts

BUG=skia:

Change-Id: Ib847e5ae89d2ac3f496507f69f82f5bac4914f36
Reviewed-on: https://skia-review.googlesource.com/8133
Reviewed-by: Chris Dalton <csmartdalton@google.com>
This commit is contained in:
Greg Daniel 2017-02-07 13:46:27 -05:00 committed by Derek Sollenberger
parent 8b8c76506a
commit 23145a3c5c
2 changed files with 7 additions and 5 deletions

View File

@ -28,8 +28,10 @@ def setupSkiaLibraryBuild(project, appVariants, appName) {
buildNativeLib.onlyIf { !project.hasProperty("suppressNativeBuild") } buildNativeLib.onlyIf { !project.hasProperty("suppressNativeBuild") }
def copyNativeLib = project.task("${variant.name}_CopySkiaLib", type:Copy) { def copyNativeLib = project.task("${variant.name}_CopySkiaLib", type:Copy) {
from getVariantOutDir(project, variant).skiaOut def fromDir = "../../../../" + getVariantOutDir(project, variant).skiaOut
into getVariantOutDir(project, variant).androidOut def intoDir = getVariantOutDir(project, variant).androidOut
from fromDir
into intoDir
include "${appName}.so" include "${appName}.so"
} }
@ -38,7 +40,7 @@ def setupSkiaLibraryBuild(project, appVariants, appName) {
it.name.toLowerCase().contains("compile" + variant.name.toLowerCase()) && it.name.toLowerCase().contains("compile" + variant.name.toLowerCase()) &&
it.name.toLowerCase().endsWith("ndk") it.name.toLowerCase().endsWith("ndk")
} }
compileTask.getAt(0).dependsOn copyNativeLib compileTask.findAll()*.dependsOn copyNativeLib
copyNativeLib.dependsOn buildNativeLib copyNativeLib.dependsOn buildNativeLib
} }
} }

View File

@ -28,7 +28,7 @@ if args.output_dir == None:
args_gn_path = os.path.join(args.output_dir, "args.gn") args_gn_path = os.path.join(args.output_dir, "args.gn")
if os.path.exists(args_gn_path): if os.path.exists(args_gn_path):
for line in open(args_gn_path): for line in open(args_gn_path):
m = re.match('target_cpu = "(.*)"', line.strip()) m = re.match('target_cpu ?= ?"(.*)"', line.strip())
if m: if m:
target_cpu = m.group(1) target_cpu = m.group(1)
@ -52,7 +52,7 @@ try:
subprocess.check_call(['./apps/gradlew', subprocess.check_call(['./apps/gradlew',
':viewer:assemble' + android_variant + android_buildtype, ':viewer:assemble' + android_variant + android_buildtype,
'-papps/' + args.app_name, '-papps/' + args.app_name,
'-P' + target_cpu + 'out.dir=' + args.output_dir, '-P' + target_cpu + '.out.dir=' + args.output_dir,
'--daemon'], cwd=os.path.join(os.path.dirname(__file__), "..")) '--daemon'], cwd=os.path.join(os.path.dirname(__file__), ".."))
except subprocess.CalledProcessError as error: except subprocess.CalledProcessError as error:
print error print error