Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions ReactAndroid/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -247,26 +247,28 @@ def getNdkBuildName() {
}

def findNdkBuildFullPath() {
// we allow to provide full path to ndk-build tool
// android.ndkDirectory should return project.android.ndkVersion ndkDirectory
def ndkDir = android.ndkDirectory ? android.ndkDirectory.absolutePath : null
if (ndkDir) {
return new File(ndkDir, getNdkBuildName()).getAbsolutePath()
}

// we allow to provide full path to ndk-build tool
if (hasProperty("ndk.command")) {
return property("ndk.command")
}
// or just a path to the containing directory
if (hasProperty("ndk.path")) {
def ndkDir = property("ndk.path")
ndkDir = property("ndk.path")
return new File(ndkDir, getNdkBuildName()).getAbsolutePath()
}

// @TODO ANDROID_NDK && ndk.dir is deprecated and will be removed in the future.
if (System.getenv("ANDROID_NDK") != null) {
def ndkDir = System.getenv("ANDROID_NDK")
ndkDir = System.getenv("ANDROID_NDK")
return new File(ndkDir, getNdkBuildName()).getAbsolutePath()
}

def ndkDir = android.ndkDirectory ? android.ndkDirectory.absolutePath : null

if (ndkDir) {
return new File(ndkDir, getNdkBuildName()).getAbsolutePath()
}
return null
}

Expand Down Expand Up @@ -380,7 +382,7 @@ task extractJNIFiles {

android {
compileSdkVersion 29

ndkVersion "20.1.5948944"
compileOptions {
sourceCompatibility(JavaVersion.VERSION_1_8)
targetCompatibility(JavaVersion.VERSION_1_8)
Expand Down
2 changes: 1 addition & 1 deletion packages/rn-tester/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def useIntlJsc = false

android {
compileSdkVersion 29

ndkVersion "20.1.5948944"
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
Expand Down