fix(android): silence JVM + Kotlin annotation-target warnings
Two cleanups around the noise at the top of every CI log: * CI workflow: JAVA_TOOL_OPTIONS=--enable-native-access=ALL-UNNAMED at the workflow env level so both build + release jobs apply it to the launcher JVM (not just the daemon). The launcher is the one loading native-platform.jar via System.load. * Kotlin compiler: -Xannotation-default-target=param-property in kotlin.compilerOptions.freeCompilerArgs. Opts every @Inject / @ApplicationContext / @ApplicationScope constructor-parameter annotation into the future Kotlin 2.3 behavior (apply to both param AND property), clearing the 11 warnings on AuthController / AuthStore / MutationReplayer / SyncController / EventsStream / LiveEventsDispatcher / PlayEventsReporter / PlayerController / PlayerFactory / ResumeController. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -17,6 +17,15 @@ on:
|
||||
paths:
|
||||
- 'android/**'
|
||||
|
||||
env:
|
||||
# Silences the JDK 22+ "restricted method in java.lang.System has been
|
||||
# called" warning that Gradle 9.1's bundled native-platform jar trips
|
||||
# at launch (System.load for native primitives). Affects the LAUNCHER
|
||||
# JVM, not the daemon — that's why org.gradle.jvmargs in
|
||||
# gradle.properties isn't enough. Future-compat: required opt-in once
|
||||
# JDK 25 promotes the warning to an error.
|
||||
JAVA_TOOL_OPTIONS: "--enable-native-access=ALL-UNNAMED"
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build + lint + test
|
||||
|
||||
@@ -86,6 +86,14 @@ android {
|
||||
kotlin {
|
||||
compilerOptions {
|
||||
jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17)
|
||||
// Opt into the future Kotlin behavior: annotations on
|
||||
// constructor parameters apply to both the param AND the
|
||||
// generated property/field. Without this flag, Kotlin 2.x
|
||||
// emits a deprecation warning at every @Inject /
|
||||
// @ApplicationContext / @ApplicationScope constructor-
|
||||
// parameter use. Setting it now matches what becomes the
|
||||
// default in Kotlin 2.3 (KT-73255).
|
||||
freeCompilerArgs.add("-Xannotation-default-target=param-property")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user