Skip to content
Merged
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
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -611,11 +611,11 @@ jobs:
default: false
environment:
- ANDROID_HOME: "C:\\Android\\android-sdk"
- ANDROID_NDK: "C:\\Android\\android-sdk\\ndk\\19.2.5345600"
- ANDROID_NDK: "C:\\Android\\android-sdk\\ndk\\20.1.5948944"
- ANDROID_BUILD_VERSION: 28
- ANDROID_TOOLS_VERSION: 29.0.3
- GRADLE_OPTS: -Dorg.gradle.daemon=false
- NDK_VERSION: 19.2.5345600
- NDK_VERSION: 20.1.5948944
steps:
- checkout

Expand Down
18 changes: 10 additions & 8 deletions ReactAndroid/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -242,26 +242,28 @@ def getNdkBuildName() {
}

def findNdkBuildFullPath() {
// 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 @@ -377,7 +379,7 @@ task extractJNIFiles {

android {
compileSdkVersion 29

ndkVersion ANDROID_NDK_VERSION
compileOptions {
sourceCompatibility(JavaVersion.VERSION_1_8)
targetCompatibility(JavaVersion.VERSION_1_8)
Expand Down
5 changes: 5 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,9 @@ allprojects {
google()
jcenter()
}

// used to override ndk path on CI
if (System.getenv("LOCAL_ANDROID_NDK_VERSION") != null) {
setProperty("ANDROID_NDK_VERSION", System.getenv("LOCAL_ANDROID_NDK_VERSION"))
}
}
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
org.gradle.daemon=true
org.gradle.jvmargs=-Xmx4g -XX:MaxPermSize=2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
org.gradle.parallel=true

ANDROID_NDK_VERSION=20.1.5948944
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 @@ -127,7 +127,7 @@ def useIntlJsc = false

android {
compileSdkVersion 29

ndkVersion ANDROID_NDK_VERSION
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
Expand Down