Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update project JDK to JDK17. #1510

Merged
merged 1 commit into from
Aug 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
134 changes: 75 additions & 59 deletions api/api.base

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions api/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ plugins {
id("org.jetbrains.dokka")
}

dependencies {
api(kotlin("stdlib", kotlinBaseVersion))
}
tasks {
val sourcesJar by creating(Jar::class) {
archiveClassifier.set("sources")
Expand Down
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ subprojects {
targetCompatibility = JavaVersion.VERSION_1_8.toString()
javaCompiler.set(
javaToolchains.compilerFor {
languageVersion.set(JavaLanguageVersion.of(11))
languageVersion.set(JavaLanguageVersion.of(17))
}
)
}
Expand All @@ -117,7 +117,7 @@ subprojects {
// Java 11 is required to run
javaLauncher.set(
javaToolchains.launcherFor {
languageVersion.set(JavaLanguageVersion.of(11))
languageVersion.set(JavaLanguageVersion.of(17))
}
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ private fun Project.getCompileClasspath(): String =

private fun Project.getMetalavaConfiguration(): Configuration {
return configurations.findByName("metalava") ?: configurations.create("metalava") {
val dependency = dependencies.create("com.android.tools.metalava:metalava:1.0.0-alpha04")
val dependency = dependencies.create("com.android.tools.metalava:metalava:1.0.0-alpha08")
it.dependencies.add(dependency)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,33 @@ class PlaygroundIT {
gradleRunner.buildAndCheck("clean", "build")
}

@Test
fun testPlaygroundJDK8() {
// FIXME: `clean` fails to delete files on windows.
File(project.root, "test-processor/build.gradle.kts").appendText(
"""
kotlin {
compilerOptions {
jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_1_8)
}
}
""".trimIndent()
)
File(project.root, "workload/build.gradle.kts").appendText(
"""
kotlin {
compilerOptions {
jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_1_8)
}
}
""".trimIndent()
)
Assume.assumeFalse(System.getProperty("os.name").startsWith("Windows", ignoreCase = true))
val gradleRunner = GradleRunner.create().withProjectDir(project.root)
gradleRunner.buildAndCheck("clean", "build")
gradleRunner.buildAndCheck("clean", "build")
}

@Test
fun testConfigurationOfConfiguration() {
// FIXME: `clean` fails to delete files on windows.
Expand Down Expand Up @@ -314,7 +341,7 @@ class PlaygroundIT {
"""
kotlin {
compilerOptions {
jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17)
jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_20)
}
}
""".trimIndent()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ class TemporaryTestProject(projectName: String, baseProject: String? = null) : T
gradleProperties.appendText("\ntestRepo=$testRepo")
gradleProperties.appendText("\norg.gradle.unsafe.configuration-cache=true")
gradleProperties.appendText("\nkotlin.jvm.target.validation.mode=warning")
// Uncomment this to run tests in K2.
// gradleProperties.appendText("\nksp.useK2=true")
// Uncomment this to debug compiler and compiler plugin.
// gradleProperties.appendText("\nsystemProp.kotlin.compiler.execution.strategy=in-process")
}
Expand Down
Loading