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 {
1616plugins {
1717 id ' java'
1818 id ' org.jetbrains.kotlin.jvm' version " $kotlin_version "
19+ id " com.github.gmazzo.buildconfig" version " 2.0.1"
1920}
2021
2122apply plugin : ' kotlin'
@@ -40,6 +41,16 @@ idea {
4041 }
4142}
4243
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+
4354dependencies {
4455 implementation " org.jetbrains.kotlin:kotlin-stdlib-jdk8"
4556 testImplementation group : ' junit' , name : ' junit' , version : ' 4.12'
@@ -75,7 +86,3 @@ compileTestKotlin {
7586 kotlinOptions. jvmTarget = " 1.8"
7687 kotlinOptions. freeCompilerArgs + = [" -Xskip-runtime-version-check" ]
7788}
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 {
632632 fun `detects the plugin provided for compilation via pluginClasspaths property` () {
633633 val result = defaultCompilerConfig().apply {
634634 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 } " ))
636636 }.compile()
637637
638638 assertThat(result.exitCode).isEqualTo(ExitCode .OK )
You can’t perform that action at this time.
0 commit comments