@@ -56,11 +56,7 @@ projectTests {
56
56
workingDir = rootDir
57
57
val testRuntimeProvider = project.provider { testJsr223Runtime.asPath }
58
58
val testCompilationClasspathProvider = project.provider { testCompilationClasspath.asPath }
59
- doFirst {
60
- systemProperty(" testJsr223RuntimeClasspath" , testRuntimeProvider.get())
61
- systemProperty(" testCompilationClasspath" , testCompilationClasspathProvider.get())
62
- systemProperty(" kotlin.script.base.compiler.arguments" , " -language-version 1.9" )
63
- }
59
+ configureProperties(testRuntimeProvider, testCompilationClasspathProvider)
64
60
}
65
61
66
62
testTask(" embeddableTest" , jUnitMode = JUnitMode .JUnit5 , parallel = true , skipInLocalBuild = false ) {
@@ -69,10 +65,18 @@ projectTests {
69
65
classpath = embeddableTestRuntime
70
66
val testRuntimeProvider = project.provider { embeddableTestRuntime.asPath }
71
67
val testCompilationClasspathProvider = project.provider { testCompilationClasspath.asPath }
72
- doFirst {
73
- systemProperty(" testJsr223RuntimeClasspath" , testRuntimeProvider.get())
74
- systemProperty(" testCompilationClasspath" , testCompilationClasspathProvider.get())
75
- systemProperty(" kotlin.script.base.compiler.arguments" , " -language-version 1.9" )
76
- }
68
+ configureProperties(testRuntimeProvider, testCompilationClasspathProvider)
69
+ }
70
+ }
71
+
72
+ fun Test.configureProperties (testRuntimeProvider : Provider <String >, testCompilationClasspathProvider : Provider <String >) {
73
+ doFirst {
74
+ val jsr223RuntimeClasspathFile = temporaryDir.resolve(" testJsr223RuntimeClasspath.txt" )
75
+ .apply { writeText(testRuntimeProvider.get()) }
76
+ systemProperty(" testJsr223RuntimeClasspath" , jsr223RuntimeClasspathFile)
77
+ val compilationClasspathFile = temporaryDir.resolve(" testCompilationClasspath.txt" )
78
+ .apply { writeText(testCompilationClasspathProvider.get()) }
79
+ systemProperty(" testCompilationClasspath" , compilationClasspathFile)
80
+ systemProperty(" kotlin.script.base.compiler.arguments" , " -language-version 1.9" )
77
81
}
78
82
}
0 commit comments