Skip to content

Instantly share code, notes, and snippets.

@donnfelker
Last active January 12, 2024 17:49
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save donnfelker/6f56c823512b6746bee0 to your computer and use it in GitHub Desktop.
Save donnfelker/6f56c823512b6746bee0 to your computer and use it in GitHub Desktop.
gradle properties in Android Studio
// Other build stuff
task ndkBuild(type:Exec) {
if(androidNdkPath != null) {
def ndkBuild = new File(androidNdkPath, 'ndk-build')
commandLine ndkBuild
} else {
// do something else
}
}
# file goes in ~/.gradle/gradle.properties
androidNdkPath=/path/to/your/ndk
// Other build stuff
task ndkBuild(type:Exec) {
if (System.env.ANDROID_NDK_HOME != null) {
def ndkBuild = new File(System.env.ANDROID_NDK_HOME, 'ndk-build')
commandLine ndkBuild
} else if(androidNdkPath != null) {
def ndkBuild = new File(androidNdkPath, 'ndk-build')
commandLine ndkBuild
} else {
commandLine 'ndk-build'
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment