Skip to content

Commit 001b2ab

Browse files
committed
Gradle: compile at Java language level 11
Not 17 yet because if com.android.tools:desugar_jdk_libs ever needs to be used, it only supports some JDK 11 APIs.
1 parent ac3552b commit 001b2ab

File tree

5 files changed

+11
-34
lines changed

5 files changed

+11
-34
lines changed

api/build.gradle.kts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@ val sgCompileSdk: Int by rootProject.extra
1111
val sgMinSdk: Int by rootProject.extra
1212
val sgTargetSdk: Int by rootProject.extra
1313

14-
tasks.withType(JavaCompile::class.java).configureEach {
15-
// Suppress JDK 21 warning about deprecated, but not yet removed, source and target value 8 support
16-
options.compilerArgs.add("-Xlint:-options")
17-
}
18-
1914
android {
2015
namespace = "com.battlelancer.seriesguide.api"
2116
compileSdk = sgCompileSdk
@@ -26,8 +21,8 @@ android {
2621

2722
compileOptions {
2823
encoding = "UTF-8"
29-
sourceCompatibility = JavaVersion.VERSION_1_8
30-
targetCompatibility = JavaVersion.VERSION_1_8
24+
sourceCompatibility = JavaVersion.VERSION_11
25+
targetCompatibility = JavaVersion.VERSION_11
3126
}
3227

3328
lint {

app/build.gradle.kts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,9 @@ val sgTargetSdk: Int by rootProject.extra
2323
val sgVersionCode: Int by rootProject.extra
2424
val sgVersionName: String by rootProject.extra
2525

26-
tasks.withType(JavaCompile::class.java).configureEach {
27-
// Suppress JDK 21 warning about deprecated, but not yet removed, source and target value 8 support
28-
options.compilerArgs.add("-Xlint:-options")
29-
}
30-
3126
kotlin {
3227
compilerOptions {
33-
jvmTarget = JvmTarget.JVM_1_8
28+
jvmTarget = JvmTarget.JVM_11
3429
// Using experimental flatMapLatest for Paging 3
3530
// Using experimental Material 3 compose APIs
3631
freeCompilerArgs.add("-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi,androidx.compose.material3.ExperimentalMaterial3Api")
@@ -97,8 +92,8 @@ android {
9792

9893
compileOptions {
9994
encoding = "UTF-8"
100-
sourceCompatibility = JavaVersion.VERSION_1_8
101-
targetCompatibility = JavaVersion.VERSION_1_8
95+
sourceCompatibility = JavaVersion.VERSION_11
96+
targetCompatibility = JavaVersion.VERSION_11
10297
}
10398

10499
lint {

backend/build.gradle.kts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,9 @@ plugins {
99
val sgCompileSdk: Int by rootProject.extra
1010
val sgMinSdk: Int by rootProject.extra
1111

12-
tasks.withType(JavaCompile::class.java).configureEach {
13-
// Suppress JDK 21 warning about deprecated, but not yet removed, source and target value 8 support
14-
options.compilerArgs.add("-Xlint:-options")
15-
}
16-
1712
kotlin {
1813
compilerOptions {
19-
jvmTarget = JvmTarget.JVM_1_8
14+
jvmTarget = JvmTarget.JVM_11
2015
}
2116
}
2217

@@ -33,8 +28,8 @@ android {
3328

3429
compileOptions {
3530
encoding = "UTF-8"
36-
sourceCompatibility = JavaVersion.VERSION_1_8
37-
targetCompatibility = JavaVersion.VERSION_1_8
31+
sourceCompatibility = JavaVersion.VERSION_11
32+
targetCompatibility = JavaVersion.VERSION_11
3833
}
3934

4035
packaging {

gradle.properties

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,3 @@ android.useAndroidX=true
1515
# Do not turn on full mode for as long as possible: looking at unused.txt diff there are many
1616
# differences with an increased risk of breaking things.
1717
android.enableR8.fullMode=false
18-
19-
# JDK 21 still supports source and target value 8, it will be removed in a future release
20-
android.javaCompile.suppressSourceTargetDeprecationWarning=true

widgets/build.gradle.kts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,9 @@ plugins {
88
val sgCompileSdk: Int by rootProject.extra
99
val sgMinSdk: Int by rootProject.extra
1010

11-
tasks.withType(JavaCompile::class.java).configureEach {
12-
// Suppress JDK 21 warning about deprecated, but not yet removed, source and target value 8 support
13-
options.compilerArgs.add("-Xlint:-options")
14-
}
15-
1611
kotlin {
1712
compilerOptions {
18-
jvmTarget = JvmTarget.JVM_1_8
13+
jvmTarget = JvmTarget.JVM_11
1914
}
2015
}
2116

@@ -31,8 +26,8 @@ android {
3126

3227
compileOptions {
3328
encoding = "UTF-8"
34-
sourceCompatibility = JavaVersion.VERSION_1_8
35-
targetCompatibility = JavaVersion.VERSION_1_8
29+
sourceCompatibility = JavaVersion.VERSION_11
30+
targetCompatibility = JavaVersion.VERSION_11
3631
}
3732

3833
}

0 commit comments

Comments
 (0)