From 8b912cd768487bfc0a1b13d0299e917330ae7950 Mon Sep 17 00:00:00 2001 From: iwgeric Date: Fri, 28 Mar 2014 08:15:10 -0400 Subject: [PATCH] change method to check for existance of the android ndk --- build.gradle | 9 +++++++-- jme3-android-native/openalsoft.gradle | 4 ++-- jme3-android-native/stb_image.gradle | 4 ++-- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/build.gradle b/build.gradle index 1cb069a56..52c71cee7 100644 --- a/build.gradle +++ b/build.gradle @@ -116,8 +116,8 @@ String findNDK() { } } -boolean ndkExists() { - String ndkCommandPath = findNDK() +boolean checkNdkExists(String ndkCommandPath) { +// String ndkCommandPath = findNDK() if (ndkCommandPath != null && new File(ndkCommandPath).exists()) { return true } else { @@ -125,6 +125,11 @@ boolean ndkExists() { } } +ext { + ndkCommandPath = findNDK() + ndkExists = checkNdkExists(ndkCommandPath) +} + //class IncrementalReverseTask extends DefaultTask { // @InputDirectory // def File inputDir diff --git a/jme3-android-native/openalsoft.gradle b/jme3-android-native/openalsoft.gradle index d5e302bae..1027f44ef 100644 --- a/jme3-android-native/openalsoft.gradle +++ b/jme3-android-native/openalsoft.gradle @@ -96,7 +96,7 @@ task buildOpenAlSoftNativeLib(type: Exec, dependsOn: generateOpenAlSoftHeaders) // println "ndkCommandPath: " + project.ndkCommandPath args 'TARGET_PLATFORM=android-9' workingDir openalsoftBuildDir - executable project.ndkCommandPath + executable rootProject.ndkCommandPath } task updatePreCompiledOpenAlSoftLibs(type: Copy, dependsOn: buildOpenAlSoftNativeLib) { @@ -121,7 +121,7 @@ task copyPreCompiledOpenAlSoftLibs(type: Copy) { into outputDir } -if (ndkExists()) { +if (rootProject.ndkExists) { // build native libs and update stored pre-compiled libs to commit compileJava.dependsOn { updatePreCompiledOpenAlSoftLibs } } else { diff --git a/jme3-android-native/stb_image.gradle b/jme3-android-native/stb_image.gradle index e4784e621..e5a0c3af7 100644 --- a/jme3-android-native/stb_image.gradle +++ b/jme3-android-native/stb_image.gradle @@ -76,7 +76,7 @@ task buildStbiNativeLib(type: Exec, dependsOn: generateStbiHeaders) { // println "ndkCommandPath: " + project.ndkCommandPath args 'TARGET_PLATFORM=android-9' workingDir stbiBuildDir - executable project.ndkCommandPath + executable rootProject.ndkCommandPath } task updatePreCompiledStbiLibs(type: Copy, dependsOn: buildStbiNativeLib) { @@ -100,7 +100,7 @@ task copyPreCompiledStbiLibs(type: Copy) { into outputDir } -if (ndkExists()) { +if (rootProject.ndkExists) { // build native libs and update stored pre-compiled libs to commit compileJava.dependsOn { updatePreCompiledStbiLibs } } else {