Skip to content
Open
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
2 changes: 1 addition & 1 deletion apps/common-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"fuse.js": "patch:fuse.js@npm%3A7.1.0#~/.yarn/patches/fuse.js-npm-7.1.0-5dcae892a6.patch",
"react": "19.2.3",
"react-dom": "19.2.3",
"react-native-gesture-handler": "2.30.0",
"react-native-gesture-handler": "2.32.0",
"react-native-mmkv": "4.3.0",
"react-native-nitro-modules": "patch:react-native-nitro-modules@npm%3A0.35.2#~/.yarn/patches/react-native-nitro-modules-npm-0.35.2-717188fdb0.patch",
"react-native-reanimated": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion apps/fabric-example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ android {
// see https://reactnative.dev/docs/signed-apk-android.
signingConfig signingConfigs.debug
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"
}
}
}
Expand Down
5 changes: 5 additions & 0 deletions apps/fabric-example/android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,8 @@ enableWorkletsProfiling=true
# https://docs.gradle.org/current/userguide/configuration_cache.html
org.gradle.configuration-cache=true
org.gradle.configuration-cache.problems=fail

# Opt out of built-in kotlin and new DSL behavior that ships with AGP 9.
# Starting from AGP 10.x these opt outs will be removed.
android.builtInKotlin=false
android.newDsl=false
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
2 changes: 1 addition & 1 deletion docs/docs-reanimated/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"react-colorful": "5.6.1",
"react-dom": "19.1.1",
"react-native": "0.83.0",
"react-native-gesture-handler": "2.28.0",
"react-native-gesture-handler": "2.32.0",
"react-native-reanimated": "4.4.1",
"react-native-svg": "15.15.4",
"react-native-web": "0.21.2",
Expand Down
2 changes: 1 addition & 1 deletion docs/docs-worklets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"react-colorful": "5.6.1",
"react-dom": "19.1.1",
"react-native": "0.83.0",
"react-native-gesture-handler": "2.28.0",
"react-native-gesture-handler": "2.32.0",
"react-native-reanimated": "4.4.1",
"react-native-svg": "15.15.4",
"react-native-web": "0.21.2",
Expand Down
21 changes: 18 additions & 3 deletions packages/react-native-reanimated/android/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import groovy.json.JsonSlurper
import com.android.Version
import org.apache.tools.ant.taskdefs.condition.Os
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import java.util.Properties
import javax.inject.Inject

plugins {
id("com.android.library")
id("maven-publish")
id("com.diffplug.spotless") version "8.4.0"
id("org.jetbrains.kotlin.android")
}

fun safeExtGet(prop: String, fallback: Any?): Any? =
Expand Down Expand Up @@ -105,6 +106,20 @@ if (project != rootProject) {
apply(plugin = "com.facebook.react")
}

fun shouldEnableAgpFallback(): Boolean {
val agpMajorVersion = Version.ANDROID_GRADLE_PLUGIN_VERSION.substringBefore('.').toIntOrNull() ?: Int.MAX_VALUE
if (agpMajorVersion <= 8) {
return true
}

val isBuiltInKotlinEnabled = providers.gradleProperty("android.builtInKotlin").orNull?.toBooleanStrictOrNull() ?: true
return !isBuiltInKotlinEnabled
}

if (shouldEnableAgpFallback()) {
apply(plugin = "org.jetbrains.kotlin.android")
}

val packageDir: File = project.projectDir.parentFile
val reactNativeRootDir: File = resolveReactNativeDirectory()
val REACT_NATIVE_VERSION: String = getReactNativeVersion()
Expand Down Expand Up @@ -237,8 +252,8 @@ android {
}
}

if (project != rootProject) {
kotlin {
if (project != rootProject && shouldEnableAgpFallback()) {
tasks.withType<KotlinCompile>().configureEach {
compilerOptions {
jvmTarget = JvmTarget.fromTarget("17")
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pluginManagement {
resolutionStrategy {
eachPlugin {
if (requested.id.id.startsWith("com.android")) {
useModule("com.android.tools.build:gradle:8.13.1")
useModule("com.android.tools.build:gradle:9.2.1")
}
if (requested.id.id == "com.diffplug.spotless") {
useModule("com.diffplug.spotless:spotless-plugin-gradle:8.1.0")
Expand Down
27 changes: 21 additions & 6 deletions packages/react-native-worklets/android/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import groovy.json.JsonSlurper
import com.android.Version
import org.apache.tools.ant.taskdefs.condition.Os
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import java.util.Properties
import javax.inject.Inject

plugins {
id("com.android.library")
id("maven-publish")
id("com.diffplug.spotless") version "8.1.0"
id("org.jetbrains.kotlin.android")
}

fun safeExtGet(prop: String, fallback: Any?): Any? =
Expand Down Expand Up @@ -116,6 +117,20 @@ if (project != rootProject) {
apply(plugin = "com.facebook.react")
}

fun shouldEnableAgpFallback(): Boolean {
val agpMajorVersion = Version.ANDROID_GRADLE_PLUGIN_VERSION.substringBefore('.').toIntOrNull() ?: Int.MAX_VALUE
if (agpMajorVersion <= 8) {
return true
}

val isBuiltInKotlinEnabled = providers.gradleProperty("android.builtInKotlin").orNull?.toBooleanStrictOrNull() ?: true
return !isBuiltInKotlinEnabled
}

if (shouldEnableAgpFallback()) {
apply(plugin = "org.jetbrains.kotlin.android")
}

val featureFlags = getStaticFeatureFlags()

val packageDir: File = project.projectDir.parentFile
Expand Down Expand Up @@ -267,11 +282,11 @@ android {

sourceSets {
getByName("main") {
java {
kotlin {
if (FETCH_PREVIEW_ENABLED) {
srcDir("src/networking")
directories.add("src/networking")
} else {
srcDir("src/no-networking")
directories.add("src/no-networking")
}
}
}
Expand All @@ -282,8 +297,8 @@ android {
}
}

if (project != rootProject) {
kotlin {
if (project != rootProject && shouldEnableAgpFallback()) {
tasks.withType<KotlinCompile>().configureEach {
compilerOptions {
jvmTarget = JvmTarget.fromTarget("17")
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 1 addition & 1 deletion packages/react-native-worklets/android/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pluginManagement {
resolutionStrategy {
eachPlugin {
if (requested.id.id.startsWith("com.android")) {
useModule("com.android.tools.build:gradle:8.13.1")
useModule("com.android.tools.build:gradle:9.2.1")
}
if (requested.id.id == "com.diffplug.spotless") {
useModule("com.diffplug.spotless:spotless-plugin-gradle:8.1.0")
Expand Down
31 changes: 9 additions & 22 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9645,7 +9645,7 @@ __metadata:
languageName: node
linkType: hard

"@types/react-test-renderer@npm:19.1.0":
"@types/react-test-renderer@npm:19.1.0, @types/react-test-renderer@npm:^19.1.0":
version: 19.1.0
resolution: "@types/react-test-renderer@npm:19.1.0"
dependencies:
Expand Down Expand Up @@ -13901,7 +13901,7 @@ __metadata:
react: "npm:19.2.3"
react-dom: "npm:19.2.3"
react-native: "npm:0.85.2"
react-native-gesture-handler: "npm:2.30.0"
react-native-gesture-handler: "npm:2.32.0"
react-native-mmkv: "npm:4.3.0"
react-native-nitro-modules: "patch:react-native-nitro-modules@npm%3A0.35.2#~/.yarn/patches/react-native-nitro-modules-npm-0.35.2-717188fdb0.patch"
react-native-reanimated: "workspace:*"
Expand Down Expand Up @@ -15652,7 +15652,7 @@ __metadata:
react-colorful: "npm:5.6.1"
react-dom: "npm:19.1.1"
react-native: "npm:0.83.0"
react-native-gesture-handler: "npm:2.28.0"
react-native-gesture-handler: "npm:2.32.0"
react-native-reanimated: "npm:4.4.1"
react-native-svg: "npm:15.15.4"
react-native-web: "npm:0.21.2"
Expand Down Expand Up @@ -15717,7 +15717,7 @@ __metadata:
react-colorful: "npm:5.6.1"
react-dom: "npm:19.1.1"
react-native: "npm:0.83.0"
react-native-gesture-handler: "npm:2.28.0"
react-native-gesture-handler: "npm:2.32.0"
react-native-reanimated: "npm:4.4.1"
react-native-svg: "npm:15.15.4"
react-native-web: "npm:0.21.2"
Expand Down Expand Up @@ -27951,31 +27951,18 @@ __metadata:
languageName: node
linkType: hard

"react-native-gesture-handler@npm:2.28.0":
version: 2.28.0
resolution: "react-native-gesture-handler@npm:2.28.0"
dependencies:
"@egjs/hammerjs": "npm:^2.0.17"
hoist-non-react-statics: "npm:^3.3.0"
invariant: "npm:^2.2.4"
peerDependencies:
react: "*"
react-native: "*"
checksum: 10/856a9cb50b467e5e21cdd50930be68fee20f1c8ea13caa3cabb0bebd1345d0a847cd7b761a39b2d42b986b9d8e82e9419ccaf481b17373233c7ece7fed08dc70
languageName: node
linkType: hard

"react-native-gesture-handler@npm:2.30.0":
version: 2.30.0
resolution: "react-native-gesture-handler@npm:2.30.0"
"react-native-gesture-handler@npm:2.32.0":
version: 2.32.0
resolution: "react-native-gesture-handler@npm:2.32.0"
dependencies:
"@egjs/hammerjs": "npm:^2.0.17"
"@types/react-test-renderer": "npm:^19.1.0"
hoist-non-react-statics: "npm:^3.3.0"
invariant: "npm:^2.2.4"
peerDependencies:
react: "*"
react-native: "*"
checksum: 10/242b1eb29202bc9fc7bf0271c3da102559adc9f2810441465b6d78c1a8ed8f65bdd91335957c841a4716f796be3e7b87d1d55629d6803ea12e1be832d89c946c
checksum: 10/b43d350fd281ed9f75a469873a1eb74ae7cfa3d3e15dc7e57b11c0da5702a107b2824e1a9115386d9812e1179e86ccb952d6617cecbdbb26097d7c186088210f
languageName: node
linkType: hard

Expand Down