add method to find the android ndk build executable in a common way for all sub projects that need to build a native android lib

experimental
iwgeric 11 years ago
parent ac68202a0f
commit a0ccd9984c
  1. 20
      build.gradle

@ -96,6 +96,26 @@ task wrapper(type: Wrapper, description: 'Creates and deploys the Gradle wrapper
gradleVersion = '1.11' gradleVersion = '1.11'
} }
String findNDK() {
def ndkBuildFile = "ndk-build"
// if windows, use ndk-build.cmd instead
if (System.properties['os.name'].toLowerCase().contains('windows')) {
ndkBuildFile = "ndk-build.cmd"
}
// ndkPath is defined in the root project gradle.properties file
String ndkBuildPath = ndkPath + File.separator + ndkBuildFile
//Use the environment variable for the NDK location if defined
if (System.env.ANDROID_NDK != null) {
ndkBuildPath = System.env.ANDROID_NDK + File.separator + ndkBuildFile
}
if (new File(ndkBuildPath).exists()) {
return ndkBuildPath
} else {
return null
}
}
//class IncrementalReverseTask extends DefaultTask { //class IncrementalReverseTask extends DefaultTask {
// @InputDirectory // @InputDirectory
// def File inputDir // def File inputDir

Loading…
Cancel
Save