Skip to content

Commit d075c36

Browse files
authored
HTML: fix Inconsistent JVM-target compatibility and deprecation warnings (#5423)
Fix bumping JDK to 21 on CI ## Release Notes N/A
1 parent adc673d commit d075c36

File tree

6 files changed

+11
-12
lines changed

6 files changed

+11
-12
lines changed

html/benchmark-core/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ val BENCHMARKS_PATH = "reports/tests/jsTest/classes/org.jetbrains.compose.web.te
5050

5151
val printBenchmarkResults by tasks.registering {
5252
doLast {
53-
val report = buildDir.resolve(BENCHMARKS_PATH).readText()
53+
val report = layout.buildDirectory.file(BENCHMARKS_PATH).get().asFile.readText()
5454
val stdout = "#.*;".toRegex().findAll(report).map { it.value }.firstOrNull()
5555

5656
val benchmarks = stdout?.split(";")?.mapNotNull {

html/build.gradle.kts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ import org.gradle.api.tasks.testing.logging.TestExceptionFormat
44
import org.jetbrains.compose.gradle.kotlinKarmaConfig
55
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
66
import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension
7-
import org.jetbrains.kotlin.gradle.dsl.kotlinExtension
8-
import org.jetbrains.kotlin.gradle.plugin.mpp.pm20.util.targets
97
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
108

119
plugins {
@@ -58,8 +56,6 @@ subprojects {
5856
}
5957
}
6058

61-
62-
6359
tasks.withType<KotlinCompile> {
6460
compilerOptions {
6561
jvmTarget.set(JvmTarget.JVM_11)
@@ -143,9 +139,9 @@ subprojects {
143139
val printTestBundleSize by tasks.registering {
144140
dependsOn(tasks.named("jsTest"))
145141
doLast {
146-
val bundlePath = buildDir.resolve(
142+
val bundlePath = layout.buildDirectory.file(
147143
"compileSync/test/testDevelopmentExecutable/kotlin/${rootProject.name}-${project.name}-test.js"
148-
)
144+
).get().asFile
149145
if (bundlePath.exists()) {
150146
val size = bundlePath.length()
151147
println("##teamcity[buildStatisticValue key='testBundleSize::${project.name}' value='$size']")
@@ -163,7 +159,7 @@ subprojects {
163159
val printBundleSize by tasks.registering {
164160
dependsOn(tasks.named("jsBrowserDistribution"))
165161
doLast {
166-
val jsFile = buildDir.resolve("distributions/${project.name}.js")
162+
val jsFile = layout.buildDirectory.file("distributions/${project.name}.js").get().asFile
167163
val size = jsFile.length()
168164
println("##teamcity[buildStatisticValue key='bundleSize::${project.name}' value='$size']")
169165
}

html/buildSrc/build.gradle.kts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ plugins {
1313
id("org.jetbrains.kotlin.jvm")
1414
}
1515

16+
kotlin {
17+
jvmToolchain(17)
18+
}
1619

1720
java {
1821
sourceCompatibility = JavaVersion.VERSION_17

html/compose-compiler-integration/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ kotlin {
4040

4141

4242
fun cloneTemplate(templateName: String, contentMain: String, contentLib: String): File {
43-
val tempDir = file("${project.buildDir.absolutePath}/temp/cloned-$templateName")
43+
val tempDir = layout.buildDirectory.dir("temp/cloned-$templateName").get().asFile
4444
tempDir.deleteRecursively()
4545
tempDir.mkdirs()
4646
file("${projectDir.absolutePath}/main-template").copyRecursively(tempDir)

html/compose-compiler-integration/main-template/lib/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
plugins {
2-
kotlin("multiplatform")// version "1.5.10"
3-
id("org.jetbrains.compose")// version (System.getenv("COMPOSE_INTEGRATION_VERSION") ?: "0.0.0-SNASPHOT")
2+
kotlin("multiplatform")
3+
id("org.jetbrains.compose")
44
id("org.jetbrains.kotlin.plugin.compose")
55
}
66

html/integration-core/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ kotlin {
1616

1717
systemProperty(
1818
"COMPOSE_WEB_INTEGRATION_TESTS_DISTRIBUTION",
19-
File(buildDir, "developmentExecutable")
19+
layout.buildDirectory.dir("developmentExecutable").get().asFile
2020
)
2121
}
2222
}

0 commit comments

Comments
 (0)