Преглед изворни кода

change method to check for existance of the android ndk

iwgeric пре 11 година
родитељ
комит
8b912cd768
3 измењених фајлова са 11 додато и 6 уклоњено
  1. 7 2
      build.gradle
  2. 2 2
      jme3-android-native/openalsoft.gradle
  3. 2 2
      jme3-android-native/stb_image.gradle

+ 7 - 2
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

+ 2 - 2
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 {

+ 2 - 2
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 {