mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-26 08:27:12 -07:00
Move the test directive out of internal.
This commit is contained in:
parent
2171d06e18
commit
23d91087aa
3 changed files with 19 additions and 16 deletions
|
@ -1,7 +1,6 @@
|
|||
|
||||
import com.beust.kobalt.*
|
||||
import com.beust.kobalt.api.*
|
||||
import com.beust.kobalt.internal.*
|
||||
import com.beust.kobalt.plugin.application.application
|
||||
import com.beust.kobalt.plugin.java.javaCompiler
|
||||
import com.beust.kobalt.plugin.java.javaProject
|
||||
|
|
19
src/main/kotlin/com/beust/kobalt/TestDirective.kt
Normal file
19
src/main/kotlin/com/beust/kobalt/TestDirective.kt
Normal file
|
@ -0,0 +1,19 @@
|
|||
package com.beust.kobalt
|
||||
|
||||
import com.beust.kobalt.api.Project
|
||||
import com.beust.kobalt.api.annotation.Directive
|
||||
|
||||
class TestConfig(val project: Project) {
|
||||
fun args(vararg arg: String) {
|
||||
project.testArgs.addAll(arg)
|
||||
}
|
||||
}
|
||||
|
||||
@Directive
|
||||
fun Project.test(init: TestConfig.() -> Unit) : TestConfig {
|
||||
val result = TestConfig(this)
|
||||
result.init()
|
||||
return result
|
||||
}
|
||||
|
||||
|
|
@ -4,7 +4,6 @@ import com.beust.kobalt.TaskResult
|
|||
import com.beust.kobalt.api.BasePlugin
|
||||
import com.beust.kobalt.api.KobaltContext
|
||||
import com.beust.kobalt.api.Project
|
||||
import com.beust.kobalt.api.annotation.Directive
|
||||
import com.beust.kobalt.api.annotation.ExportedProperty
|
||||
import com.beust.kobalt.api.annotation.Task
|
||||
import com.beust.kobalt.maven.*
|
||||
|
@ -126,17 +125,3 @@ abstract class JvmCompilerPlugin @Inject constructor(
|
|||
compilerArgs.addAll(args)
|
||||
}
|
||||
}
|
||||
|
||||
class TestConfig(val project: Project) {
|
||||
fun args(vararg arg: String) {
|
||||
project.testArgs.addAll(arg)
|
||||
}
|
||||
}
|
||||
|
||||
@Directive
|
||||
fun Project.test(init: TestConfig.() -> Unit) : TestConfig {
|
||||
val result = TestConfig(this)
|
||||
result.init()
|
||||
return result
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue