1
0
Fork 0
mirror of https://github.com/ethauvin/kobalt.git synced 2025-04-26 00:17:11 -07:00

Inject the Jvm object.

This commit is contained in:
Cedric Beust 2017-04-18 08:16:13 -07:00
parent dc1ebfb15d
commit 37709b571c
5 changed files with 23 additions and 14 deletions

View file

@ -4,6 +4,7 @@ import com.beust.kobalt.*
import com.beust.kobalt.api.*
import com.beust.kobalt.misc.KFiles
import com.google.common.annotations.VisibleForTesting
import com.google.inject.Inject
import java.io.File
import java.util.*
@ -19,6 +20,9 @@ abstract class GenericTestRunner: ITestRunnerContributor {
open var shortMessage: String? = null
open var longMessage: String? = null
@Inject
private lateinit var jvm: Jvm
abstract fun args(project: Project, context: KobaltContext, classpath: List<IClasspathDependency>,
testConfig: TestConfig) : List<String>
@ -116,7 +120,7 @@ abstract class GenericTestRunner: ITestRunnerContributor {
val args = args(project, context, classpath, testConfig)
if (args.size > 0) {
val java = JavaInfo.create(File(SystemProperties.javaBase)).javaExecutable
val java = jvm.javaExecutable
val jvmArgs = calculateAllJvmArgs(project, context, testConfig, classpath,
Kobalt.INJECTOR.getInstance (PluginInfo::class.java))
val allArgs = arrayListOf<String>().apply {