Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(104)

Unified Diff: platform_tools/android/apps/build.gradle

Issue 1921553009: Add CMake path to gradle (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: No Duplication Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | platform_tools/android/apps/vulkanviewer/build.gradle » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..40e085cf5f25c45681d118a81f5aeef511a6e9d3 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,18 @@ 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) {
+ String cmakePath = getSDKPath() + "/cmake/bin"
+ if (!file(cmakePath).exists()) {
+ throw new GradleScriptException("cmake not found! Please install the android SDK version" +
+ " of cmake.", null);
+ }
+ if (!path.contains(cmakePath)) {
+ path = cmakePath + ":" + path
+ }
+ }
+
return path
}
« no previous file with comments | « no previous file | platform_tools/android/apps/vulkanviewer/build.gradle » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698