From d990c6d5983008743ceae98ea385c656dc6f4c0b Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Fri, 28 Apr 2017 00:24:10 -0700 Subject: [PATCH 01/17] Added clean for testing. --- clean.sh | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 clean.sh diff --git a/clean.sh b/clean.sh new file mode 100644 index 0000000..552252d --- /dev/null +++ b/clean.sh @@ -0,0 +1,37 @@ +#!/bin/bash + +DEBUG=false + +rm="rm -rf" + +if [ "$DEBUG" = true ]; then + rm="echo rm -rf" +fi + +buildkt="kobalt/src/Build.kt" + +name=$(cat $buildkt | grep -m 1 "name = " | cut -d"\"" -f 2) +group=$(cat $buildkt | grep -m 1 "group = " | cut -d"\"" -f 2) + +if [ -z "$1" ]; then + version=$(cat $buildkt | grep -m 1 "version = " | cut -d"\"" -f 2) +else + version="$1" +fi + +maven="/k/maven/repository/${group//.//}/${name}/${version}" +kobalt="$HOME/.kobalt/cache/${group//.//}/${name}/${version}" +localRepo="$HOME/.kobalt/localMavenRepo/${group//.//}/${name}/${version}" + +read -p "Delete version ${version}? " -n 1 -r +echo +if [[ $REPLY =~ ^[Yy]$ ]]; then + for dir in "$kobalt" "$maven" "$localRepo"; do + if [ -d "$dir" ]; then + echo -e "Deleting : \e[32;1m$dir\e[0m" + $rm "$dir" + else + echo -e "Not Found: \e[31;1m$dir\e[0m" + fi + done +fi \ No newline at end of file From 395fa127b966610b86593be001c96d36ce8bc556 Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Fri, 28 Apr 2017 00:26:04 -0700 Subject: [PATCH 02/17] Added taskName, dependsOn. Changed commandLine(args) from List to vararg. --- README.md | 62 ++++++++++++++----- example/kobalt/src/Build.kt | 38 +++++++----- kobalt/src/Build.kt | 14 +++-- .../erik/kobalt/plugin/exec/ExecPlugin.kt | 29 +++++---- 4 files changed, 97 insertions(+), 46 deletions(-) diff --git a/README.md b/README.md index 6ee4f49..696bd73 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ val p = project { name = "example" exec { - commandLine(listOf("echo", "Hello, World!")) + commandLine("echo", "Hello, World!") } } ``` @@ -35,9 +35,9 @@ The `commandLine` directive is used to execute command line(s) during the build ```kotlin exec { - commandLine(listOf("cmd", "/c", "stop.bat"), dir = "../tomcat/bin", os = setOf(Os.WINDOWS)) - commandLine(listOf("./stop.sh"), dir = "../tomcat/bin", os = setOf(Os.MAC, Os.LINUX)) - commandLine(listOf("/bin/sh", "-c", "ps aux | grep tomcat"), fail = setOf(Fail.EXIT)) + commandLine("cmd", "/c", "stop.bat", dir = "../tomcat/bin", os = setOf(Os.WINDOWS)) + commandLine("./stop.sh", dir = "../tomcat/bin", os = setOf(Os.MAC, Os.LINUX)) + commandLine("/bin/sh", "-c", "ps aux | grep tomcat", fail = setOf(Fail.EXIT)) } ``` @@ -45,12 +45,13 @@ exec { ### `args` -The full command line including the executable and all parameters. +The full command line arguments including the executable and all parameters. ```kotlin exec { - commandLine(listOf("ls", "-l")) - commandLine(args = listOf("cmd", "/c", "dir /Q")) + commandLine(args="ls") + commandLine("ls", "-l") + commandLine("cmd", "/c", "dir /Q") } ``` @@ -60,7 +61,7 @@ The working directory in which the command should be executed. Defaults to the p ```kotlin exec { - commandLine(listOf("cmd", "/c", "stop.bat"), dir = "../tomcat/bin") + commandLine("cmd", "/c", "stop.bat", dir = "../tomcat/bin") commandLine("./stop.sh", dir = "../tomcat/bin") } ``` @@ -85,8 +86,8 @@ Name | Operating System ```kotlin exec { - commandLine(listOf("cmd", "/c", "stop.cmd"), os = setOf(Os.WINDOWS)) - commandLine(listOf("./stop.sh"), os = setOf(Os.LINUX, Os.MAC)) + commandLine("cmd", "/c", "stop.cmd", os = setOf(Os.WINDOWS)) + commandLine("./stop.sh", os = setOf(Os.LINUX, Os.MAC)) } ``` @@ -110,8 +111,41 @@ Name | Failure When ```kotlin exec { - commandLine(listOf("cmd", "/c", "stop.bat"), fail = setOf(Fail.EXIT)) - commandLine(listOf("./stop.sh"), fail = setOf(Fail.EXIT, Fail.STDOUT)) + commandLine("cmd", "/c", "stop.bat", fail = setOf(Fail.EXIT)) + commandLine("./stop.sh", fail = setOf(Fail.EXIT, Fail.STDOUT)) +} +``` + +## taskName + +Additionally, you can specify a task name to easily identify multiple `exec` directives. + +```kotlin +exec { + taskName = "start" + commandLine("./start.sh", os = setOf(Os.LINUX, Os.MAC)) +} + +exec { + taskName = "stop" + commandLine("./stop.sh", os = setOf(Os.LINUX, Os.MAC)) +} +``` + +```shell +./kobaltw start +./kobaltw stop +``` + +## dependsOn + + +By default the `exec` task depends on `assemble`, use the `dependsOn` parameter to change the dependencies: + +```kotlin +exec { + dependsOn = listOf("assemble", "run") + commandLine("cmd", "/c", "start.bat", fail = setOf(Fail.EXIT)) } ``` @@ -125,8 +159,8 @@ You could also redirect the error stream to a file: ```kotlin exec { - commandLine(listOf("/bin/sh", "-c", "./stop.sh 2> error.txt"), os = setOf(Os.LINUX)) - commandLine(listOf("cmd", "/c", "stop.bat 2> error.txt"), os = setOf(Os.WINDOWS)) + commandLine("/bin/sh", "-c", "./stop.sh 2> error.txt", os = setOf(Os.LINUX)) + commandLine("cmd", "/c", "stop.bat 2> error.txt", os = setOf(Os.WINDOWS)) } ``` diff --git a/example/kobalt/src/Build.kt b/example/kobalt/src/Build.kt index f3372f2..457ceac 100644 --- a/example/kobalt/src/Build.kt +++ b/example/kobalt/src/Build.kt @@ -3,13 +3,14 @@ import com.beust.kobalt.plugin.application.* import com.beust.kobalt.plugin.packaging.* import net.thauvin.erik.kobalt.plugin.exec.* +// ./kobaltw exec echo ps --log 2 // ./kobaltw exec --log 2 -// ./kobaltw example:exec --log 2 -// ./kobaltw example2:exec --log 2 +// ./kobaltw echo --log 2 +// ./kobaltw ps --log 2 val bs = buildScript { - //repos(file("K:/maven/repository")) - plugins("net.thauvin.erik:kobalt-exec:") + repos(file("K:/maven/repository")) + plugins("net.thauvin.erik:kobalt-exec:0.6.6") } val example = project { @@ -29,20 +30,23 @@ val example = project { } 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)) + commandLine("echo", "Test Example 1", os = setOf(Os.LINUX)) + commandLine("cmd", "/c", "echo", "Test Example 1", os = setOf(Os.WINDOWS)) + commandLine("ls", "-l", dir = "../libs", os = setOf(Os.LINUX)) + commandLine("cmd", "/c", "dir /Q", dir = "../libs", os = setOf(Os.WINDOWS)) } -} - -val example2 = project { - name = "example2" 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)) + taskName = "echo" + dependsOn = listOf("exec", "run") + commandLine("cmd", "/c", "echo", "Test Example 2", os = setOf(Os.WINDOWS)) + commandLine("echo", "Test example 2", os = setOf(Os.LINUX)) } -} + + exec { + taskName = "ps" + dependsOn = listOf() // no dependencies + commandLine("cmd", "/c", "tasklist | find \"cmd.exe\"", os = setOf(Os.WINDOWS), fail = setOf(Fail.NONE)) + commandLine("/bin/sh", "-c", "ps aux | grep bash", os = setOf(Os.LINUX)) + } +} \ No newline at end of file diff --git a/kobalt/src/Build.kt b/kobalt/src/Build.kt index 79929cc..121e8c0 100644 --- a/kobalt/src/Build.kt +++ b/kobalt/src/Build.kt @@ -1,10 +1,16 @@ -import com.beust.kobalt.* +import com.beust.kobalt.buildScript +import com.beust.kobalt.file import com.beust.kobalt.plugin.packaging.assemble import com.beust.kobalt.plugin.publish.autoGitTag import com.beust.kobalt.plugin.publish.bintray +import com.beust.kobalt.profile +import com.beust.kobalt.project import net.thauvin.erik.kobalt.plugin.versioneye.versionEye -import org.apache.maven.model.* +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 bs = buildScript { repos(file("K:/maven/repository")) @@ -19,7 +25,7 @@ val p = project { name = "kobalt-exec" group = "net.thauvin.erik" artifactId = name - version = "0.6.5" + version = "0.6.6" pom = Model().apply { description = "Command Line Execution plug-in for the Kobalt build system." @@ -41,7 +47,7 @@ val p = project { } dependencies { - compile("com.beust:$kobaltDependency:") + compileOnly("com.beust:$kobaltDependency:") } dependenciesTest { diff --git a/src/main/kotlin/net/thauvin/erik/kobalt/plugin/exec/ExecPlugin.kt b/src/main/kotlin/net/thauvin/erik/kobalt/plugin/exec/ExecPlugin.kt index 94eb440..066c695 100644 --- a/src/main/kotlin/net/thauvin/erik/kobalt/plugin/exec/ExecPlugin.kt +++ b/src/main/kotlin/net/thauvin/erik/kobalt/plugin/exec/ExecPlugin.kt @@ -44,8 +44,8 @@ import java.util.* import java.util.concurrent.TimeUnit @Singleton -class ExecPlugin @Inject constructor(val configActor: ConfigActor) : - BasePlugin(), ITaskContributor, IConfigActor by configActor { +class ExecPlugin @Inject constructor(val taskContributor: TaskContributor, val configActor: ConfigsActor) : + BasePlugin(), ITaskContributor, IConfigsActor by configActor { // ITaskContributor override fun tasksFor(project: Project, context: KobaltContext): List { return emptyList() @@ -57,14 +57,19 @@ class ExecPlugin @Inject constructor(val configActor: ConfigActor) : override val name = NAME - @Suppress("unused") - @Task(name = "exec", description = "Execute a command line process.") - fun taskExec(project: Project): TaskResult { - configurationFor(project)?.let { config -> - return executeCommands(project, config) + override fun apply(project: Project, context: KobaltContext) { + configurationFor(project)?.let { configs -> + configs.forEach { config -> + taskManager.addTask(this, project, config.taskName, + description = "Execute a command line process.", + group = "Other", + dependsOn = config.dependsOn, + task = { executeCommands(project, config) }) + taskContributor.addVariantTasks(this, project, context, config.taskName, + dependsOn = config.dependsOn, + runTask = { executeCommands(project, config) }) + } } - - return TaskResult() } private fun matchOs(os: Os): Boolean { @@ -187,12 +192,14 @@ data class CommandLine(var args: List = emptyList(), var dir: String = " @Directive class ExecConfig { + var taskName: String = "exec" val commandLines = arrayListOf() + var dependsOn = listOf("assemble") @Suppress("unused") - fun commandLine(args: List = emptyList(), dir: String = "", os: Set = emptySet(), + fun commandLine(vararg args: String, dir: String = "", os: Set = emptySet(), fail: Set = setOf(Fail.NORMAL)) { - if (args.isNotEmpty()) commandLines.add(CommandLine(args, dir, os, fail)) + if (args.isNotEmpty()) commandLines.add(CommandLine(listOf(*args), dir, os, fail)) } } From 9fb31c09e502977a6cd2c6ad18e184d627adeffd Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Fri, 28 Apr 2017 10:55:59 -0700 Subject: [PATCH 03/17] Added Cygwin, MinGW and MSYS support. --- README.md | 12 ++++++------ .../thauvin/erik/kobalt/plugin/exec/ExecPlugin.kt | 14 +++++++++++++- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 696bd73..610c40f 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ exec { ### `args` -The full command line arguments including the executable and all parameters. +The full command line including the executable and all arguments. ```kotlin exec { @@ -74,9 +74,12 @@ The following predefined values are available: Name | Operating System --------------|----------------------- +`Os.CYGWIN` | Cygwin `Os.FREEBSD` | FreeBSD `Os.LINUX` | Linux `Os.MAC` | Apple Macintosh / OS X +`Os.MINGW` | Minimalist GNU for Windows +`OS.MSYS` | MSYS `Os.OPENVMS` | OpenVMS `Os.OS400` | OS/400 `Os.SOLARIS` | Solaris / SunOS @@ -118,7 +121,7 @@ exec { ## taskName -Additionally, you can specify a task name to easily identify multiple `exec` directives. +Additionally, you can specify a task name to easily identify multiple `exec` tasks. ```kotlin exec { @@ -162,7 +165,4 @@ exec { commandLine("/bin/sh", "-c", "./stop.sh 2> error.txt", os = setOf(Os.LINUX)) commandLine("cmd", "/c", "stop.bat 2> error.txt", os = setOf(Os.WINDOWS)) } -``` - - - +``` \ No newline at end of file diff --git a/src/main/kotlin/net/thauvin/erik/kobalt/plugin/exec/ExecPlugin.kt b/src/main/kotlin/net/thauvin/erik/kobalt/plugin/exec/ExecPlugin.kt index 066c695..ac5f138 100644 --- a/src/main/kotlin/net/thauvin/erik/kobalt/plugin/exec/ExecPlugin.kt +++ b/src/main/kotlin/net/thauvin/erik/kobalt/plugin/exec/ExecPlugin.kt @@ -102,6 +102,18 @@ class ExecPlugin @Inject constructor(val taskContributor: TaskContributor, val c Os.OS400 -> { return curOs.contains("os/400") } + Os.CYGWIN -> { + val cygwin: String? = System.getenv("ORIGINAL_PATH") + return cygwin?.contains("/cygdrive/") ?: false + } + Os.MINGW -> { + val mingw: String? = System.getenv("MSYSTEM") + return mingw?.startsWith("MINGW") ?: false + } + Os.MSYS -> { + val msys: String? = System.getenv("MSYSTEM") + return msys?.startsWith("MSYS") ?: false + } } } @@ -184,7 +196,7 @@ enum class Fail { } enum class Os { - FREEBSD, LINUX, MAC, OPENVMS, OS400, SOLARIS, TANDEM, WINDOWS, ZOS + CYGWIN, FREEBSD, LINUX, MAC, MINGW, MSYS, OPENVMS, OS400, SOLARIS, TANDEM, WINDOWS, ZOS } data class CommandLine(var args: List = emptyList(), var dir: String = "", var os: Set = emptySet(), From 3007041be4dafe5897bab14e5fc68b8aa6b80047 Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Fri, 28 Apr 2017 20:19:48 -0700 Subject: [PATCH 04/17] Cleaned up examples. --- README.md | 2 +- example/kobalt/src/Build.kt | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 610c40f..3fbfd9a 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ The full command line including the executable and all arguments. ```kotlin exec { - commandLine(args="ls") + commandLine(args = "ls") commandLine("ls", "-l") commandLine("cmd", "/c", "dir /Q") } diff --git a/example/kobalt/src/Build.kt b/example/kobalt/src/Build.kt index 457ceac..2858ecf 100644 --- a/example/kobalt/src/Build.kt +++ b/example/kobalt/src/Build.kt @@ -30,17 +30,19 @@ val example = project { } exec { - commandLine("echo", "Test Example 1", os = setOf(Os.LINUX)) - commandLine("cmd", "/c", "echo", "Test Example 1", os = setOf(Os.WINDOWS)) - commandLine("ls", "-l", dir = "../libs", os = setOf(Os.LINUX)) - commandLine("cmd", "/c", "dir /Q", dir = "../libs", os = setOf(Os.WINDOWS)) + commandLine("echo", "Test Example 1", os = setOf(Os.LINUX, Os.MINGW, Os.CYGWIN)) + commandLine("cmd", "/c", "echo", "Test", "Example", "1", os = setOf(Os.WINDOWS)) + commandLine("ls", "-l", dir = "../kobalt/wrapper", os = setOf(Os.LINUX, Os.MINGW, Os.CYGWIN)) + commandLine("cmd", "/c", "dir /Q", dir = "../kobalt/wrapper", os = setOf(Os.WINDOWS)) } exec { taskName = "echo" dependsOn = listOf("exec", "run") - commandLine("cmd", "/c", "echo", "Test Example 2", os = setOf(Os.WINDOWS)) - commandLine("echo", "Test example 2", os = setOf(Os.LINUX)) + + val echo = arrayOf("echo", "Test", "Example", "2") + commandLine("cmd", "/c", *echo, os = setOf(Os.WINDOWS)) + commandLine(*echo, os = setOf(Os.LINUX, Os.MINGW, Os.CYGWIN)) } exec { From 6530e8f7be41bb1ac2f3c650f1e9ff4ea79a71cc Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Fri, 28 Apr 2017 20:20:47 -0700 Subject: [PATCH 05/17] Kobalt 1.0.78 update. --- .idea/encodings.xml | 6 + .idea/inspectionProfiles/Project_Default.xml | 10 +- .idea/kobalt.xml | 4 +- .idea/kotlinc.xml | 7 - .idea/misc.xml | 115 ++++- .idea/modules.xml | 1 - .idea/vcs.xml | 2 - example/kobalt/Build.kt.iml | 31 -- .../kobalt/wrapper/kobalt-wrapper.properties | 2 +- kobalt-exec.iml | 403 +----------------- kobalt/Build.kt.iml | 17 +- kobalt/wrapper/kobalt-wrapper.properties | 2 +- 12 files changed, 141 insertions(+), 459 deletions(-) create mode 100644 .idea/encodings.xml delete mode 100644 .idea/kotlinc.xml delete mode 100644 example/kobalt/Build.kt.iml diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..97626ba --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml index 17b1e81..8ff795e 100644 --- a/.idea/inspectionProfiles/Project_Default.xml +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -1,9 +1,8 @@ diff --git a/.idea/kobalt.xml b/.idea/kobalt.xml index 07b6593..4a291e6 100644 --- a/.idea/kobalt.xml +++ b/.idea/kobalt.xml @@ -4,13 +4,15 @@ diff --git a/.idea/kotlinc.xml b/.idea/kotlinc.xml deleted file mode 100644 index 1c24f9a..0000000 --- a/.idea/kotlinc.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index f1a9bb1..350d029 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,4 +1,117 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Java + + + Portability issuesJava + + + + + Android + + + + + + + + + + + + + commons-logging-api + + + + + + + + 1.8.x + + + + + + + + 1.8.x + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml index cc61fa9..48f8f9e 100644 --- a/.idea/modules.xml +++ b/.idea/modules.xml @@ -3,7 +3,6 @@ - diff --git a/.idea/vcs.xml b/.idea/vcs.xml index d175698..94a25f7 100644 --- a/.idea/vcs.xml +++ b/.idea/vcs.xml @@ -2,7 +2,5 @@ - - \ No newline at end of file diff --git a/example/kobalt/Build.kt.iml b/example/kobalt/Build.kt.iml deleted file mode 100644 index d022bf6..0000000 --- a/example/kobalt/Build.kt.iml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/example/kobalt/wrapper/kobalt-wrapper.properties b/example/kobalt/wrapper/kobalt-wrapper.properties index 02e723d..e945989 100644 --- a/example/kobalt/wrapper/kobalt-wrapper.properties +++ b/example/kobalt/wrapper/kobalt-wrapper.properties @@ -1 +1 @@ -kobalt.version=1.0.75 \ No newline at end of file +kobalt.version=1.0.80 \ No newline at end of file diff --git a/kobalt-exec.iml b/kobalt-exec.iml index d3359c4..78aa9b9 100644 --- a/kobalt-exec.iml +++ b/kobalt-exec.iml @@ -21,15 +21,6 @@ - - - - - - - - - @@ -39,402 +30,14 @@ - - + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/kobalt/Build.kt.iml b/kobalt/Build.kt.iml index db31b14..a3bb3a5 100644 --- a/kobalt/Build.kt.iml +++ b/kobalt/Build.kt.iml @@ -10,32 +10,33 @@ - + - + - + - + - + + + - + - + - \ No newline at end of file diff --git a/kobalt/wrapper/kobalt-wrapper.properties b/kobalt/wrapper/kobalt-wrapper.properties index 02e723d..e945989 100644 --- a/kobalt/wrapper/kobalt-wrapper.properties +++ b/kobalt/wrapper/kobalt-wrapper.properties @@ -1 +1 @@ -kobalt.version=1.0.75 \ No newline at end of file +kobalt.version=1.0.80 \ No newline at end of file From 43d55803a9c14ebb0fe3e3f88ed050993c1585fc Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Sat, 29 Apr 2017 17:11:06 -0700 Subject: [PATCH 06/17] Changed Os.WINDOWS to no longer include Cygwin, MinGW or MSYS. --- README.md | 7 +++- example/kobalt/src/Build.kt | 6 +-- .../erik/kobalt/plugin/exec/ExecPlugin.kt | 38 +++++++++++++++---- 3 files changed, 37 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 3fbfd9a..ac86546 100644 --- a/README.md +++ b/README.md @@ -84,9 +84,11 @@ Name | Operating System `Os.OS400` | OS/400 `Os.SOLARIS` | Solaris / SunOS `Os.TANDEM` | Tandem's Non-Stop -`Os.WINDOWS` | Microsoft Windows +`Os.WINDOWS` | Microsoft Windows* `Os.ZOS` | z/OS / OS/390 +* Not including Cygwin, MinGW or MSYS. + ```kotlin exec { commandLine("cmd", "/c", "stop.cmd", os = setOf(Os.WINDOWS)) @@ -135,7 +137,7 @@ exec { } ``` -```shell +```sh ./kobaltw start ./kobaltw stop ``` @@ -155,6 +157,7 @@ exec { ## Logging / Debugging To view the output of the `exec` task, use: + ```sh ./kobaltw exec --log 2 ``` diff --git a/example/kobalt/src/Build.kt b/example/kobalt/src/Build.kt index 2858ecf..a9dfbb1 100644 --- a/example/kobalt/src/Build.kt +++ b/example/kobalt/src/Build.kt @@ -30,8 +30,6 @@ val example = project { } exec { - commandLine("echo", "Test Example 1", os = setOf(Os.LINUX, Os.MINGW, Os.CYGWIN)) - commandLine("cmd", "/c", "echo", "Test", "Example", "1", os = setOf(Os.WINDOWS)) commandLine("ls", "-l", dir = "../kobalt/wrapper", os = setOf(Os.LINUX, Os.MINGW, Os.CYGWIN)) commandLine("cmd", "/c", "dir /Q", dir = "../kobalt/wrapper", os = setOf(Os.WINDOWS)) } @@ -40,7 +38,7 @@ val example = project { taskName = "echo" dependsOn = listOf("exec", "run") - val echo = arrayOf("echo", "Test", "Example", "2") + val echo = arrayOf("echo", "Test", "Example") commandLine("cmd", "/c", *echo, os = setOf(Os.WINDOWS)) commandLine(*echo, os = setOf(Os.LINUX, Os.MINGW, Os.CYGWIN)) } @@ -49,6 +47,6 @@ val example = project { taskName = "ps" dependsOn = listOf() // no dependencies commandLine("cmd", "/c", "tasklist | find \"cmd.exe\"", os = setOf(Os.WINDOWS), fail = setOf(Fail.NONE)) - commandLine("/bin/sh", "-c", "ps aux | grep bash", os = setOf(Os.LINUX)) + commandLine("sh", "-c", "ps aux | grep bash", os = setOf(Os.LINUX, Os.MINGW, Os.CYGWIN)) } } \ No newline at end of file diff --git a/src/main/kotlin/net/thauvin/erik/kobalt/plugin/exec/ExecPlugin.kt b/src/main/kotlin/net/thauvin/erik/kobalt/plugin/exec/ExecPlugin.kt index ac5f138..d21bb39 100644 --- a/src/main/kotlin/net/thauvin/erik/kobalt/plugin/exec/ExecPlugin.kt +++ b/src/main/kotlin/net/thauvin/erik/kobalt/plugin/exec/ExecPlugin.kt @@ -76,7 +76,11 @@ class ExecPlugin @Inject constructor(val taskContributor: TaskContributor, val c val curOs: String = System.getProperty("os.name").toLowerCase(Locale.US) when (os) { Os.WINDOWS -> { - return curOs.contains("windows") + if (!isMinGW(any = true) && !isCygwin()) { + return curOs.contains("windows") + } else { + return false + } } Os.MAC -> { return (curOs.contains("mac") || curOs.contains("darwin") || curOs.contains("osx")) @@ -103,20 +107,38 @@ class ExecPlugin @Inject constructor(val taskContributor: TaskContributor, val c return curOs.contains("os/400") } Os.CYGWIN -> { - val cygwin: String? = System.getenv("ORIGINAL_PATH") - return cygwin?.contains("/cygdrive/") ?: false + return isCygwin() } Os.MINGW -> { - val mingw: String? = System.getenv("MSYSTEM") - return mingw?.startsWith("MINGW") ?: false + return isMinGW() } Os.MSYS -> { - val msys: String? = System.getenv("MSYSTEM") - return msys?.startsWith("MSYS") ?: false + return isMinGW(Os.MSYS) } } } + private fun isCygwin() : Boolean { + val path: String? = System.getenv("ORIGINAL_PATH") + return path?.contains("/cygdrive/") ?: false + } + + private fun isMinGW(os: Os = Os.MINGW, any: Boolean = false) : Boolean { + val msys: String? = System.getenv("MSYSTEM") + + if (!msys.isNullOrBlank()) { + if (any) { + return true + } else if (os.equals(Os.MSYS)) { + return msys!!.startsWith("MSYS") + } else if (os.equals(Os.MINGW)) { + return msys!!.startsWith("MINGW") + } + } + + return false + } + private fun executeCommands(project: Project, config: ExecConfig): TaskResult { var success = true val errorMessage = StringBuilder() @@ -132,7 +154,7 @@ class ExecPlugin @Inject constructor(val taskContributor: TaskContributor, val c } } if (execute) { - log(2, "> " + args.joinToString(" ")) + log(2, (if (!wrkDir.name.equals(".")) wrkDir.name else "") + "> " + args.joinToString(" ")) val pb = ProcessBuilder().command(args.toList()) pb.directory(wrkDir) val proc = pb.start() From a55d7f34eb98812615e1c5df45bb61fa73ffa1cc Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Sat, 29 Apr 2017 18:55:11 -0700 Subject: [PATCH 07/17] Cleanup. --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index ac86546..8ed85eb 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ The `commandLine` directive is used to execute command line(s) during the build exec { commandLine("cmd", "/c", "stop.bat", dir = "../tomcat/bin", os = setOf(Os.WINDOWS)) commandLine("./stop.sh", dir = "../tomcat/bin", os = setOf(Os.MAC, Os.LINUX)) - commandLine("/bin/sh", "-c", "ps aux | grep tomcat", fail = setOf(Fail.EXIT)) + commandLine("sh", "-c", "ps aux | grep tomcat", fail = setOf(Fail.EXIT)) } ``` @@ -73,13 +73,13 @@ List of operating systems on which the command may be executed. If the current O The following predefined values are available: Name | Operating System ---------------|----------------------- -`Os.CYGWIN` | Cygwin +:-------------|:------------------------- +`Os.CYGWIN` | Cygwin for Windows `Os.FREEBSD` | FreeBSD `Os.LINUX` | Linux `Os.MAC` | Apple Macintosh / OS X `Os.MINGW` | Minimalist GNU for Windows -`OS.MSYS` | MSYS +`OS.MSYS` | MinGW Minimal System `Os.OPENVMS` | OpenVMS `Os.OS400` | OS/400 `Os.SOLARIS` | Solaris / SunOS @@ -91,7 +91,7 @@ Name | Operating System ```kotlin exec { - commandLine("cmd", "/c", "stop.cmd", os = setOf(Os.WINDOWS)) + commandLine("cmd", "/c", "stop.bat", os = setOf(Os.WINDOWS)) commandLine("./stop.sh", os = setOf(Os.LINUX, Os.MAC)) } ``` @@ -103,7 +103,7 @@ List of error options to specify whether data returned to the standard streams a The following predefined values are available: Name | Failure When ---------------|----------------------------------------------------------------- +:-------------|:---------------------------------------------------------------- `Fail.EXIT` | Exit value > 0 `Fail.NORMAL` | Exit value > 0 or any data to the standard error stream (stderr) `Fail.OUTPUT` | Any data to the standard output stream (stdout) or stderr. From 5672ad96b06ec684fca78db781e6cd1df7fca63c Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Sat, 29 Apr 2017 23:05:22 -0700 Subject: [PATCH 08/17] Examples cleanup. --- README.md | 5 +++-- example/kobalt/src/Build.kt | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 8ed85eb..527f34e 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,8 @@ The `commandLine` directive is used to execute command line(s) during the build exec { commandLine("cmd", "/c", "stop.bat", dir = "../tomcat/bin", os = setOf(Os.WINDOWS)) commandLine("./stop.sh", dir = "../tomcat/bin", os = setOf(Os.MAC, Os.LINUX)) - commandLine("sh", "-c", "ps aux | grep tomcat", fail = setOf(Fail.EXIT)) + commandLine("sh", "-c", "ps aux | grep tomcat", os = setOf(Os.MAC, Os.LINUX), fail = setOf(Fail.EXIT)) + commandLine("cmd", "/c", "tasklist | find \"tomcat\"", os = setOf(Os.WINDOWS), fail = setOf(Fail.EXIT)) } ``` @@ -165,7 +166,7 @@ You could also redirect the error stream to a file: ```kotlin exec { - commandLine("/bin/sh", "-c", "./stop.sh 2> error.txt", os = setOf(Os.LINUX)) + commandLine("sh", "-c", "./stop.sh 2> error.txt", os = setOf(Os.LINUX)) commandLine("cmd", "/c", "stop.bat 2> error.txt", os = setOf(Os.WINDOWS)) } ``` \ No newline at end of file diff --git a/example/kobalt/src/Build.kt b/example/kobalt/src/Build.kt index a9dfbb1..a6ae3f1 100644 --- a/example/kobalt/src/Build.kt +++ b/example/kobalt/src/Build.kt @@ -39,14 +39,14 @@ val example = project { dependsOn = listOf("exec", "run") val echo = arrayOf("echo", "Test", "Example") - commandLine("cmd", "/c", *echo, os = setOf(Os.WINDOWS)) commandLine(*echo, os = setOf(Os.LINUX, Os.MINGW, Os.CYGWIN)) + commandLine("cmd", "/c", *echo, os = setOf(Os.WINDOWS)) } exec { taskName = "ps" dependsOn = listOf() // no dependencies - commandLine("cmd", "/c", "tasklist | find \"cmd.exe\"", os = setOf(Os.WINDOWS), fail = setOf(Fail.NONE)) commandLine("sh", "-c", "ps aux | grep bash", os = setOf(Os.LINUX, Os.MINGW, Os.CYGWIN)) + commandLine("cmd", "/c", "tasklist | find \"cmd.exe\"", os = setOf(Os.WINDOWS), fail = setOf(Fail.EXIT)) } } \ No newline at end of file From 0531a8a13924c10ea933ed4b884159aacfebc7f0 Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Sun, 30 Apr 2017 15:59:56 -0700 Subject: [PATCH 09/17] Formatting. --- .../erik/kobalt/plugin/exec/ExecPlugin.kt | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/src/main/kotlin/net/thauvin/erik/kobalt/plugin/exec/ExecPlugin.kt b/src/main/kotlin/net/thauvin/erik/kobalt/plugin/exec/ExecPlugin.kt index d21bb39..9dccff5 100644 --- a/src/main/kotlin/net/thauvin/erik/kobalt/plugin/exec/ExecPlugin.kt +++ b/src/main/kotlin/net/thauvin/erik/kobalt/plugin/exec/ExecPlugin.kt @@ -72,6 +72,27 @@ class ExecPlugin @Inject constructor(val taskContributor: TaskContributor, val c } } + private fun isCygwin(): Boolean { + val path: String? = System.getenv("ORIGINAL_PATH") + return path?.contains("/cygdrive/") ?: false + } + + private fun isMinGW(os: Os = Os.MINGW, any: Boolean = false): Boolean { + val msys: String? = System.getenv("MSYSTEM") + + if (!msys.isNullOrBlank()) { + if (any) { + return true + } else if (os.equals(Os.MSYS)) { + return msys!!.startsWith("MSYS") + } else if (os.equals(Os.MINGW)) { + return msys!!.startsWith("MINGW") + } + } + + return false + } + private fun matchOs(os: Os): Boolean { val curOs: String = System.getProperty("os.name").toLowerCase(Locale.US) when (os) { @@ -118,27 +139,6 @@ class ExecPlugin @Inject constructor(val taskContributor: TaskContributor, val c } } - private fun isCygwin() : Boolean { - val path: String? = System.getenv("ORIGINAL_PATH") - return path?.contains("/cygdrive/") ?: false - } - - private fun isMinGW(os: Os = Os.MINGW, any: Boolean = false) : Boolean { - val msys: String? = System.getenv("MSYSTEM") - - if (!msys.isNullOrBlank()) { - if (any) { - return true - } else if (os.equals(Os.MSYS)) { - return msys!!.startsWith("MSYS") - } else if (os.equals(Os.MINGW)) { - return msys!!.startsWith("MINGW") - } - } - - return false - } - private fun executeCommands(project: Project, config: ExecConfig): TaskResult { var success = true val errorMessage = StringBuilder() From 182b975b85cd5466584863e506ae103e6fd566e2 Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Sun, 30 Apr 2017 16:12:49 -0700 Subject: [PATCH 10/17] Clarified Os.WINDOWS exclusions. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 527f34e..bce8adc 100644 --- a/README.md +++ b/README.md @@ -88,7 +88,7 @@ Name | Operating System `Os.WINDOWS` | Microsoft Windows* `Os.ZOS` | z/OS / OS/390 -* Not including Cygwin, MinGW or MSYS. +* Excluding Cygwin, MinGW and MSYS. ```kotlin exec { From b0e025206bf8412856a4c022a81e938855a4ba81 Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Sun, 30 Apr 2017 16:14:03 -0700 Subject: [PATCH 11/17] Version 0.7.0 --- example/kobalt/src/Build.kt | 4 ++-- kobalt/src/Build.kt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/example/kobalt/src/Build.kt b/example/kobalt/src/Build.kt index a6ae3f1..16bf56d 100644 --- a/example/kobalt/src/Build.kt +++ b/example/kobalt/src/Build.kt @@ -9,8 +9,8 @@ import net.thauvin.erik.kobalt.plugin.exec.* // ./kobaltw ps --log 2 val bs = buildScript { - repos(file("K:/maven/repository")) - plugins("net.thauvin.erik:kobalt-exec:0.6.6") + //repos(file("K:/maven/repository")) + plugins("net.thauvin.erik:kobalt-exec:") } val example = project { diff --git a/kobalt/src/Build.kt b/kobalt/src/Build.kt index 121e8c0..2b2d815 100644 --- a/kobalt/src/Build.kt +++ b/kobalt/src/Build.kt @@ -25,7 +25,7 @@ val p = project { name = "kobalt-exec" group = "net.thauvin.erik" artifactId = name - version = "0.6.6" + version = "0.7.0" pom = Model().apply { description = "Command Line Execution plug-in for the Kobalt build system." From dc99641c3ecefd1e6274d7ae4b7613d8f19939da Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Mon, 29 May 2017 18:36:40 -0700 Subject: [PATCH 12/17] Kobalt 1.0.86 update. --- .idea/kobalt.xml | 2 +- .idea/misc.xml | 51 -- .../kobalt/wrapper/kobalt-wrapper.properties | 2 +- kobalt-exec.iml | 643 +++++++++++++++++- kobalt/Build.kt.iml | 22 +- kobalt/wrapper/kobalt-wrapper.properties | 2 +- 6 files changed, 655 insertions(+), 67 deletions(-) diff --git a/.idea/kobalt.xml b/.idea/kobalt.xml index 4a291e6..c71b85c 100644 --- a/.idea/kobalt.xml +++ b/.idea/kobalt.xml @@ -6,7 +6,7 @@ - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -39,5 +75,608 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kobalt/Build.kt.iml b/kobalt/Build.kt.iml index a3bb3a5..0098d0a 100644 --- a/kobalt/Build.kt.iml +++ b/kobalt/Build.kt.iml @@ -18,17 +18,6 @@ - - - - - - - - - - - @@ -38,5 +27,16 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/kobalt/wrapper/kobalt-wrapper.properties b/kobalt/wrapper/kobalt-wrapper.properties index e945989..cdcb2d1 100644 --- a/kobalt/wrapper/kobalt-wrapper.properties +++ b/kobalt/wrapper/kobalt-wrapper.properties @@ -1 +1 @@ -kobalt.version=1.0.80 \ No newline at end of file +kobalt.version=1.0.86 \ No newline at end of file From 9d5b969dd951eb1415854e0672e4e05b5c70525f Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Mon, 29 May 2017 18:37:13 -0700 Subject: [PATCH 13/17] Added circleci configuration. --- README.md | 2 +- circle.yml | 11 +++++++++++ example/kobalt/src/Build.kt | 2 +- kobalt/src/Build.kt | 8 +++++--- 4 files changed, 18 insertions(+), 5 deletions(-) create mode 100644 circle.yml diff --git a/README.md b/README.md index bce8adc..1c891a0 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Command Line Execution plug-in for [Kobalt](http://beust.com/kobalt/home/index.html) -[![License (3-Clause BSD)](https://img.shields.io/badge/license-BSD%203--Clause-blue.svg?style=flat-square)](http://opensource.org/licenses/BSD-3-Clause) [![Build Status](https://travis-ci.org/ethauvin/kobalt-exec.svg?branch=master)](https://travis-ci.org/ethauvin/kobalt-exec) [![Download](https://api.bintray.com/packages/ethauvin/maven/kobalt-exec/images/download.svg)](https://bintray.com/ethauvin/maven/kobalt-exec/_latestVersion) +[![License (3-Clause BSD)](https://img.shields.io/badge/license-BSD%203--Clause-blue.svg?style=flat-square)](http://opensource.org/licenses/BSD-3-Clause) [![Build Status](https://travis-ci.org/ethauvin/kobalt-exec.svg?branch=master)](https://travis-ci.org/ethauvin/kobalt-exec) [![CircleCI](https://circleci.com/gh/ethauvin/kobalt-exec/tree/master.svg?style=shield)](https://circleci.com/gh/ethauvin/kobalt-exec/tree/master) [![Download](https://api.bintray.com/packages/ethauvin/maven/kobalt-exec/images/download.svg)](https://bintray.com/ethauvin/maven/kobalt-exec/_latestVersion) The plug-in allows for the execution of system commands, similarly to the [Gradle Exec](https://docs.gradle.org/current/dsl/org.gradle.api.tasks.Exec.html) or [Ant Exec](https://ant.apache.org/manual/Tasks/exec.html) tasks. diff --git a/circle.yml b/circle.yml new file mode 100644 index 0000000..0351b69 --- /dev/null +++ b/circle.yml @@ -0,0 +1,11 @@ +machine: + java: + version: oraclejdk8 + +dependencies: + override: + - chmod +x kobaltw + +test: + override: + - ./kobaltw assemble \ No newline at end of file diff --git a/example/kobalt/src/Build.kt b/example/kobalt/src/Build.kt index 16bf56d..76e2c24 100644 --- a/example/kobalt/src/Build.kt +++ b/example/kobalt/src/Build.kt @@ -9,7 +9,7 @@ import net.thauvin.erik.kobalt.plugin.exec.* // ./kobaltw ps --log 2 val bs = buildScript { - //repos(file("K:/maven/repository")) + repos(localMaven()) plugins("net.thauvin.erik:kobalt-exec:") } diff --git a/kobalt/src/Build.kt b/kobalt/src/Build.kt index 2b2d815..60461c7 100644 --- a/kobalt/src/Build.kt +++ b/kobalt/src/Build.kt @@ -1,5 +1,5 @@ - import com.beust.kobalt.buildScript +import com.beust.kobalt.localMaven import com.beust.kobalt.file import com.beust.kobalt.plugin.packaging.assemble import com.beust.kobalt.plugin.publish.autoGitTag @@ -13,7 +13,7 @@ import org.apache.maven.model.Model import org.apache.maven.model.Scm val bs = buildScript { - repos(file("K:/maven/repository")) + repos(localMaven()) plugins("net.thauvin.erik:kobalt-versioneye:", "net.thauvin.erik:kobalt-maven-local:") } @@ -47,11 +47,13 @@ val p = project { } dependencies { - compileOnly("com.beust:$kobaltDependency:") + compile("com.beust:$kobaltDependency:") + compile("org.jetbrains.kotlin:kotlin-stdlib:1.1.2-4") } dependenciesTest { compile("org.testng:testng:") + compile("org.jetbrains.kotlin:kotlin-test:1.1.2-4") } assemble { From 49a01d258667cd0c5f6fe76d33611097de3457b1 Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Tue, 30 May 2017 15:12:46 -0700 Subject: [PATCH 14/17] Added release badge. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1c891a0..342ad10 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Command Line Execution plug-in for [Kobalt](http://beust.com/kobalt/home/index.html) -[![License (3-Clause BSD)](https://img.shields.io/badge/license-BSD%203--Clause-blue.svg?style=flat-square)](http://opensource.org/licenses/BSD-3-Clause) [![Build Status](https://travis-ci.org/ethauvin/kobalt-exec.svg?branch=master)](https://travis-ci.org/ethauvin/kobalt-exec) [![CircleCI](https://circleci.com/gh/ethauvin/kobalt-exec/tree/master.svg?style=shield)](https://circleci.com/gh/ethauvin/kobalt-exec/tree/master) [![Download](https://api.bintray.com/packages/ethauvin/maven/kobalt-exec/images/download.svg)](https://bintray.com/ethauvin/maven/kobalt-exec/_latestVersion) +[![License (3-Clause BSD)](https://img.shields.io/badge/license-BSD%203--Clause-blue.svg?style=flat-square)](http://opensource.org/licenses/BSD-3-Clause) [![release](http://github-release-version.herokuapp.com/github/ethauvin/kobalt-exec/release.svg?style=flat)](https://github.com/ethauvin/kobalt-exec/releases/latest) [![Build Status](https://travis-ci.org/ethauvin/kobalt-exec.svg?branch=master)](https://travis-ci.org/ethauvin/kobalt-exec) [![CircleCI](https://circleci.com/gh/ethauvin/kobalt-exec/tree/master.svg?style=shield)](https://circleci.com/gh/ethauvin/kobalt-exec/tree/master) [![Download](https://api.bintray.com/packages/ethauvin/maven/kobalt-exec/images/download.svg)](https://bintray.com/ethauvin/maven/kobalt-exec/_latestVersion) The plug-in allows for the execution of system commands, similarly to the [Gradle Exec](https://docs.gradle.org/current/dsl/org.gradle.api.tasks.Exec.html) or [Ant Exec](https://ant.apache.org/manual/Tasks/exec.html) tasks. From 38d7714f22c2781bd9eeb32d02e46701d6761de5 Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Tue, 31 Oct 2017 16:16:54 -0700 Subject: [PATCH 15/17] Kobalt 1.0.90, TestNG 6.12 updates. --- example/kobalt/wrapper/kobalt-wrapper.properties | 2 +- kobalt/src/Build.kt | 7 ++++--- kobalt/wrapper/kobalt-wrapper.properties | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/example/kobalt/wrapper/kobalt-wrapper.properties b/example/kobalt/wrapper/kobalt-wrapper.properties index cdcb2d1..a6a4316 100644 --- a/example/kobalt/wrapper/kobalt-wrapper.properties +++ b/example/kobalt/wrapper/kobalt-wrapper.properties @@ -1 +1 @@ -kobalt.version=1.0.86 \ No newline at end of file +kobalt.version=1.0.90 diff --git a/kobalt/src/Build.kt b/kobalt/src/Build.kt index 60461c7..7a5bf23 100644 --- a/kobalt/src/Build.kt +++ b/kobalt/src/Build.kt @@ -48,12 +48,12 @@ val p = project { dependencies { compile("com.beust:$kobaltDependency:") - compile("org.jetbrains.kotlin:kotlin-stdlib:1.1.2-4") + compile("org.jetbrains.kotlin:kotlin-stdlib:1.1.51") } dependenciesTest { - compile("org.testng:testng:") - compile("org.jetbrains.kotlin:kotlin-test:1.1.2-4") + compile("org.testng:testng:6.12") + compile("org.jetbrains.kotlin:kotlin-test:1.1.51") } assemble { @@ -64,6 +64,7 @@ val p = project { autoGitTag { enabled = true + push = false message = "Version $version" } diff --git a/kobalt/wrapper/kobalt-wrapper.properties b/kobalt/wrapper/kobalt-wrapper.properties index cdcb2d1..a6a4316 100644 --- a/kobalt/wrapper/kobalt-wrapper.properties +++ b/kobalt/wrapper/kobalt-wrapper.properties @@ -1 +1 @@ -kobalt.version=1.0.86 \ No newline at end of file +kobalt.version=1.0.90 From a2bbaf9f0f8fb7b9dc7993b00440e343cd8ccb4b Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Tue, 31 Oct 2017 16:17:14 -0700 Subject: [PATCH 16/17] Added CircleCI 2.0 configuration. --- .circleci/config.yml | 31 +++++++++++++++++++++++++++++++ circle.yml | 11 ----------- 2 files changed, 31 insertions(+), 11 deletions(-) create mode 100644 .circleci/config.yml delete mode 100644 circle.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..dffffe6 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,31 @@ +version: 2 +jobs: + build: + docker: + - image: circleci/openjdk:8-jdk + + working_directory: ~/repo + + environment: + JVM_OPTS: -Xmx3200m + TERM: dumb + + steps: + - checkout + - restore_cache: + keys: + - kobalt-dependencies-{{ checksum "kobalt/src/Build.kt" }} + # fallback to using the latest cache if no exact match is found + - kobalt-dependencies- + + - run: + name: Check Versions + command: ./kobaltw checkVersions + + - save_cache: + paths: ~/.kobalt + key: kobalt-dependencies-{{ checksum "kobalt/src/Build.kt" }} + + - run: + name: Assemble + command: ./kobaltw assemble \ No newline at end of file diff --git a/circle.yml b/circle.yml deleted file mode 100644 index 0351b69..0000000 --- a/circle.yml +++ /dev/null @@ -1,11 +0,0 @@ -machine: - java: - version: oraclejdk8 - -dependencies: - override: - - chmod +x kobaltw - -test: - override: - - ./kobaltw assemble \ No newline at end of file From acb492b30e4ae913cef59072dae0bc90d0c67880 Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Mon, 18 Jun 2018 20:13:08 -0700 Subject: [PATCH 17/17] Fixed badges. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 342ad10..7081070 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Command Line Execution plug-in for [Kobalt](http://beust.com/kobalt/home/index.html) -[![License (3-Clause BSD)](https://img.shields.io/badge/license-BSD%203--Clause-blue.svg?style=flat-square)](http://opensource.org/licenses/BSD-3-Clause) [![release](http://github-release-version.herokuapp.com/github/ethauvin/kobalt-exec/release.svg?style=flat)](https://github.com/ethauvin/kobalt-exec/releases/latest) [![Build Status](https://travis-ci.org/ethauvin/kobalt-exec.svg?branch=master)](https://travis-ci.org/ethauvin/kobalt-exec) [![CircleCI](https://circleci.com/gh/ethauvin/kobalt-exec/tree/master.svg?style=shield)](https://circleci.com/gh/ethauvin/kobalt-exec/tree/master) [![Download](https://api.bintray.com/packages/ethauvin/maven/kobalt-exec/images/download.svg)](https://bintray.com/ethauvin/maven/kobalt-exec/_latestVersion) +[![License (3-Clause BSD)](https://img.shields.io/badge/license-BSD%203--Clause-blue.svg?style=flat-square)](http://opensource.org/licenses/BSD-3-Clause) [![release](https://img.shields.io/github/release/ethauvin/kobalt-exec.svg)](https://github.com/ethauvin/kobalt-exec/releases/latest) [![Build Status](https://travis-ci.org/ethauvin/kobalt-exec.svg?branch=master)](https://travis-ci.org/ethauvin/kobalt-exec) [![CircleCI](https://circleci.com/gh/ethauvin/kobalt-exec/tree/master.svg?style=shield)](https://circleci.com/gh/ethauvin/kobalt-exec/tree/master) [![Download](https://api.bintray.com/packages/ethauvin/maven/kobalt-exec/images/download.svg)](https://bintray.com/ethauvin/maven/kobalt-exec/_latestVersion) The plug-in allows for the execution of system commands, similarly to the [Gradle Exec](https://docs.gradle.org/current/dsl/org.gradle.api.tasks.Exec.html) or [Ant Exec](https://ant.apache.org/manual/Tasks/exec.html) tasks.