File tree 3 files changed +22
-1
lines changed
src/main/kotlin/kotlinx/benchmark/integration
3 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -63,3 +63,16 @@ fun getOverriddenKotlinLanguageVersion(project: Project): String? {
63
63
}
64
64
return languageVersion
65
65
}
66
+
67
+ /* *
68
+ * Should be used for running against non-released Kotlin compiler on a system test level.
69
+ *
70
+ * @return a Kotlin API version parametrized from command line or gradle.properties, null otherwise
71
+ */
72
+ fun getOverriddenKotlinNativeVersion (project : Project ): String? {
73
+ val nativeVersion = project.providers.gradleProperty(" kotlin.native.version" ).orNull
74
+ if (! nativeVersion.isNullOrBlank()) {
75
+ project.logger.info(""" Configured Kotlin Native distribution version: '$nativeVersion ' for project ${project.name} """ )
76
+ }
77
+ return nativeVersion
78
+ }
Original file line number Diff line number Diff line change @@ -33,6 +33,9 @@ tasks.test {
33
33
getOverriddenKotlinApiVersion(project)?.let {
34
34
systemProperty(" kotlin_api_version" , it)
35
35
}
36
+ getOverriddenKotlinNativeVersion(project)?.let {
37
+ systemProperty(" kotlin.native.version" , it)
38
+ }
36
39
systemProperty(" minSupportedGradleVersion" , libs.versions.minSupportedGradle.get())
37
40
systemProperty(" minSupportedKotlinVersion" , libs.versions.minSupportedKotlin.get())
38
41
}
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ class Runner(
16
16
private fun gradle (vararg tasks : String ): GradleRunner =
17
17
GradleRunner .create()
18
18
.withProjectDir(projectDir)
19
- .withArguments(* (defaultArguments() + tasks))
19
+ .withArguments(* (defaultArguments() + kotlinNativeVersion + tasks))
20
20
.withGradleVersion(gradleVersion.versionString)
21
21
.forwardStdError(System .err.bufferedWriter())
22
22
.run {
@@ -44,6 +44,11 @@ class Runner(
44
44
45
45
private fun defaultArguments (): Array <String > = arrayOf(" --stacktrace" )
46
46
47
+ // Forward the Kotlin Native distribution version to test projects
48
+ private val kotlinNativeVersion = " kotlin.native.version" .let { property ->
49
+ System .getProperty(property)?.let { arrayOf(" -P$property =$it " ) } ? : emptyArray()
50
+ }
51
+
47
52
fun updateAnnotations (filePath : String , annotationsSpecifier : AnnotationsSpecifier .() -> Unit ) {
48
53
val annotations = AnnotationsSpecifier ().also (annotationsSpecifier)
49
54
val file = projectDir.resolve(filePath)
You can’t perform that action at this time.
0 commit comments