File tree Expand file tree Collapse file tree 2 files changed +12
-5
lines changed
src/test/kotlin/com/tschuchort/compiletesting Expand file tree Collapse file tree 2 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ buildscript {
16
16
plugins {
17
17
id ' java'
18
18
id ' org.jetbrains.kotlin.jvm' version " $kotlin_version "
19
+ id " com.github.gmazzo.buildconfig" version " 2.0.1"
19
20
}
20
21
21
22
apply plugin : ' kotlin'
@@ -40,6 +41,16 @@ idea {
40
41
}
41
42
}
42
43
44
+ buildConfig {
45
+ className = " BuildConfig"
46
+ packageName = " com.tschuchort.compiletesting"
47
+ sourceSets {
48
+ test {
49
+ buildConfigField ' String' , ' KOTLIN_VERSION' , " \" $kotlin_version \" "
50
+ }
51
+ }
52
+ }
53
+
43
54
dependencies {
44
55
implementation " org.jetbrains.kotlin:kotlin-stdlib-jdk8"
45
56
testImplementation group : ' junit' , name : ' junit' , version : ' 4.12'
@@ -75,7 +86,3 @@ compileTestKotlin {
75
86
kotlinOptions. jvmTarget = " 1.8"
76
87
kotlinOptions. freeCompilerArgs + = [" -Xskip-runtime-version-check" ]
77
88
}
78
-
79
- test {
80
- systemProperty " KOTLIN_VERSION" , " $kotlin_version "
81
- }
Original file line number Diff line number Diff line change @@ -632,7 +632,7 @@ class KotlinCompilationTests {
632
632
fun `detects the plugin provided for compilation via pluginClasspaths property` () {
633
633
val result = defaultCompilerConfig().apply {
634
634
sources = listOf (SourceFile .kotlin(" kSource.kt" , " class KSource" ))
635
- pluginClasspaths = listOf (classpathOf(" kotlin-scripting-compiler-${System .getProperty( " KOTLIN_VERSION" ) } " ))
635
+ pluginClasspaths = listOf (classpathOf(" kotlin-scripting-compiler-${BuildConfig . KOTLIN_VERSION } " ))
636
636
}.compile()
637
637
638
638
assertThat(result.exitCode).isEqualTo(ExitCode .OK )
You can’t perform that action at this time.
0 commit comments