[Android] Specify gradle build tools version and relocate jvmTarget to top-level config

Robert Stone git at videolan.org
Mon Dec 12 07:55:08 UTC 2022


vlc-android | branch: master | Robert Stone <rhstone at gmail.com> | Thu Dec  8 22:34:57 2022 -0800| [20dc62fc721fe4f9c301ba09b83686639308b118] | committer: Robert Stone

Specify gradle build tools version and relocate jvmTarget to top-level config

> https://code.videolan.org/videolan/vlc-android/commit/20dc62fc721fe4f9c301ba09b83686639308b118
---

 application/app/build.gradle             | 9 +++------
 application/donations/build.gradle       | 1 +
 application/live-plot-graph/build.gradle | 2 ++
 application/mediadb/build.gradle         | 3 ++-
 application/moviepedia/build.gradle      | 3 +--
 application/resources/build.gradle       | 2 +-
 application/television/build.gradle      | 5 +++--
 application/tools/build.gradle           | 3 +--
 application/vlc-android/build.gradle     | 4 +---
 build.gradle                             | 2 ++
 medialibrary/build.gradle                | 2 ++
 11 files changed, 19 insertions(+), 17 deletions(-)

diff --git a/application/app/build.gradle b/application/app/build.gradle
index f578e62eda..3272b6dac5 100644
--- a/application/app/build.gradle
+++ b/application/app/build.gradle
@@ -1,14 +1,14 @@
 apply plugin: 'com.android.application'
 apply plugin: 'kotlin-android'
+
 android {
     compileOptions {
         sourceCompatibility JavaVersion.VERSION_1_8
         targetCompatibility JavaVersion.VERSION_1_8
     }
+    compileSdkVersion rootProject.ext.compileSdkVersion
+    buildToolsVersion rootProject.ext.buildToolsVersion
 
-    kotlinOptions {
-        jvmTarget = JavaVersion.VERSION_1_8.toString()
-    }
     packagingOptions {
         jniLibs {
             pickFirsts += ['lib/armeabi-v7a/libc++_shared.so', 'lib/armeabi/libc++_shared.so', 'lib/arm64-v8a/libc++_shared.so', 'lib/x86/libc++_shared.so', 'lib/x86_64/libc++_shared.so']
@@ -22,11 +22,8 @@ android {
         enabled = true
     }
 
-    compileSdkVersion rootProject.ext.compileSdkVersion
-
     flavorDimensions "abi"
 
-
     defaultConfig {
         applicationId rootProject.ext.appId
         minSdkVersion rootProject.ext.minSdkVersion
diff --git a/application/donations/build.gradle b/application/donations/build.gradle
index a50aec063d..295a64c48e 100644
--- a/application/donations/build.gradle
+++ b/application/donations/build.gradle
@@ -27,6 +27,7 @@ apply plugin: 'kotlin-android'
 
 android {
     compileSdkVersion rootProject.ext.compileSdkVersion
+    buildToolsVersion rootProject.ext.buildToolsVersion
 
     dataBinding {
         enabled = true
diff --git a/application/live-plot-graph/build.gradle b/application/live-plot-graph/build.gradle
index 407717a93f..148b312464 100644
--- a/application/live-plot-graph/build.gradle
+++ b/application/live-plot-graph/build.gradle
@@ -24,8 +24,10 @@
 
 apply plugin: 'com.android.library'
 apply plugin: 'kotlin-android'
+
 android {
     compileSdkVersion rootProject.ext.compileSdkVersion
+    buildToolsVersion rootProject.ext.buildToolsVersion
 
     defaultConfig {
         minSdkVersion rootProject.ext.minSdkVersion
diff --git a/application/mediadb/build.gradle b/application/mediadb/build.gradle
index 61c64912b8..215938d422 100644
--- a/application/mediadb/build.gradle
+++ b/application/mediadb/build.gradle
@@ -25,10 +25,11 @@
 apply plugin: 'com.android.library'
 apply plugin: 'kotlin-android'
 apply plugin: 'kotlin-kapt'
+
 android {
     compileSdkVersion rootProject.ext.compileSdkVersion
+    buildToolsVersion rootProject.ext.buildToolsVersion
 
-    kotlinOptions.jvmTarget = "1.8"
     packagingOptions {
         jniLibs {
             pickFirsts += ['**/*.so']
diff --git a/application/moviepedia/build.gradle b/application/moviepedia/build.gradle
index a59963df26..d848df643f 100644
--- a/application/moviepedia/build.gradle
+++ b/application/moviepedia/build.gradle
@@ -4,8 +4,7 @@ apply plugin: 'kotlin-kapt'
 
 android {
     compileSdkVersion rootProject.ext.compileSdkVersion
-
-    kotlinOptions.jvmTarget = "1.8"
+    buildToolsVersion rootProject.ext.buildToolsVersion
 
     dataBinding {
         enabled = true
diff --git a/application/resources/build.gradle b/application/resources/build.gradle
index e550feb9b1..54e89b1949 100644
--- a/application/resources/build.gradle
+++ b/application/resources/build.gradle
@@ -3,8 +3,8 @@ apply plugin: 'kotlin-android'
 
 android {
     compileSdkVersion rootProject.ext.compileSdkVersion
+    buildToolsVersion rootProject.ext.buildToolsVersion
 
-    kotlinOptions.jvmTarget = "1.8"
     packagingOptions {
         jniLibs {
             pickFirsts += ['**/*.so']
diff --git a/application/television/build.gradle b/application/television/build.gradle
index cd7bf0468d..1baee141ac 100644
--- a/application/television/build.gradle
+++ b/application/television/build.gradle
@@ -2,16 +2,17 @@ apply plugin: 'com.android.library'
 apply plugin: 'kotlin-android'
 apply plugin: 'kotlin-kapt'
 apply plugin: 'kotlin-parcelize'
+
 android {
     compileSdkVersion rootProject.ext.compileSdkVersion
+    buildToolsVersion rootProject.ext.buildToolsVersion
+
     packagingOptions {
         jniLibs {
             pickFirsts += ['**/*.so']
         }
     }
 
-    kotlinOptions.jvmTarget = "1.8"
-
     viewBinding.enabled = true
 
     dataBinding.enabled = true
diff --git a/application/tools/build.gradle b/application/tools/build.gradle
index bf01bfc6f5..e870e2cadb 100644
--- a/application/tools/build.gradle
+++ b/application/tools/build.gradle
@@ -3,8 +3,7 @@ apply plugin: 'kotlin-android'
 
 android {
     compileSdkVersion rootProject.ext.compileSdkVersion
-
-    kotlinOptions.jvmTarget = "1.8"
+    buildToolsVersion rootProject.ext.buildToolsVersion
 
     defaultConfig {
         minSdkVersion rootProject.ext.minSdkVersion
diff --git a/application/vlc-android/build.gradle b/application/vlc-android/build.gradle
index acc4d03666..e737e22873 100644
--- a/application/vlc-android/build.gradle
+++ b/application/vlc-android/build.gradle
@@ -4,10 +4,8 @@ apply plugin: 'kotlin-kapt'
 apply plugin: 'kotlin-parcelize'
 
 android {
-
-    kotlinOptions.jvmTarget = "1.8"
-
     compileSdkVersion rootProject.ext.compileSdkVersion
+    buildToolsVersion rootProject.ext.buildToolsVersion
 
     dataBinding {
         enabled = true
diff --git a/build.gradle b/build.gradle
index 461f034639..3a30088abd 100644
--- a/build.gradle
+++ b/build.gradle
@@ -31,6 +31,7 @@ allprojects {
     }
     tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
         kotlinOptions {
+            jvmTarget = JavaVersion.VERSION_1_8.toString()
             freeCompilerArgs += ['-opt-in=kotlin.RequiresOptIn']
         }
     }
@@ -46,6 +47,7 @@ ext {
     minSdkVersion = 17
     targetSdkVersion = 33
     compileSdkVersion = 33
+    buildToolsVersion = '33.0.1'
     androidxLegacyVersion = '1.0.0'
     androidxCoreVersion = '1.7.0'
     appCompatVersion = '1.4.1'
diff --git a/medialibrary/build.gradle b/medialibrary/build.gradle
index d1e71ab3a2..e99ad94fde 100644
--- a/medialibrary/build.gradle
+++ b/medialibrary/build.gradle
@@ -33,6 +33,8 @@ android {
         targetCompatibility JavaVersion.VERSION_1_8
     }
     compileSdkVersion rootProject.ext.compileSdkVersion
+    buildToolsVersion rootProject.ext.buildToolsVersion
+
     defaultConfig {
         minSdkVersion rootProject.ext.minSdkVersion
         targetSdkVersion rootProject.ext.targetSdkVersion



More information about the Android mailing list