change method to check for existance of the android ndk

experimental
iwgeric 11 years ago
parent 8a4bb58bda
commit 8b912cd768
  1. 9
      build.gradle
  2. 4
      jme3-android-native/openalsoft.gradle
  3. 4
      jme3-android-native/stb_image.gradle

@ -116,8 +116,8 @@ String findNDK() {
} }
} }
boolean ndkExists() { boolean checkNdkExists(String ndkCommandPath) {
String ndkCommandPath = findNDK() // String ndkCommandPath = findNDK()
if (ndkCommandPath != null && new File(ndkCommandPath).exists()) { if (ndkCommandPath != null && new File(ndkCommandPath).exists()) {
return true return true
} else { } else {
@ -125,6 +125,11 @@ boolean ndkExists() {
} }
} }
ext {
ndkCommandPath = findNDK()
ndkExists = checkNdkExists(ndkCommandPath)
}
//class IncrementalReverseTask extends DefaultTask { //class IncrementalReverseTask extends DefaultTask {
// @InputDirectory // @InputDirectory
// def File inputDir // def File inputDir

@ -96,7 +96,7 @@ task buildOpenAlSoftNativeLib(type: Exec, dependsOn: generateOpenAlSoftHeaders)
// println "ndkCommandPath: " + project.ndkCommandPath // println "ndkCommandPath: " + project.ndkCommandPath
args 'TARGET_PLATFORM=android-9' args 'TARGET_PLATFORM=android-9'
workingDir openalsoftBuildDir workingDir openalsoftBuildDir
executable project.ndkCommandPath executable rootProject.ndkCommandPath
} }
task updatePreCompiledOpenAlSoftLibs(type: Copy, dependsOn: buildOpenAlSoftNativeLib) { task updatePreCompiledOpenAlSoftLibs(type: Copy, dependsOn: buildOpenAlSoftNativeLib) {
@ -121,7 +121,7 @@ task copyPreCompiledOpenAlSoftLibs(type: Copy) {
into outputDir into outputDir
} }
if (ndkExists()) { if (rootProject.ndkExists) {
// build native libs and update stored pre-compiled libs to commit // build native libs and update stored pre-compiled libs to commit
compileJava.dependsOn { updatePreCompiledOpenAlSoftLibs } compileJava.dependsOn { updatePreCompiledOpenAlSoftLibs }
} else { } else {

@ -76,7 +76,7 @@ task buildStbiNativeLib(type: Exec, dependsOn: generateStbiHeaders) {
// println "ndkCommandPath: " + project.ndkCommandPath // println "ndkCommandPath: " + project.ndkCommandPath
args 'TARGET_PLATFORM=android-9' args 'TARGET_PLATFORM=android-9'
workingDir stbiBuildDir workingDir stbiBuildDir
executable project.ndkCommandPath executable rootProject.ndkCommandPath
} }
task updatePreCompiledStbiLibs(type: Copy, dependsOn: buildStbiNativeLib) { task updatePreCompiledStbiLibs(type: Copy, dependsOn: buildStbiNativeLib) {
@ -100,7 +100,7 @@ task copyPreCompiledStbiLibs(type: Copy) {
into outputDir into outputDir
} }
if (ndkExists()) { if (rootProject.ndkExists) {
// build native libs and update stored pre-compiled libs to commit // build native libs and update stored pre-compiled libs to commit
compileJava.dependsOn { updatePreCompiledStbiLibs } compileJava.dependsOn { updatePreCompiledStbiLibs }
} else { } else {

Loading…
Cancel
Save