Skip to content

Commit ee01ba3

Browse files
committed
Specify JDK toolchain directly
Specifying JDK toolchain in the java block lets us avoid specifying same version again and again for different options while ensuring everything is on the same version Ref: https://developer.android.com/build/jdks#toolchain Signed-off-by: Aayush Gupta <[email protected]>
1 parent 1bef2fd commit ee01ba3

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

app/build.gradle.kts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ val gitWorkingBranch = providers.exec {
1818
commandLine("git", "rev-parse", "--abbrev-ref", "HEAD")
1919
}.standardOutput.asText.map { it.trim() }
2020

21+
java {
22+
toolchain {
23+
languageVersion = JavaLanguageVersion.of(17)
24+
}
25+
}
26+
2127
android {
2228
compileSdk = 36
2329
namespace = "org.schabi.newpipe"
@@ -87,16 +93,9 @@ android {
8793
compileOptions {
8894
// Flag to enable support for the new language APIs
8995
isCoreLibraryDesugaringEnabled = true
90-
91-
sourceCompatibility = JavaVersion.VERSION_17
92-
targetCompatibility = JavaVersion.VERSION_17
9396
encoding = "utf-8"
9497
}
9598

96-
kotlinOptions {
97-
jvmTarget = "17"
98-
}
99-
10099
sourceSets {
101100
getByName("androidTest") {
102101
assets.srcDir("$projectDir/schemas")

0 commit comments

Comments
 (0)