change method to check for existance of the android ndk
This commit is contained in:
parent
8a4bb58bda
commit
8b912cd768
@ -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
|
||||
|
@ -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 {
|
||||
|
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user