mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-26 16:28:12 -07:00
Refactor.
This commit is contained in:
parent
bcbcfa3144
commit
01e5afe531
1 changed files with 8 additions and 7 deletions
|
@ -25,18 +25,19 @@ abstract class GenericTestRunner(open val project: Project, open val classpath:
|
||||||
fun runTests() {
|
fun runTests() {
|
||||||
val jvm = JavaInfo.create(File(SystemProperties.javaBase))
|
val jvm = JavaInfo.create(File(SystemProperties.javaBase))
|
||||||
val java = jvm.javaExecutable
|
val java = jvm.javaExecutable
|
||||||
val allArgs = arrayListOf<String>()
|
val allArgs = arrayListOf<String>().apply {
|
||||||
allArgs.add(java!!.absolutePath)
|
add(java!!.absolutePath)
|
||||||
allArgs.add("-classpath")
|
add("-classpath")
|
||||||
allArgs.add(classpath.map { it.jarFile.get().absolutePath }.joinToString(File.pathSeparator))
|
add(classpath.map { it.jarFile.get().absolutePath }.joinToString(File.pathSeparator))
|
||||||
allArgs.add(mainClass)
|
add(mainClass)
|
||||||
allArgs.addAll(args)
|
addAll(args)
|
||||||
|
}
|
||||||
|
|
||||||
val pb = ProcessBuilder(allArgs)
|
val pb = ProcessBuilder(allArgs)
|
||||||
pb.directory(File(project.directory))
|
pb.directory(File(project.directory))
|
||||||
pb.inheritIO()
|
pb.inheritIO()
|
||||||
log(1, "Running tests with classpath size ${classpath.size}")
|
log(1, "Running tests with classpath size ${classpath.size}")
|
||||||
log(2, "Launching " + allArgs.join(" "))
|
log(2, "Launching " + allArgs.joinToString(" "))
|
||||||
val process = pb.start()
|
val process = pb.start()
|
||||||
val errorCode = process.waitFor()
|
val errorCode = process.waitFor()
|
||||||
if (errorCode == 0) {
|
if (errorCode == 0) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue