1
0
Fork 0
mirror of https://github.com/ethauvin/kobalt.git synced 2025-04-26 16:28:12 -07:00
kobalt/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/TestDirective.kt
2016-01-05 02:52:16 +04:00

36 lines
852 B
Kotlin

package com.beust.kobalt
import com.beust.kobalt.api.Project
import com.beust.kobalt.api.annotation.Directive
class TestConfig(val project: Project) {
val testArgs = arrayListOf<String>()
val jvmArgs = arrayListOf<String>()
val testIncludes = arrayListOf("**/*Test.class")
val testExcludes = arrayListOf<String>()
fun args(vararg arg: String) {
testArgs.addAll(arg)
}
fun jvmArgs(vararg arg: String) {
jvmArgs.addAll(arg)
}
fun includes(vararg arg: String) {
testIncludes.apply {
clear()
addAll(arg)
}
}
fun excludes(vararg arg: String) {
testExcludes.apply {
clear()
addAll(arg)
}
}
}
@Directive
fun Project.test(init: TestConfig.() -> Unit) = this.testConfigs.add(TestConfig(this).apply { init() })