Index: platform_tools/android/apps/build.gradle |
diff --git a/platform_tools/android/apps/build.gradle b/platform_tools/android/apps/build.gradle |
index 7622cbdca3560c86573144dd83e5640aa778936c..6319a84241df26fa0e301da612733a55aa822757 100644 |
--- a/platform_tools/android/apps/build.gradle |
+++ b/platform_tools/android/apps/build.gradle |
@@ -19,12 +19,12 @@ allprojects { |
} |
} |
-def setupSkiaLibraryBuild(project, appVariants, buildCmd) { |
+def setupSkiaLibraryBuild(project, appVariants, buildCmd, requireCMake = false) { |
appVariants.all{ variant -> |
def buildNativeLib = project.task("${variant.name}_SkiaNativeLib", type:Exec) { |
workingDir '../../../..' // top-level skia directory |
commandLine constructBuildCommand(variant, buildCmd).split() |
- environment PATH: getPathWithDepotTools() |
+ environment PATH: getPathWithDeps(requireCMake) |
environment ANDROID_SDK_ROOT: getSDKPath() |
} |
buildNativeLib.onlyIf { !project.hasProperty("suppressNativeBuild") } |
@@ -63,8 +63,7 @@ def getSDKPath() { |
return path |
} |
-def getPathWithDepotTools() { |
- System.getenv("PATH") + ":" + getLocalProperties().getProperty('depot_tools.dir', null) |
+def getPathWithDeps(requireCMake = false) { |
String path = System.getenv("PATH") |
if (!path.contains("depot_tools")) { |
path += ":" + getLocalProperties().getProperty('depot_tools.dir', null) |
@@ -74,6 +73,12 @@ def getPathWithDepotTools() { |
throw GradleScriptException("Depot Tools not found! Please update your path to include" + |
" depot_tools or define depot_tools.dir in gradle.properties") |
} |
+ |
+ if (requireCMake && !path.contains("cmake")) { |
djsollen
2016/04/29 19:30:07
check that getSDKPath() + "/cmake/bin" exists beca
|
+ path += ":" + getSDKPath() + "/cmake/bin" |
djsollen
2016/04/29 19:30:07
prepend this to the path since we need to pick the
|
+ // No need to check and throw exception here because getSDKPath() already did that. |
djsollen
2016/04/29 19:30:07
we should throw an exception if they don't have th
|
+ } |
+ |
return path |
} |