Android: Allow NDK location to be overridden
This commit is contained in:
parent
4042945ee5
commit
fff657a7da
|
@ -161,6 +161,14 @@ String getGitPath() {
|
|||
}
|
||||
|
||||
String getNdkPath() {
|
||||
def propsFile = rootProject.file("build.properties")
|
||||
def ndkPath = null
|
||||
if (propsFile.canRead()) {
|
||||
def buildProperties = new Properties()
|
||||
buildProperties.load(new FileInputStream(propsFile))
|
||||
ndkPath = buildProperties.ndkPath
|
||||
}
|
||||
if (ndkPath == null) {
|
||||
try {
|
||||
def stdout = new ByteArrayOutputStream()
|
||||
|
||||
|
@ -171,15 +179,15 @@ String getNdkPath() {
|
|||
}
|
||||
|
||||
def ndkCmdPath = stdout.toString()
|
||||
def ndkPath = ndkCmdPath.substring(0, ndkCmdPath.lastIndexOf('/'))
|
||||
|
||||
project.logger.quiet("Gradle: Found Android NDK:" + ndkPath)
|
||||
|
||||
return ndkPath
|
||||
ndkPath = ndkCmdPath.substring(0, ndkCmdPath.lastIndexOf('/'))
|
||||
} catch (ignored) {
|
||||
project.logger.error("Gradle error: Couldn't find NDK.")
|
||||
return null;
|
||||
}
|
||||
}
|
||||
if (ndkPath != null) {
|
||||
project.logger.quiet("Gradle: Found Android NDK: " + ndkPath)
|
||||
}
|
||||
return ndkPath
|
||||
}
|
||||
|
||||
String getAbi() {
|
||||
|
|
Loading…
Reference in New Issue