1
2 import com.beust.kobalt.TaskResult
3 import com.beust.kobalt.api.Project
4 import com.beust.kobalt.api.annotation.Task
5 import com.beust.kobalt.plugin.java.javaProject
6 import com.beust.kobalt.plugin.packaging.assemble
7 import com.beust.kobalt.plugins
8 import com.beust.kobalt.test
9 import java.io.File
10
11 //import com.beust.kobalt.plugin.linecount.*
12
13 val VERSION = "6.9.10-SNAPSHOT"
14
15 //val plugins = plugins("com.beust.kobalt:kobalt-line-count:0.17")
16
<lambda>null17 val p = javaProject {
18
19 // line
20 name = "testng"
21 group = "org.testng"
22 artifactId = name
23 version = VERSION
24
25 sourceDirectories {
26 path("src/generated/java")
27 }
28
29 dependencies {
30 compile("com.beust:jcommander:1.48",
31 "com.google.inject:guice:4.0",
32 "junit:junit:4.10",
33 "org.apache.ant:ant:1.7.0",
34 "org.beanshell:bsh:2.0b4",
35 "org.yaml:snakeyaml:1.15")
36 }
37
38 dependenciesTest {
39 compile("org.assertj:assertj-core:2.0.0",
40 "org.testng:testng:6.9.9")
41 }
42
43 test {
44 jvmArgs("-Dtest.resources.dir=src/test/resources")
45 }
46
47 assemble {
48 jar {
49 }
50 }
51 }
52
53 @Task(name = "createVersion", runBefore = arrayOf("compile"), runAfter = arrayOf("clean"), description = "")
taskCreateVersionnull54 fun taskCreateVersion(project: Project) : TaskResult {
55 val path = "org/testng/internal"
56 with(arrayListOf<String>()) {
57 File("src/main/resources/$path/VersionTemplateJava").forEachLine {
58 add(it.replace("@version@", VERSION))
59 }
60 File("src/generated/java/$path/Version.java").writeText(joinToString("\n"))
61 }
62 return TaskResult()
63 }
64
65