Skip to content

Commit 672f056

Browse files
NickGerlemanmeta-codesync[bot]
authored andcommitted
Update Yoga Android build to Gradle 9, AGP 8.12, SDK 36 (#1914)
Summary: Pull Request resolved: #1914 Aligns Yoga’s Android bindings with React Native’s current toolchain to ensure compatibility and reduce maintenance overhead. Removes deprecated Gradle APIs and build-scan config, and updates targets (`minSdk`, `Java/Kotlin`) to match modern Android and RN requirements. --- AI generated Summary & Test Plan from DEV99918839 Reviewed By: cortinico Differential Revision: D95672156 fbshipit-source-id: b2348168eafa3d0bfe30db7ec3dbdc16fccf2b8a
1 parent 8484a8c commit 672f056

5 files changed

Lines changed: 14 additions & 24 deletions

File tree

build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
*/
77

88
plugins {
9-
id("com.android.library") version "8.7.1" apply false
10-
id("com.android.application") version "8.7.1" apply false
11-
id("io.github.gradle-nexus.publish-plugin") version "1.3.0"
9+
id("com.android.library") version "8.12.0" apply false
10+
id("com.android.application") version "8.12.0" apply false
11+
id("io.github.gradle-nexus.publish-plugin") version "2.0.0"
1212
id 'org.jetbrains.kotlin.android' version '2.1.20' apply false
1313
}
1414

@@ -42,5 +42,5 @@ nexusPublishing {
4242
}
4343

4444
task clean(type: Delete) {
45-
delete rootProject.buildDir
45+
delete rootProject.layout.buildDirectory
4646
}

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99

1010
android.useAndroidX=true
1111

12-
org.gradle.jvmargs=-Xmx1536M
12+
org.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=1g -Dfile.encoding=UTF-8
1313

1414
VERSION_NAME=0.0.0

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.1-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

java/AndroidManifest.xml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,7 @@
77
LICENSE file in the root directory of this source tree.
88
-->
99

10-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
11-
package="com.facebook.yoga"
12-
android:versionCode="1"
13-
android:versionName="1.0"
14-
>
10+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
1511

1612
<application/>
1713

java/build.gradle.kts

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,10 @@ plugins {
1414

1515
group = "com.facebook.yoga"
1616

17-
val compileSdkVersionProperty: Int by rootProject.extra
18-
val minSdkVersionProperty: Int by rootProject.extra
19-
val targetSdkVersionProperty: Int by rootProject.extra
20-
val buildToolsVersionProperty: String by rootProject.extra
21-
val ndkVersionProperty: String by rootProject.extra
22-
2317
android {
2418
namespace = "com.facebook.yoga"
25-
compileSdk = 35
26-
buildToolsVersion = "35.0.0"
19+
compileSdk = 36
20+
buildToolsVersion = "36.0.0"
2721
ndkVersion = "27.1.12297006"
2822

2923
defaultConfig {
@@ -37,8 +31,8 @@ android {
3731
externalNativeBuild { cmake { path("CMakeLists.txt") } }
3832

3933
compileOptions {
40-
targetCompatibility(JavaVersion.VERSION_1_8)
41-
sourceCompatibility(JavaVersion.VERSION_1_8)
34+
targetCompatibility(JavaVersion.VERSION_17)
35+
sourceCompatibility(JavaVersion.VERSION_17)
4236
}
4337

4438
sourceSets {
@@ -49,7 +43,7 @@ android {
4943
}
5044
}
5145

52-
kotlinOptions { jvmTarget = "1.8" }
46+
kotlinOptions { jvmTarget = "17" }
5347

5448
publishing {
5549
multipleVariants {
@@ -62,9 +56,9 @@ android {
6256

6357
dependencies {
6458
implementation("com.google.code.findbugs:jsr305:3.0.2")
65-
implementation("com.facebook.soloader:soloader:0.10.5")
59+
implementation("com.facebook.soloader:soloader:0.12.1")
6660
implementation("androidx.core:core-ktx:1.16.0")
67-
testImplementation("junit:junit:4.12")
61+
testImplementation("junit:junit:4.13.2")
6862
}
6963

7064
version =

0 commit comments

Comments
 (0)