From 16df05ec298ea2dc7d757605c88f707544d4abfb Mon Sep 17 00:00:00 2001 From: tonihei Date: Tue, 7 May 2024 04:18:42 -0700 Subject: [PATCH] Upgrade Gradle and AGP The newer versions include a bugfix that automatically highlights when our project requires enhanced Java 8 desugaring. Issue: androidx/media#1312 PiperOrigin-RevId: 631373018 --- build.gradle | 2 +- demos/cast/build.gradle | 4 +++- demos/compose/build.gradle | 5 ++++- demos/gl/build.gradle | 4 +++- demos/main/build.gradle | 6 ++++-- demos/session/build.gradle | 4 +++- demos/session_automotive/build.gradle | 4 +++- demos/session_service/build.gradle | 2 +- demos/shortform/build.gradle | 4 +++- demos/surface/build.gradle | 4 +++- demos/transformer/build.gradle | 4 ++-- gradle/wrapper/gradle-wrapper.properties | 2 +- libraries/test_session_current/build.gradle | 2 +- 13 files changed, 32 insertions(+), 15 deletions(-) diff --git a/build.gradle b/build.gradle index 8f2a92ca82..c3243831df 100644 --- a/build.gradle +++ b/build.gradle @@ -17,7 +17,7 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:8.0.1' + 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.0' } diff --git a/demos/cast/build.gradle b/demos/cast/build.gradle index 7f41b8e0be..4fb1177a59 100644 --- a/demos/cast/build.gradle +++ b/demos/cast/build.gradle @@ -17,9 +17,10 @@ apply plugin: 'com.android.application' android { namespace 'androidx.media3.demo.cast' - compileSdkVersion project.ext.compileSdkVersion + compileSdk project.ext.compileSdkVersion compileOptions { + coreLibraryDesugaringEnabled true sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } @@ -65,6 +66,7 @@ dependencies { implementation 'androidx.multidex:multidex:' + androidxMultidexVersion implementation 'androidx.recyclerview:recyclerview:' + androidxRecyclerViewVersion implementation 'com.google.android.material:material:' + androidxMaterialVersion + coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5' } apply plugin: 'com.google.android.gms.strict-version-matcher-plugin' diff --git a/demos/compose/build.gradle b/demos/compose/build.gradle index e1e3393675..0a778ffa03 100644 --- a/demos/compose/build.gradle +++ b/demos/compose/build.gradle @@ -18,9 +18,10 @@ apply plugin: 'kotlin-android' android { namespace 'androidx.media3.demo.compose' - compileSdkVersion project.ext.compileSdkVersion + compileSdk project.ext.compileSdkVersion compileOptions { + coreLibraryDesugaringEnabled true sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } @@ -73,4 +74,6 @@ dependencies { // For detecting and debugging leaks only. LeakCanary is not needed for demo app to work. debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.10' + + coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5' } diff --git a/demos/gl/build.gradle b/demos/gl/build.gradle index d66c72cf4e..fac5b80155 100644 --- a/demos/gl/build.gradle +++ b/demos/gl/build.gradle @@ -17,9 +17,10 @@ apply plugin: 'com.android.application' android { namespace 'androidx.media3.demo.gl' - compileSdkVersion project.ext.compileSdkVersion + compileSdk project.ext.compileSdkVersion compileOptions { + coreLibraryDesugaringEnabled true sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } @@ -57,4 +58,5 @@ dependencies { implementation 'androidx.annotation:annotation:' + androidxAnnotationVersion implementation 'androidx.multidex:multidex:' + androidxMultidexVersion compileOnly 'org.checkerframework:checker-qual:' + checkerframeworkVersion + coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5' } diff --git a/demos/main/build.gradle b/demos/main/build.gradle index 850a24ac0a..581e34799c 100644 --- a/demos/main/build.gradle +++ b/demos/main/build.gradle @@ -19,9 +19,10 @@ apply plugin: 'kotlin-android' android { namespace 'androidx.media3.demo.main' - compileSdkVersion project.ext.compileSdkVersion + compileSdk project.ext.compileSdkVersion compileOptions { + coreLibraryDesugaringEnabled true sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } @@ -55,7 +56,7 @@ android { disable 'GoogleAppIndexingWarning','MissingTranslation','IconDensities' } - flavorDimensions "decoderExtensions" + flavorDimensions = ["decoderExtensions"] productFlavors { noDecoderExtensions { @@ -90,6 +91,7 @@ dependencies { withDecoderExtensionsImplementation project(modulePrefix + 'lib-decoder-vp9') withDecoderExtensionsImplementation project(modulePrefix + 'lib-decoder-midi') withDecoderExtensionsImplementation project(modulePrefix + 'lib-datasource-rtmp') + coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5' } apply plugin: 'com.google.android.gms.strict-version-matcher-plugin' diff --git a/demos/session/build.gradle b/demos/session/build.gradle index c279b96f30..a46a3d20a8 100644 --- a/demos/session/build.gradle +++ b/demos/session/build.gradle @@ -18,9 +18,10 @@ apply plugin: 'kotlin-android' android { namespace 'androidx.media3.demo.session' - compileSdkVersion project.ext.compileSdkVersion + compileSdk project.ext.compileSdkVersion compileOptions { + coreLibraryDesugaringEnabled true sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } @@ -68,4 +69,5 @@ dependencies { implementation project(modulePrefix + 'lib-ui') implementation project(modulePrefix + 'lib-session') implementation project(modulePrefix + 'demo-session-service') + coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5' } diff --git a/demos/session_automotive/build.gradle b/demos/session_automotive/build.gradle index 7fc91a2fdd..73ec33e2c1 100644 --- a/demos/session_automotive/build.gradle +++ b/demos/session_automotive/build.gradle @@ -18,9 +18,10 @@ apply plugin: 'kotlin-android' android { namespace 'androidx.media3.demo.session.automotive' - compileSdkVersion project.ext.compileSdkVersion + compileSdk project.ext.compileSdkVersion compileOptions { + coreLibraryDesugaringEnabled true sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } @@ -64,4 +65,5 @@ dependencies { implementation 'com.google.android.material:material:' + androidxMaterialVersion implementation project(modulePrefix + 'lib-session') implementation project(modulePrefix + 'demo-session-service') + coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5' } diff --git a/demos/session_service/build.gradle b/demos/session_service/build.gradle index 121eb4396e..7f03ad105b 100644 --- a/demos/session_service/build.gradle +++ b/demos/session_service/build.gradle @@ -17,7 +17,7 @@ apply plugin: 'kotlin-android' android { namespace 'androidx.media3.demo.session.service' - compileSdkVersion project.ext.compileSdkVersion + compileSdk project.ext.compileSdkVersion compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 diff --git a/demos/shortform/build.gradle b/demos/shortform/build.gradle index 0b96bdb2cf..ebb249166f 100644 --- a/demos/shortform/build.gradle +++ b/demos/shortform/build.gradle @@ -18,9 +18,10 @@ apply plugin: 'kotlin-android' android { namespace 'androidx.media3.demo.shortform' - compileSdkVersion project.ext.compileSdkVersion + compileSdk project.ext.compileSdkVersion compileOptions { + coreLibraryDesugaringEnabled true sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } @@ -93,4 +94,5 @@ dependencies { testImplementation 'com.google.truth:truth:' + truthVersion testImplementation 'org.robolectric:robolectric:' + robolectricVersion testImplementation 'org.robolectric:robolectric:' + robolectricVersion + coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5' } diff --git a/demos/surface/build.gradle b/demos/surface/build.gradle index c15c6c929c..4dc2eeaef0 100644 --- a/demos/surface/build.gradle +++ b/demos/surface/build.gradle @@ -17,9 +17,10 @@ apply plugin: 'com.android.application' android { namespace 'androidx.media3.demo.surface' - compileSdkVersion project.ext.compileSdkVersion + compileSdk project.ext.compileSdkVersion compileOptions { + coreLibraryDesugaringEnabled true sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } @@ -54,4 +55,5 @@ dependencies { implementation project(modulePrefix + 'lib-exoplayer-smoothstreaming') implementation project(modulePrefix + 'lib-ui') implementation 'androidx.annotation:annotation:' + androidxAnnotationVersion + coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5' } diff --git a/demos/transformer/build.gradle b/demos/transformer/build.gradle index d2a6b1e02b..877fc8d873 100644 --- a/demos/transformer/build.gradle +++ b/demos/transformer/build.gradle @@ -19,7 +19,7 @@ apply plugin: 'com.android.application' android { namespace 'androidx.media3.demo.transformer' - compileSdkVersion project.ext.compileSdkVersion + compileSdk project.ext.compileSdkVersion compileOptions { coreLibraryDesugaringEnabled true @@ -49,7 +49,7 @@ android { disable 'GoogleAppIndexingWarning','MissingTranslation' } - flavorDimensions "mediaPipe" + flavorDimensions = ["mediaPipe"] productFlavors { noMediaPipe { diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 3a02907943..fce403e45e 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/libraries/test_session_current/build.gradle b/libraries/test_session_current/build.gradle index c3bca034fe..66e9778bc9 100644 --- a/libraries/test_session_current/build.gradle +++ b/libraries/test_session_current/build.gradle @@ -17,7 +17,7 @@ apply plugin: 'com.android.application' android { namespace 'androidx.media3.test.session' - compileSdkVersion project.ext.compileSdkVersion + compileSdk project.ext.compileSdkVersion defaultConfig { versionName project.ext.releaseVersion