Skip to content

Commit d72ec68

Browse files
committed
Fix builds for older Kotlin and kover
1 parent 64e1e96 commit d72ec68

File tree

6 files changed

+53
-6
lines changed

6 files changed

+53
-6
lines changed

gradle-conventions-settings/develocity/src/main/kotlin/conventions-develocity.settings.gradle.kts

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,18 @@ develocity {
1313
val startParameter = gradle.startParameter
1414
val scanJournal = File(settingsDir, "scan-journal.log")
1515

16-
server = DEVELOCITY_SERVER
16+
server.set(DEVELOCITY_SERVER)
1717

1818
buildScan {
19-
uploadInBackground = !isCIRun
19+
uploadInBackground.set(!isCIRun)
2020

2121
// obfuscate NIC since we don't want to expose user real IP (will be relevant without VPN)
2222
obfuscation {
2323
ipAddresses { addresses -> addresses.map { _ -> "0.0.0.0" } }
2424
}
2525

2626
capture {
27-
fileFingerprints = true
27+
fileFingerprints.set(true)
2828
}
2929

3030
buildScanPublished {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
* Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
3+
*/
4+
5+
import java.io.File
6+
import java.nio.file.Files
7+
import java.nio.file.Path
8+
9+
plugins {
10+
alias(libs.plugins.gradle.kotlin.dsl)
11+
}
12+
13+
fun Path.name() = fileName?.toString().orEmpty()
14+
15+
fun filterDirectory(sourceSetPath: Path, filter: (Path) -> Boolean): List<File> {
16+
return Files.newDirectoryStream(sourceSetPath).use { it.toList() }.filter(filter).map { it.toFile() }
17+
}
18+
19+
val pluginsSource: Path = layout.projectDirectory.dir("../develocity/src/main/kotlin").asFile.toPath()
20+
21+
val plugins = filterDirectory(pluginsSource) {
22+
Files.isRegularFile(it) && it.name().endsWith(".settings.gradle.kts")
23+
}.map { it.name.substringBefore('.') }
24+
25+
plugins.forEach { name ->
26+
gradlePlugin {
27+
plugins {
28+
create(name) {
29+
id = name
30+
implementationClass = "EmptySettingsPlugin"
31+
}
32+
}
33+
34+
logger.info("Applied $name precompiled plugin as stub")
35+
}
36+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/*
2+
* Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
3+
*/
4+
5+
// Do not delete this. It is used as a stub plugin for latest-only plugins

gradle-conventions-settings/settings.gradle.kts

+7-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,10 @@ rootProject.name = "gradle-conventions-settings"
77
// Code below is a hack because a chicken-egg problem, I can't use myself as a settings-plugin
88
apply(from = "src/main/kotlin/settings-conventions.settings.gradle.kts")
99

10-
include(":develocity")
10+
val kotlinVersion: KotlinVersion by extra
11+
12+
if (kotlinVersion.isAtLeast(1, 9, 0)) {
13+
include(":develocity")
14+
} else {
15+
include(":empty")
16+
}

gradle-conventions/latest-only/src/main/kotlin/conventions-kover.gradle.kts

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ the<KoverProjectExtension>().apply {
1414
total {
1515
html {
1616
onCheck.set(false)
17-
charset.set("UTF_8")
17+
charset.set("UTF-8")
1818
htmlDir.set(rootDir.resolve("kover"))
1919
}
2020

tests/compiler-plugin-tests/build.gradle.kts

+1-1
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,6 @@ fun Test.setJarPathAsProperty(
161161
}
162162

163163
fun Test.systemPropertyLogged(name: String, value: Any) {
164-
logger.lifecycle("Setting test prop $name=$value")
164+
logger.info("Setting test prop $name=$value")
165165
systemProperty(name, value)
166166
}

0 commit comments

Comments
 (0)