diff --git a/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/TestConfig.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/TestConfig.kt new file mode 100644 index 00000000..f84b094d --- /dev/null +++ b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/TestConfig.kt @@ -0,0 +1,40 @@ +package com.beust.kobalt + +import com.beust.kobalt.api.Project +import com.beust.kobalt.api.annotation.Directive + +class TestConfig(val project: Project, val isDefault : Boolean = false) { + val testArgs = arrayListOf() + val jvmArgs = arrayListOf() + val testIncludes = arrayListOf("**/*Test.class") + val testExcludes = arrayListOf() + + @Directive + var name: String = "" + + @Directive + fun args(vararg arg: String) { + testArgs.addAll(arg) + } + + @Directive + fun jvmArgs(vararg arg: String) { + jvmArgs.addAll(arg) + } + + @Directive + fun include(vararg arg: String) { + testIncludes.apply { + clear() + addAll(arg) + } + } + + @Directive + fun exclude(vararg arg: String) { + testExcludes.apply { + clear() + addAll(arg) + } + } +} \ No newline at end of file diff --git a/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/TestDirective.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/TestDirective.kt index 09dd4a31..ad026380 100644 --- a/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/TestDirective.kt +++ b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/TestDirective.kt @@ -3,42 +3,6 @@ package com.beust.kobalt import com.beust.kobalt.api.Project import com.beust.kobalt.api.annotation.Directive -class TestConfig(val project: Project, val isDefault : Boolean = false) { - val testArgs = arrayListOf() - val jvmArgs = arrayListOf() - val testIncludes = arrayListOf("**/*Test.class") - val testExcludes = arrayListOf() - - @Directive - var name: String = "" - - @Directive - fun args(vararg arg: String) { - testArgs.addAll(arg) - } - - @Directive - fun jvmArgs(vararg arg: String) { - jvmArgs.addAll(arg) - } - - @Directive - fun include(vararg arg: String) { - testIncludes.apply { - clear() - addAll(arg) - } - } - - @Directive - fun exclude(vararg arg: String) { - testExcludes.apply { - clear() - addAll(arg) - } - } -} - @Directive fun Project.test(init: TestConfig.() -> Unit): TestConfig = let { project -> with(testConfigs) { diff --git a/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/internal/GenericRunner.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/internal/GenericRunner.kt index f35b6e26..2dcea900 100644 --- a/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/internal/GenericRunner.kt +++ b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/internal/GenericRunner.kt @@ -142,7 +142,7 @@ abstract class GenericTestRunner: ITestRunnerContributor { */ @VisibleForTesting fun calculateAllJvmArgs(project: Project, context: KobaltContext, - testConfig: TestConfig, classpath: List, pluginInfo: IPluginInfo) : List { + testConfig: TestConfig, classpath: List, pluginInfo: IPluginInfo) : List { // Default JVM args val jvmFlags = arrayListOf().apply { addAll(testConfig.jvmArgs)