Skip to content

Commit 05144c1

Browse files
Abduqodiri Qurbonzodaqurbonzoda
Abduqodiri Qurbonzoda
authored andcommitted
Fix TC build against the current Kotlin master
1 parent ca16384 commit 05144c1

File tree

7 files changed

+28
-11
lines changed

7 files changed

+28
-11
lines changed

.teamcity/additionalConfiguration.kt

+8-2
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,14 @@ fun Project.buildWithKotlinMaster(platform: Platform, versionBuild: BuildType) =
117117
jvmArgs = "-Xmx1g"
118118
tasks = "clean publishToBuildLocal check"
119119
// --continue is needed to run tests for all targets even if one target fails
120-
gradleParams = "--info --stacktrace -P$versionSuffixParameter=%$versionSuffixParameter% -P$teamcitySuffixParameter=%$teamcitySuffixParameter% --continue"
121-
gradleParams += " -Pkotlin_repo_url=file://%teamcity.build.checkoutDir%/artifacts/kotlin -Pkotlin_version=%$kotlinVersionParameter% -Pkotlin.native.version=%$kotlinVersionParameter%"
120+
gradleParams = listOf(
121+
"-x kotlinStoreYarnLock",
122+
"--info", "--stacktrace", "--continue",
123+
"-P$versionSuffixParameter=%$versionSuffixParameter%", "-P$teamcitySuffixParameter=%$teamcitySuffixParameter%",
124+
"-Pkotlin_repo_url=file://%teamcity.build.checkoutDir%/artifacts/kotlin",
125+
"-Pkotlin_version=%$kotlinVersionParameter%", "-Pkotlin.native.version=%$kotlinVersionParameter%",
126+
"-Pmin_supported_gradle_version=7.6.3"
127+
).joinToString(separator = " ")
122128
buildFile = ""
123129
gradleWrapperPath = ""
124130
}

README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@
88
[![Gradle Plugin Portal](https://img.shields.io/maven-metadata/v?label=Gradle%20Plugin&metadataUrl=https://plugins.gradle.org/m2/org/jetbrains/kotlinx/kotlinx-benchmark-plugin/maven-metadata.xml)](https://plugins.gradle.org/plugin/org.jetbrains.kotlinx.benchmark)
99

1010
`kotlinx-benchmark` is a toolkit for running benchmarks for multiplatform code written in Kotlin.
11-
It is designed to work with Kotlin/JVM, Kotlin/JS, Kotlin/Native, and Kotlin/Wasm (experimental) targets.
11+
It is designed to work with Kotlin/JVM, Kotlin/JS, Kotlin/Native, and Kotlin/WasmJs (experimental) targets.
1212

1313
To get started, ensure you're using Kotlin 2.0.0 or newer and Gradle 7.4 or newer.
14+
However, because the Kotlin/WasmJs target is experimental and in an active development phase, it guarantees support
15+
only for the specific Kotlin version used to build the library. For the latest version, this is Kotlin 2.0.20.
1416

1517
## Features
1618

build.gradle.kts

+1
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ apiValidation {
128128
}
129129

130130
val checkReadme by tasks.registering(CheckReadmeTask::class) {
131+
enabled = providers.gradleProperty("min_supported_gradle_version").orNull.isNullOrBlank()
131132
minSupportedGradleVersion = libs.versions.minSupportedGradle
132133
minSupportedKotlinVersion = libs.versions.minSupportedKotlin
133134
readme = file("README.md")

gradle/libs.versions.toml

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ squareup-kotlinpoet = "1.3.0"
99
jmh = "1.21"
1010
gradle-pluginPublish = "0.21.0"
1111

12+
# Note: This version can be overridden by passing `-Pmin_supported_gradle_version=<version>`
1213
minSupportedGradle = "7.4"
1314
minSupportedKotlin = "2.0.0"
1415

integration/src/main/kotlin/kotlinx/benchmark/integration/GradleTestVersion.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package kotlinx.benchmark.integration
22

33
enum class GradleTestVersion(val versionString: String) {
44
v8_0("8.0.2"),
5-
MinSupportedGradleVersion("7.4"),
5+
MinSupportedGradleVersion(System.getProperty("minSupportedGradleVersion")),
66
UnsupportedGradleVersion("7.3"),
77
MinSupportedKotlinVersion("2.0.0"),
88
UnsupportedKotlinVersion("1.9.20"),

integration/src/test/kotlin/kotlinx/benchmark/integration/WasmGcOptionsTest.kt

+3-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ class WasmGcOptionsTest : GradleTest() {
1212
val runner = project(
1313
"wasm-gc-non-experimental/wasm-d8",
1414
print = true,
15-
kotlinVersion = GradleTestVersion.MinSupportedKotlinVersion.versionString
15+
// While Kotlin/Wasm is in active development phase, only matching versions are supported.
16+
// Hence, use the current Kotlin version instead of the minimum supported version.
17+
// kotlinVersion = GradleTestVersion.MinSupportedKotlinVersion.versionString
1618
)
1719
runner.runAndSucceed( "wasmJsBenchmark")
1820
}

settings.gradle.kts

+11-6
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,17 @@ pluginManagement {
1111
dependencyResolutionManagement {
1212
versionCatalogs {
1313
create("libs") {
14-
val kotlinVersion = providers.gradleProperty("kotlin_version").orNull
15-
if (!kotlinVersion.isNullOrBlank()) {
16-
// Override the default Kotlin version.
17-
// The only intended use-case is for testing dev Kotlin builds using kotlinx-benchmark.
18-
// The Kotlin version should not be overridden during regular development.
19-
version("kotlin", kotlinVersion)
14+
listOf(
15+
"kotlin" to "kotlin_version",
16+
"minSupportedGradle" to "min_supported_gradle_version",
17+
).forEach { (versionName, propertyName) ->
18+
val overrideVersion = providers.gradleProperty(propertyName).orNull
19+
if (!overrideVersion.isNullOrBlank()) {
20+
// Override the default version.
21+
// The only intended use-case is for testing dev Kotlin builds using kotlinx-benchmark.
22+
// These versions should not be overridden during regular development.
23+
version(versionName, overrideVersion)
24+
}
2025
}
2126
}
2227
}

0 commit comments

Comments
 (0)