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
2 changes: 1 addition & 1 deletion packages/gradle-plugin/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ gson = "2.8.9"
guava = "31.0.1-jre"
javapoet = "1.13.0"
junit = "4.13.2"
kotlin = "1.9.24"
kotlin = "2.0.21"
assertj = "3.25.1"

[libraries]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
*/

import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
Expand Down Expand Up @@ -60,10 +62,10 @@ java { targetCompatibility = JavaVersion.VERSION_11 }
kotlin { jvmToolchain(17) }

tasks.withType<KotlinCompile>().configureEach {
kotlinOptions {
apiVersion = "1.6"
compilerOptions {
apiVersion.set(KotlinVersion.KOTLIN_1_7)
// See comment above on JDK 11 support
jvmTarget = "11"
jvmTarget.set(JvmTarget.JVM_11)
allWarningsAsErrors =
project.properties["enableWarningsAsErrors"]?.toString()?.toBoolean() ?: false
}
Expand Down
8 changes: 5 additions & 3 deletions packages/gradle-plugin/settings-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
*/

import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
Expand Down Expand Up @@ -50,10 +52,10 @@ java { targetCompatibility = JavaVersion.VERSION_11 }
kotlin { jvmToolchain(17) }

tasks.withType<KotlinCompile>().configureEach {
kotlinOptions {
apiVersion = "1.6"
compilerOptions {
apiVersion.set(KotlinVersion.KOTLIN_1_7)
// See comment above on JDK 11 support
jvmTarget = "11"
jvmTarget.set(JvmTarget.JVM_11)
allWarningsAsErrors =
project.properties["enableWarningsAsErrors"]?.toString()?.toBoolean() ?: false
}
Expand Down
9 changes: 6 additions & 3 deletions packages/gradle-plugin/shared-testutil/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
*/

import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins { alias(libs.plugins.kotlin.jvm) }
Expand All @@ -21,9 +23,10 @@ java { targetCompatibility = JavaVersion.VERSION_11 }
kotlin { jvmToolchain(17) }

tasks.withType<KotlinCompile>().configureEach {
kotlinOptions {
apiVersion = "1.6"
jvmTarget = "11"
compilerOptions {
apiVersion.set(KotlinVersion.KOTLIN_1_7)
// See comment above on JDK 11 support
jvmTarget.set(JvmTarget.JVM_11)
allWarningsAsErrors =
project.properties["enableWarningsAsErrors"]?.toString()?.toBoolean() ?: false
}
Expand Down
9 changes: 6 additions & 3 deletions packages/gradle-plugin/shared/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
*/

import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins { alias(libs.plugins.kotlin.jvm) }
Expand All @@ -27,9 +29,10 @@ java { targetCompatibility = JavaVersion.VERSION_11 }
kotlin { jvmToolchain(17) }

tasks.withType<KotlinCompile>().configureEach {
kotlinOptions {
apiVersion = "1.6"
jvmTarget = "11"
compilerOptions {
apiVersion.set(KotlinVersion.KOTLIN_1_7)
// See comment above on JDK 11 support
jvmTarget.set(JvmTarget.JVM_11)
allWarningsAsErrors =
project.properties["enableWarningsAsErrors"]?.toString()?.toBoolean() ?: false
}
Expand Down
2 changes: 1 addition & 1 deletion packages/helloworld/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ buildscript {
compileSdkVersion = 35
targetSdkVersion = 34
ndkVersion = "26.1.10909125"
kotlinVersion = "1.9.24"
kotlinVersion = "2.0.21"
}
repositories {
google()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ internal class SampleNativeComponentViewManager :
}
}

@Deprecated("Deprecated in Java")
@SuppressLint("BadMethodUse-android.view.View.setBackgroundColor")
@Suppress("DEPRECATION") // We intentionally want to test against the legacy API here.
override fun receiveCommand(view: SampleNativeView, commandId: Int, args: ReadableArray?) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ internal class EventAnimationDriver(
private val eventPath: List<String>,
@JvmField internal var valueNode: ValueAnimatedNode
) : RCTModernEventEmitter {
@Deprecated("Deprecated in Java")
override fun receiveEvent(targetReactTag: Int, eventName: String, event: WritableMap?) =
receiveEvent(-1, targetReactTag, eventName, event)

Expand All @@ -36,6 +37,7 @@ internal class EventAnimationDriver(
// We assume this event can't be coalesced. `customCoalesceKey` has no meaning in Fabric.
receiveEvent(surfaceId, targetTag, eventName, false, 0, event, EventCategoryDef.UNSPECIFIED)

@Deprecated("Deprecated in Java")
override fun receiveTouches(
eventName: String,
touches: WritableArray,
Expand All @@ -44,6 +46,7 @@ internal class EventAnimationDriver(
throw UnsupportedOperationException("receiveTouches is not support by native animated events")
}

@Deprecated("Deprecated in Java")
override fun receiveTouches(touchEvent: TouchEvent) {
throw UnsupportedOperationException("receiveTouches is not support by native animated events")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import com.facebook.react.R
* be triggered through the developers option menu displayed by [DevSupportManager].
*/
public class DevSettingsActivity : PreferenceActivity() {

@Deprecated("Deprecated in Java")
public override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
title = application.resources.getString(R.string.catalyst_settings_title)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import com.facebook.react.uimanager.events.TouchEvent
import com.facebook.systrace.Systrace

public class FabricEventEmitter(private val uiManager: FabricUIManager) : RCTModernEventEmitter {
@Deprecated("Deprecated in Java")
public override fun receiveEvent(reactTag: Int, eventName: String, params: WritableMap?): Unit {
receiveEvent(ViewUtil.NO_SURFACE_ID, reactTag, eventName, params)
}
Expand Down Expand Up @@ -49,6 +50,7 @@ public class FabricEventEmitter(private val uiManager: FabricUIManager) : RCTMod
}

/** Touches are dispatched by [.receiveTouches] */
@Deprecated("Deprecated in Java")
public override fun receiveTouches(
eventName: String,
touches: WritableArray,
Expand All @@ -57,6 +59,7 @@ public class FabricEventEmitter(private val uiManager: FabricUIManager) : RCTMod
throw UnsupportedOperationException("EventEmitter#receiveTouches is not supported by Fabric")
}

@Deprecated("Deprecated in Java")
public override fun receiveTouches(event: TouchEvent): Unit {
// Calls are expected to go via TouchesHelper
throw UnsupportedOperationException("EventEmitter#receiveTouches is not supported by Fabric")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public class InteropEventEmitter(private val reactContext: ReactContext) : RCTEv
dispatcher?.dispatchEvent(InteropEvent(eventName, eventData, surfaceId, targetReactTag))
}

@Deprecated("Deprecated in Java")
override fun receiveTouches(
eventName: String,
touches: WritableArray,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,12 @@ public class BridgelessCatalystInstance(private val reactHost: ReactHostImpl) :
override fun <T : JavaScriptModule> getJSModule(jsInterface: Class<T>): T? =
reactHost.currentReactContext?.getJSModule(jsInterface)

@get:Deprecated("Deprecated in Java")
override public val javaScriptContextHolder: JavaScriptContextHolder
get() = reactHost.getJavaScriptContextHolder()!!

@Suppress("INAPPLICABLE_JVM_NAME")
@get:Deprecated("Deprecated in Java")
@get:JvmName("getJSCallInvokerHolder") // This is needed to keep backward compatibility
override public val jsCallInvokerHolder: CallInvokerHolder
get() = reactHost.getJSCallInvokerHolder()!!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ internal class InsetBoxShadowDrawable(
invalidateSelf()
}

@Deprecated("Deprecated in Java")
override fun getOpacity(): Int {
val alpha = Color.alpha(shadowColor)
return if (alpha == 0) PixelFormat.TRANSPARENT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ internal class OutlineDrawable(
invalidateSelf()
}

@Deprecated("Deprecated in Java")
override fun getOpacity(): Int =
((outlinePaint.alpha / 255f) / (Color.alpha(outlineColor) / 255f) * 255f).roundToInt()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ internal class OutsetBoxShadowDrawable(
invalidateSelf()
}

@Deprecated("Deprecated in Java")
override fun getOpacity(): Int {
val alpha = Color.alpha(shadowColor)
return if (alpha == 0) PixelFormat.TRANSPARENT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public class BlackHoleEventDispatcher private constructor() : EventDispatcher {
listener: BatchEventDispatchedListener
): Unit = Unit

@Deprecated("Deprecated in Java")
@Suppress("DEPRECATION")
public override fun registerEventEmitter(
uiManagerType: Int,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ public class TouchEvent private constructor() : Event<TouchEvent>() {

override fun getCoalescingKey(): Short = coalescingKey

@Deprecated("Deprecated in Java")
override fun dispatch(rctEventEmitter: RCTEventEmitter) {
if (verifyMotionEvent()) {
TouchesHelper.sendTouchesLegacy(rctEventEmitter, this)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ internal open class ReactImageDownloadListener<INFO> :

override fun setColorFilter(colorFilter: ColorFilter?) = Unit

override fun getOpacity(): Int = PixelFormat.OPAQUE
@Deprecated("Deprecated in Java") override fun getOpacity(): Int = PixelFormat.OPAQUE
}

companion object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ import com.facebook.react.uimanager.events.RCTEventEmitter
@UnstableReactNativeAPI
class FakeRCTEventEmitter : RCTEventEmitter {

@Deprecated("Deprecated in Java")
override fun receiveEvent(targetReactTag: Int, eventName: String, event: WritableMap?) = Unit

@Deprecated("Deprecated in Java")
override fun receiveTouches(
eventName: String,
touches: WritableArray,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class FakeEventDispatcher : EventDispatcher {

override fun removeBatchEventDispatchedListener(listener: BatchEventDispatchedListener) = Unit

@Deprecated("Deprecated in Java")
override fun registerEventEmitter(uiManagerType: Int, eventEmitter: RCTEventEmitter) = Unit

override fun registerEventEmitter(uiManagerType: Int, eventEmitter: RCTModernEventEmitter) = Unit
Expand Down
2 changes: 1 addition & 1 deletion packages/react-native/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ javax-annotation-api = "1.3.2"
javax-inject = "1"
jsr305 = "3.0.2"
junit = "4.13.2"
kotlin = "1.9.24"
kotlin = "2.0.21"
mockito = "3.12.4"
nexus-publish = "1.3.0"
okhttp = "4.9.2"
Expand Down
2 changes: 1 addition & 1 deletion packages/rn-tester/android/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ tasks.withType<JavaCompile>().configureEach {
}

tasks.withType<KotlinCompile>().configureEach {
kotlinOptions {
compilerOptions {
allWarningsAsErrors =
project.properties["enableWarningsAsErrors"]?.toString()?.toBoolean() ?: false
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ internal class MyLegacyViewManager(reactContext: ReactApplicationContext) :
}
}

@Deprecated("Deprecated in Java")
@Suppress("DEPRECATION") // We intentionally want to test against the legacy API here.
override fun receiveCommand(view: MyNativeView, commandId: Int, args: ReadableArray?) {
when (commandId) {
Expand Down