Upgrade Kotlin to 2.0.20

This upgrade allows us to use https://developer.android.com/develop/ui/compose/compiler as specified in https://developer.android.com/jetpack/androidx/releases/compose-kotlin#pre-release_kotlin_compatibility

kotlinOptions is considered deprecated in preference of kotlin.compilerOptions (https://kotlinlang.org/docs/gradle-compiler-options.html#how-to-define-options)

PiperOrigin-RevId: 725266131
This commit is contained in:
jbibik 2025-02-10 10:30:56 -08:00 committed by Copybara-Service
parent 1a996d87ca
commit d022b570f2
7 changed files with 22 additions and 19 deletions

View File

@ -3,6 +3,8 @@
### Unreleased changes
* Common Library:
* Upgrade Kotlin from 1.9.20 to 2.0.20 and use Compose Compiler Gradle
plugin. Upgrade KotlinX Coroutines library from 1.8.1 to 1.9.0.
* ExoPlayer:
* Transformer:
* Add `MediaProjectionAssetLoader`, which provides media from a

View File

@ -19,7 +19,8 @@ buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:8.3.2'
classpath 'com.google.android.gms:strict-version-matcher-plugin:1.2.4'
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.10'
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:2.0.20'
classpath 'org.jetbrains.kotlin:compose-compiler-gradle-plugin:2.0.20'
}
}
allprojects {

View File

@ -30,7 +30,8 @@ project.ext {
// https://cs.android.com/android/platform/superproject/main/+/main:external/guava/METADATA
guavaVersion = '33.3.1-android'
glideVersion = '4.14.2'
kotlinxCoroutinesVersion = '1.8.1'
// Not the same as kotlin version, https://github.com/Kotlin/kotlinx.coroutines/releases
kotlinxCoroutinesVersion = '1.9.0'
leakCanaryVersion = '2.10'
mockitoVersion = '3.12.4'
robolectricVersion = '4.14.1'

View File

@ -14,6 +14,7 @@
apply from: '../../constants.gradle'
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'org.jetbrains.kotlin.plugin.compose'
android {
namespace 'androidx.media3.demo.compose'
@ -54,9 +55,6 @@ android {
buildFeatures {
compose true
}
composeOptions {
kotlinCompilerExtensionVersion = "1.5.3"
}
testOptions {
unitTests {

View File

@ -14,6 +14,7 @@
apply from: '../../constants.gradle'
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'org.jetbrains.kotlin.plugin.compose'
android {
namespace 'androidx.media3.demo.effect'
@ -54,10 +55,6 @@ android {
buildFeatures {
compose true
}
composeOptions {
kotlinCompilerExtensionVersion = "1.5.3"
}
testOptions {
unitTests {
includeAndroidResources = true

View File

@ -12,6 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
apply from: "$gradle.ext.androidxMediaSettingsDir/common_library_config.gradle"
apply plugin: 'kotlin-android'
@ -33,9 +36,10 @@ android {
includeAndroidResources = true
}
}
kotlinOptions {
jvmTarget = '1.8'
kotlin {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_1_8)
}
}
}

View File

@ -12,8 +12,11 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
apply from: "$gradle.ext.androidxMediaSettingsDir/common_library_config.gradle"
apply plugin: 'kotlin-android'
apply plugin: 'org.jetbrains.kotlin.plugin.compose'
android {
namespace 'androidx.media3.ui.compose'
@ -36,13 +39,10 @@ android {
includeAndroidResources = true
}
}
kotlinOptions {
jvmTarget = '1.8'
}
// https://developer.android.com/jetpack/androidx/releases/compose-kotlin#pre-release_kotlin_compatibility
composeOptions {
kotlinCompilerExtensionVersion = "1.5.3"
kotlin {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_1_8)
}
}
}