Added examples to main build file.
This commit is contained in:
parent
c4a59b86c3
commit
f823f3be8c
14 changed files with 135 additions and 42 deletions
40
kobalt/Build.kt.iml
Normal file
40
kobalt/Build.kt.iml
Normal file
|
@ -0,0 +1,40 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module external.linked.project.id="Build.kt" external.linked.project.path="$MODULE_DIR$/.." external.root.project.path="$MODULE_DIR$/.." external.system.id="KOBALT" type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="false">
|
||||
<output url="file://$MODULE_DIR$/../kobaltBuild/classes" />
|
||||
<output-test url="file://$MODULE_DIR$/../kobaltBuild/test-classes" />
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="module-library">
|
||||
<library name="Kobalt: kobalt-versioneye-0.4.3-beta.jar">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.kobalt/cache/net/thauvin/erik/kobalt-versioneye/0.4.3-beta/kobalt-versioneye-0.4.3-beta.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library">
|
||||
<library name="Kobalt: kobalt-exec-0.6.3.jar">
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/../kobaltBuild/libs/kobalt-exec-0.6.3.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library">
|
||||
<library name="Kobalt: com.beust.kobalt:kobalt:jar:1.0.5">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.kobalt/wrapper/dist/kobalt-1.0.5/kobalt/wrapper/kobalt-1.0.5.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
</component>
|
||||
</module>
|
|
@ -1,15 +1,29 @@
|
|||
import com.beust.kobalt.buildScript
|
||||
import com.beust.kobalt.file
|
||||
import com.beust.kobalt.misc.kobaltLog
|
||||
import com.beust.kobalt.plugin.application.application
|
||||
import com.beust.kobalt.plugin.packaging.assemble
|
||||
import com.beust.kobalt.plugin.publish.bintray
|
||||
import com.beust.kobalt.project
|
||||
import net.thauvin.erik.kobalt.plugin.exec.Os
|
||||
import net.thauvin.erik.kobalt.plugin.exec.exec
|
||||
import net.thauvin.erik.kobalt.plugin.versioneye.versionEye
|
||||
import org.apache.maven.model.Developer
|
||||
import org.apache.maven.model.License
|
||||
import org.apache.maven.model.Model
|
||||
import org.apache.maven.model.Scm
|
||||
|
||||
val semver = "0.6.3"
|
||||
|
||||
val bs = buildScript {
|
||||
plugins("net.thauvin.erik:kobalt-versioneye:")
|
||||
val f = java.io.File("kobaltBuild/libs/kobalt-exec-$semver.jar")
|
||||
val p = if (f.exists()) {
|
||||
kobaltLog(1, " >>> Using: ${f.path}")
|
||||
file(f.path)
|
||||
} else {
|
||||
"net.thauvin.erik:kobalt-exec:"
|
||||
}
|
||||
plugins("net.thauvin.erik:kobalt-versioneye:", p)
|
||||
}
|
||||
|
||||
val dev = false
|
||||
|
@ -20,7 +34,7 @@ val p = project {
|
|||
name = "kobalt-exec"
|
||||
group = "net.thauvin.erik"
|
||||
artifactId = name
|
||||
version = "0.6.3"
|
||||
version = semver
|
||||
|
||||
pom = Model().apply {
|
||||
description = "Command Line Execution plug-in for the Kobalt build system."
|
||||
|
@ -71,3 +85,54 @@ val p = project {
|
|||
team = "Owners"
|
||||
}
|
||||
}
|
||||
|
||||
val example = project(p) {
|
||||
|
||||
name = "example"
|
||||
group = "com.example"
|
||||
artifactId = name
|
||||
version = "0.1"
|
||||
directory = ("example")
|
||||
|
||||
sourceDirectories {
|
||||
path("src/main/java")
|
||||
}
|
||||
|
||||
sourceDirectoriesTest {
|
||||
path("src/test/java")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
}
|
||||
|
||||
dependenciesTest {
|
||||
}
|
||||
|
||||
assemble {
|
||||
jar {
|
||||
}
|
||||
}
|
||||
|
||||
application {
|
||||
mainClass = "com.example.Main"
|
||||
}
|
||||
|
||||
exec {
|
||||
commandLine(listOf("echo", "Test Example 1"), os = setOf(Os.LINUX))
|
||||
commandLine(listOf("cmd", "/c", "echo", "Test Example 1"), os = setOf(Os.WINDOWS))
|
||||
commandLine(args = listOf("ls", "-l"), dir = "../libs", os = setOf(Os.LINUX))
|
||||
commandLine(args = listOf("cmd", "/c", "dir /Q"), dir = "../libs", os = setOf(Os.WINDOWS))
|
||||
}
|
||||
}
|
||||
|
||||
val example2 = project(p) {
|
||||
name = "example2"
|
||||
directory = "example"
|
||||
|
||||
exec {
|
||||
commandLine(listOf("cmd", "/c", "echo", "Test Example 2"), os = setOf(Os.WINDOWS))
|
||||
commandLine(listOf("echo", "Test example 2"), os = setOf(Os.LINUX))
|
||||
//commandLine(listOf("cmd", "/c", "tasklist | find \"cmd.exe\""), os = setOf(Os.WINDOWS), fail = setOf(Fail.NONE))
|
||||
commandLine(listOf("/bin/sh", "-c", "ps aux | grep bash"), os = setOf(Os.LINUX))
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1 +1 @@
|
|||
kobalt.version=1.0.3
|
||||
kobalt.version=1.0.5
|
Loading…
Add table
Add a link
Reference in a new issue