From 0ab03b67b2ce14e2dc8efe21f9ca34f4dd251986 Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Wed, 13 Jul 2016 11:02:32 -0700 Subject: [PATCH 01/64] Added download badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4cd7712..a1f14e5 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) +[![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) 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 bf42e81afb664c217cefa9ea3bdf37615923d755 Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Sun, 17 Jul 2016 20:06:44 -0700 Subject: [PATCH 02/64] Trying new Travis build. --- .idea/kobalt.xml | 2 +- .travis.yml | 2 +- example/kobalt/src/Build.kt | 2 +- kobalt-exec.iml | 20 +------------------- kobalt/wrapper/kobalt-wrapper.properties | 2 +- kobaltw.bat | 4 ++++ 6 files changed, 9 insertions(+), 23 deletions(-) create mode 100644 kobaltw.bat diff --git a/.idea/kobalt.xml b/.idea/kobalt.xml index edf71eb..c43ef66 100644 --- a/.idea/kobalt.xml +++ b/.idea/kobalt.xml @@ -5,7 +5,7 @@ - - - - - - - - - - - + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml index de1fa43..48f8f9e 100644 --- a/.idea/modules.xml +++ b/.idea/modules.xml @@ -3,6 +3,7 @@ + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml index 4c0d94b..d175698 100644 --- a/.idea/vcs.xml +++ b/.idea/vcs.xml @@ -4,6 +4,5 @@ - \ No newline at end of file diff --git a/example/kobalt/src/Build.kt b/example/kobalt/src/Build.kt index 972f763..f6d3d5f 100644 --- a/example/kobalt/src/Build.kt +++ b/example/kobalt/src/Build.kt @@ -51,7 +51,7 @@ val example2 = project { 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("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)) } } diff --git a/kobalt-exec.iml b/kobalt-exec.iml new file mode 100644 index 0000000..0573f36 --- /dev/null +++ b/kobalt-exec.iml @@ -0,0 +1,439 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kobalt/Build.kt.iml b/kobalt/Build.kt.iml index f641794..a6e2d45 100644 --- a/kobalt/Build.kt.iml +++ b/kobalt/Build.kt.iml @@ -1,12 +1,31 @@ - - + + + + - + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kobalt/src/Build.kt b/kobalt/src/Build.kt index a732924..b7c8f8a 100644 --- a/kobalt/src/Build.kt +++ b/kobalt/src/Build.kt @@ -1,17 +1,16 @@ +import com.beust.kobalt.buildScript import com.beust.kobalt.plugin.packaging.assemble import com.beust.kobalt.plugin.publish.bintray -import com.beust.kobalt.plugins import com.beust.kobalt.project -import com.beust.kobalt.repos +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 -import net.thauvin.erik.kobalt.plugin.versioneye.* - -val pl = plugins("net.thauvin.erik:kobalt-versioneye:") -val repos = repos() +val bs = buildScript { + plugins("net.thauvin.erik:kobalt-versioneye:") +} val dev = false val kobaltDependency = if (dev) "kobalt" else "kobalt-plugin-api" diff --git a/kobalt/wrapper/kobalt-wrapper.properties b/kobalt/wrapper/kobalt-wrapper.properties index 749bf48..91fe49a 100644 --- a/kobalt/wrapper/kobalt-wrapper.properties +++ b/kobalt/wrapper/kobalt-wrapper.properties @@ -1 +1 @@ -kobalt.version=0.905 \ No newline at end of file +kobalt.version=1.0.3 \ No newline at end of file From 572ddd0a9f6310999d1e759663f2250460be93fd Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Mon, 6 Mar 2017 14:07:23 -0800 Subject: [PATCH 27/64] Rebuilt IDEA project from scratch. --- .idea/codeStyleSettings.xml | 9 ---- .idea/compiler.xml | 23 -------- .idea/copyright/Erik_s_Copyright_Notice.xml | 2 +- .idea/copyright/profiles_settings.xml | 2 +- .../inspectionProfiles/profiles_settings.xml | 7 --- .idea/kobalt.xml | 1 - .idea/misc.xml | 52 ------------------- .idea/scopes/Source.xml | 2 +- .idea/vcs.xml | 2 - .../kobalt/wrapper/kobalt-wrapper.properties | 2 +- 10 files changed, 4 insertions(+), 98 deletions(-) delete mode 100644 .idea/codeStyleSettings.xml delete mode 100644 .idea/compiler.xml delete mode 100644 .idea/inspectionProfiles/profiles_settings.xml diff --git a/.idea/codeStyleSettings.xml b/.idea/codeStyleSettings.xml deleted file mode 100644 index 5add346..0000000 --- a/.idea/codeStyleSettings.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml deleted file mode 100644 index a852314..0000000 --- a/.idea/compiler.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - \ No newline at end of file diff --git a/.idea/copyright/Erik_s_Copyright_Notice.xml b/.idea/copyright/Erik_s_Copyright_Notice.xml index 5cd1489..6763f1b 100644 --- a/.idea/copyright/Erik_s_Copyright_Notice.xml +++ b/.idea/copyright/Erik_s_Copyright_Notice.xml @@ -1,6 +1,6 @@ \ No newline at end of file diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml index 89ab48c..2bbc8ca 100644 --- a/.idea/copyright/profiles_settings.xml +++ b/.idea/copyright/profiles_settings.xml @@ -1,5 +1,5 @@ - + diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml deleted file mode 100644 index 3b31283..0000000 --- a/.idea/inspectionProfiles/profiles_settings.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/kobalt.xml b/.idea/kobalt.xml index f893065..3764f2d 100644 --- a/.idea/kobalt.xml +++ b/.idea/kobalt.xml @@ -11,7 +11,6 @@ - diff --git a/.idea/misc.xml b/.idea/misc.xml index 2bf02d5..fbc2102 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,57 +1,5 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/.idea/scopes/Source.xml b/.idea/scopes/Source.xml index f3b802c..d4fb9bf 100644 --- a/.idea/scopes/Source.xml +++ b/.idea/scopes/Source.xml @@ -1,3 +1,3 @@ - + \ No newline at end of file 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/wrapper/kobalt-wrapper.properties b/example/kobalt/wrapper/kobalt-wrapper.properties index 749bf48..91fe49a 100644 --- a/example/kobalt/wrapper/kobalt-wrapper.properties +++ b/example/kobalt/wrapper/kobalt-wrapper.properties @@ -1 +1 @@ -kobalt.version=0.905 \ No newline at end of file +kobalt.version=1.0.3 \ No newline at end of file From 53e80b18e72583420afc2d264322057eefb7c3a9 Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Mon, 6 Mar 2017 14:08:05 -0800 Subject: [PATCH 28/64] Kotlin 1.1 and Kobalt 1.0.x optimization --- example/kobalt/src/Build.kt | 5 +++-- .../erik/kobalt/plugin/exec/ExecPlugin.kt | 17 ++++++++++------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/example/kobalt/src/Build.kt b/example/kobalt/src/Build.kt index f6d3d5f..e226bfa 100644 --- a/example/kobalt/src/Build.kt +++ b/example/kobalt/src/Build.kt @@ -4,8 +4,9 @@ import com.beust.kobalt.plugin.application.* import com.beust.kobalt.plugin.java.* import net.thauvin.erik.kobalt.plugin.exec.* -//val pl = plugins(file("../kobaltBuild/libs/kobalt-exec-0.6.2.jar")) -val pl = plugins("net.thauvin.erik:kobalt-exec:0.6.2") +val bs = buildScript { + plugins("net.thauvin.erik:kobalt-exec:0.6.2") +} val example = project { 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 fb99d3a..2c9fb06 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 @@ -1,7 +1,7 @@ /* * ExecPlugin.kt * - * Copyright (c) 2016, Erik C. Thauvin (erik@thauvin.net) + * Copyright (c) 2016-2017, Erik C. Thauvin (erik@thauvin.net) * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -60,6 +60,7 @@ 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 { var result = TaskResult() @@ -109,7 +110,7 @@ class ExecPlugin @Inject constructor(val configActor: ConfigActor) : for ((args, dir, os, fail) in config.commandLines) { val wrkDir = File(if (dir.isNullOrBlank()) project.directory else dir) if (wrkDir.isDirectory) { - var execute = (os.size == 0) + var execute = (os.isEmpty()) if (!execute) { for (name in os) { execute = matchOs(name) @@ -126,7 +127,7 @@ class ExecPlugin @Inject constructor(val configActor: ConfigActor) : val stderr = if (proc.errorStream.available() > 0) fromStream(proc.errorStream) else emptyList() val cmdInfo = "Program \"" + args.joinToString(" ") + "\" (in directory \"${wrkDir.path}\"): " - if (err == false) { + if (!err) { errorMessage.append(cmdInfo).append("TIMEOUT") success = false } else if (!fail.contains(Fail.NONE)) { @@ -176,11 +177,11 @@ class ExecPlugin @Inject constructor(val configActor: ConfigActor) : } } -enum class Fail() { +enum class Fail { ALL, EXIT, NONE, NORMAL, OUTPUT, STDERR, STDOUT } -enum class Os() { +enum class Os { FREEBSD, LINUX, MAC, OPENVMS, OS400, SOLARIS, TANDEM, WINDOWS, ZOS } @@ -188,15 +189,17 @@ data class CommandLine(var args: List = emptyList(), var dir: String = " var fail: Set = setOf(Fail.NORMAL)) @Directive -class ExecConfig() { +class ExecConfig { val commandLines = arrayListOf() + @Suppress("unused") fun commandLine(args: List = emptyList(), dir: String = "", os: Set = emptySet(), fail: Set = setOf(Fail.NORMAL)) { - if (args.size > 0) commandLines.add(CommandLine(args, dir, os, fail)) + if (args.isNotEmpty()) commandLines.add(CommandLine(args, dir, os, fail)) } } +@Suppress("unused") @Directive fun Project.exec(init: ExecConfig.() -> Unit) { ExecConfig().let { config -> From a4a3b24a7bad79787e97438ce893266ce6b28baa Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Mon, 6 Mar 2017 14:14:05 -0800 Subject: [PATCH 29/64] Kobalt 1.0.x syntax --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a51de8a..d70d5a7 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,9 @@ To use the plug-in include the following in your `Build.kt` file: ```kotlin import net.thauvin.erik.kobalt.plugin.exec.* -val pl = plugins("net.thauvin.erik:kobalt-exc:") +val bs = buildScript { + plugins("net.thauvin.erik:kobalt-exc:") +} val p = project { name = "example" From 6013d9cfdfd90f414bd6491d937725b273381555 Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Mon, 6 Mar 2017 20:21:10 -0800 Subject: [PATCH 30/64] Added example to IDEA project. --- .idea/kobalt.xml | 10 + .idea/modules.xml | 4 +- .idea/vcs.xml | 4 + example/example.iml | 15 + example/example2.iml | 15 + {kobalt => example/kobalt}/Build.kt.iml | 4 +- kobalt-exec.iml | 787 ++++++++++++------------ 7 files changed, 442 insertions(+), 397 deletions(-) create mode 100644 example/example.iml create mode 100644 example/example2.iml rename {kobalt => example/kobalt}/Build.kt.iml (90%) diff --git a/.idea/kobalt.xml b/.idea/kobalt.xml index 3764f2d..ed2be6d 100644 --- a/.idea/kobalt.xml +++ b/.idea/kobalt.xml @@ -12,6 +12,16 @@ + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml index 48f8f9e..720e369 100644 --- a/.idea/modules.xml +++ b/.idea/modules.xml @@ -2,7 +2,9 @@ - + + + diff --git a/.idea/vcs.xml b/.idea/vcs.xml index 94a25f7..c42d940 100644 --- a/.idea/vcs.xml +++ b/.idea/vcs.xml @@ -2,5 +2,9 @@ + + + + \ No newline at end of file diff --git a/example/example.iml b/example/example.iml new file mode 100644 index 0000000..0e41929 --- /dev/null +++ b/example/example.iml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/example/example2.iml b/example/example2.iml new file mode 100644 index 0000000..c661fd1 --- /dev/null +++ b/example/example2.iml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kobalt/Build.kt.iml b/example/kobalt/Build.kt.iml similarity index 90% rename from kobalt/Build.kt.iml rename to example/kobalt/Build.kt.iml index a6e2d45..d022bf6 100644 --- a/kobalt/Build.kt.iml +++ b/example/kobalt/Build.kt.iml @@ -10,9 +10,9 @@ - + - + diff --git a/kobalt-exec.iml b/kobalt-exec.iml index 0573f36..24686a0 100644 --- a/kobalt-exec.iml +++ b/kobalt-exec.iml @@ -5,9 +5,8 @@ - - - + + @@ -21,397 +20,10 @@ - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -427,9 +39,396 @@ - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 91f5d23bc0037ecff30e556082fe7095ac778d78 Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Mon, 6 Mar 2017 21:16:50 -0800 Subject: [PATCH 31/64] Release 0.6.3 prep --- example/kobalt/src/Build.kt | 16 +++++++++------- kobalt/src/Build.kt | 2 +- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/example/kobalt/src/Build.kt b/example/kobalt/src/Build.kt index e226bfa..48495db 100644 --- a/example/kobalt/src/Build.kt +++ b/example/kobalt/src/Build.kt @@ -1,11 +1,13 @@ -import com.beust.kobalt.* -import com.beust.kobalt.plugin.packaging.* -import com.beust.kobalt.plugin.application.* -import com.beust.kobalt.plugin.java.* -import net.thauvin.erik.kobalt.plugin.exec.* +import com.beust.kobalt.buildScript +import com.beust.kobalt.plugin.application.application +import com.beust.kobalt.plugin.packaging.assemble +import com.beust.kobalt.project +import net.thauvin.erik.kobalt.plugin.exec.Os +import net.thauvin.erik.kobalt.plugin.exec.exec val bs = buildScript { - plugins("net.thauvin.erik:kobalt-exec:0.6.2") + //plugins(file("../kobaltBuild/libs/kobalt-exec-0.6.2.jar")) + plugins("net.thauvin.erik:kobalt-exec:") } val example = project { @@ -39,7 +41,7 @@ val example = project { } exec { - commandLine(listOf( "echo", "Test Example 1"), os = setOf(Os.LINUX)) + 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)) diff --git a/kobalt/src/Build.kt b/kobalt/src/Build.kt index b7c8f8a..ff30d1e 100644 --- a/kobalt/src/Build.kt +++ b/kobalt/src/Build.kt @@ -20,7 +20,7 @@ val p = project { name = "kobalt-exec" group = "net.thauvin.erik" artifactId = name - version = "0.6.2" + version = "0.6.3" pom = Model().apply { description = "Command Line Execution plug-in for the Kobalt build system." From c4a59b86c333f34b1331d44441e4137b15eaf421 Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Mon, 6 Mar 2017 22:25:09 -0800 Subject: [PATCH 32/64] Simplified imports. --- example/kobalt/src/Build.kt | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/example/kobalt/src/Build.kt b/example/kobalt/src/Build.kt index 48495db..ba62bf0 100644 --- a/example/kobalt/src/Build.kt +++ b/example/kobalt/src/Build.kt @@ -1,12 +1,10 @@ -import com.beust.kobalt.buildScript +import com.beust.kobalt.* import com.beust.kobalt.plugin.application.application import com.beust.kobalt.plugin.packaging.assemble -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.exec.* val bs = buildScript { - //plugins(file("../kobaltBuild/libs/kobalt-exec-0.6.2.jar")) + //plugins(file("../kobaltBuild/libs/kobalt-exec-0.6.3.jar")) plugins("net.thauvin.erik:kobalt-exec:") } From f823f3be8c9575abb3fdc164980b5ff163bb712a Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Wed, 8 Mar 2017 01:29:35 -0800 Subject: [PATCH 33/64] Added examples to main build file. --- .idea/encodings.xml | 6 -- .idea/inspectionProfiles/Project_Default.xml | 10 +-- .idea/kobalt.xml | 12 +--- .idea/misc.xml | 4 +- .idea/modules.xml | 2 +- .idea/vcs.xml | 2 - example/example.iml | 7 +- example/example2.iml | 7 +- example/kobalt/src/Build.kt | 9 ++- .../kobalt/wrapper/kobalt-wrapper.properties | 2 +- kobalt-exec.iml | 5 +- kobalt/Build.kt.iml | 40 +++++++++++ kobalt/src/Build.kt | 69 ++++++++++++++++++- kobalt/wrapper/kobalt-wrapper.properties | 2 +- 14 files changed, 135 insertions(+), 42 deletions(-) delete mode 100644 .idea/encodings.xml create mode 100644 kobalt/Build.kt.iml diff --git a/.idea/encodings.xml b/.idea/encodings.xml deleted file mode 100644 index 97626ba..0000000 --- a/.idea/encodings.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml index 8ff795e..17b1e81 100644 --- a/.idea/inspectionProfiles/Project_Default.xml +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -1,8 +1,9 @@ diff --git a/.idea/kobalt.xml b/.idea/kobalt.xml index ed2be6d..52b4669 100644 --- a/.idea/kobalt.xml +++ b/.idea/kobalt.xml @@ -5,23 +5,13 @@ - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index fbc2102..f1a9bb1 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,6 +1,4 @@ - - - + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml index 720e369..e443ce8 100644 --- a/.idea/modules.xml +++ b/.idea/modules.xml @@ -2,7 +2,7 @@ - + diff --git a/.idea/vcs.xml b/.idea/vcs.xml index c42d940..d175698 100644 --- a/.idea/vcs.xml +++ b/.idea/vcs.xml @@ -4,7 +4,5 @@ - - \ No newline at end of file diff --git a/example/example.iml b/example/example.iml index 0e41929..a07481d 100644 --- a/example/example.iml +++ b/example/example.iml @@ -1,8 +1,8 @@ - + - - + + @@ -11,5 +11,6 @@ + \ No newline at end of file diff --git a/example/example2.iml b/example/example2.iml index c661fd1..7109c9b 100644 --- a/example/example2.iml +++ b/example/example2.iml @@ -1,8 +1,8 @@ - + - - + + @@ -11,5 +11,6 @@ + \ No newline at end of file diff --git a/example/kobalt/src/Build.kt b/example/kobalt/src/Build.kt index ba62bf0..256c64a 100644 --- a/example/kobalt/src/Build.kt +++ b/example/kobalt/src/Build.kt @@ -1,10 +1,13 @@ import com.beust.kobalt.* -import com.beust.kobalt.plugin.application.application -import com.beust.kobalt.plugin.packaging.assemble +import com.beust.kobalt.plugin.application.* +import com.beust.kobalt.plugin.packaging.* import net.thauvin.erik.kobalt.plugin.exec.* +// ./kobaltw exec +// ./kobaltw example:exec +// ./kobaltw example2:exec + val bs = buildScript { - //plugins(file("../kobaltBuild/libs/kobalt-exec-0.6.3.jar")) plugins("net.thauvin.erik:kobalt-exec:") } diff --git a/example/kobalt/wrapper/kobalt-wrapper.properties b/example/kobalt/wrapper/kobalt-wrapper.properties index 91fe49a..1ec9521 100644 --- a/example/kobalt/wrapper/kobalt-wrapper.properties +++ b/example/kobalt/wrapper/kobalt-wrapper.properties @@ -1 +1 @@ -kobalt.version=1.0.3 \ No newline at end of file +kobalt.version=1.0.5 \ No newline at end of file diff --git a/kobalt-exec.iml b/kobalt-exec.iml index 24686a0..b9f476d 100644 --- a/kobalt-exec.iml +++ b/kobalt-exec.iml @@ -5,8 +5,9 @@ - - + + + diff --git a/kobalt/Build.kt.iml b/kobalt/Build.kt.iml new file mode 100644 index 0000000..c6d6e39 --- /dev/null +++ b/kobalt/Build.kt.iml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kobalt/src/Build.kt b/kobalt/src/Build.kt index ff30d1e..e931620 100644 --- a/kobalt/src/Build.kt +++ b/kobalt/src/Build.kt @@ -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)) + } +} diff --git a/kobalt/wrapper/kobalt-wrapper.properties b/kobalt/wrapper/kobalt-wrapper.properties index 91fe49a..1ec9521 100644 --- a/kobalt/wrapper/kobalt-wrapper.properties +++ b/kobalt/wrapper/kobalt-wrapper.properties @@ -1 +1 @@ -kobalt.version=1.0.3 \ No newline at end of file +kobalt.version=1.0.5 \ No newline at end of file From 4171f5bb39fe4a87a8c28c5a29784a9fd36ad12f Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Wed, 8 Mar 2017 11:19:40 -0800 Subject: [PATCH 34/64] Kobalt 1.0.6 update. --- .idea/kobalt.xml | 2 +- .../kobalt/wrapper/kobalt-wrapper.properties | 2 +- kobalt-exec.iml | 754 +++++++++--------- kobalt/Build.kt.iml | 18 +- kobalt/src/Build.kt | 14 +- kobalt/wrapper/kobalt-wrapper.properties | 2 +- 6 files changed, 397 insertions(+), 395 deletions(-) diff --git a/.idea/kobalt.xml b/.idea/kobalt.xml index 52b4669..5bc4181 100644 --- a/.idea/kobalt.xml +++ b/.idea/kobalt.xml @@ -5,7 +5,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -418,18 +49,387 @@ - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/kobalt/Build.kt.iml b/kobalt/Build.kt.iml index c6d6e39..4bbec09 100644 --- a/kobalt/Build.kt.iml +++ b/kobalt/Build.kt.iml @@ -18,6 +18,15 @@ + + + + + + + + + @@ -27,14 +36,5 @@ - - - - - - - - - \ No newline at end of file diff --git a/kobalt/src/Build.kt b/kobalt/src/Build.kt index e931620..9a1903d 100644 --- a/kobalt/src/Build.kt +++ b/kobalt/src/Build.kt @@ -12,16 +12,18 @@ import org.apache.maven.model.Developer import org.apache.maven.model.License import org.apache.maven.model.Model import org.apache.maven.model.Scm +import java.io.File val semver = "0.6.3" val bs = buildScript { - 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:" + val p = with(File("kobaltBuild/libs/kobalt-exec-$semver.jar")) { + if (exists()) { + kobaltLog(1, " >>> Using: $path") + file(path) + } else { + "net.thauvin.erik:kobalt-exec:" + } } plugins("net.thauvin.erik:kobalt-versioneye:", p) } diff --git a/kobalt/wrapper/kobalt-wrapper.properties b/kobalt/wrapper/kobalt-wrapper.properties index 1ec9521..f3cd7d1 100644 --- a/kobalt/wrapper/kobalt-wrapper.properties +++ b/kobalt/wrapper/kobalt-wrapper.properties @@ -1 +1 @@ -kobalt.version=1.0.5 \ No newline at end of file +kobalt.version=1.0.6 \ No newline at end of file From 816dcd8843bfa98f2ae5cd0932b3efdd644ae51d Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Wed, 8 Mar 2017 12:19:43 -0800 Subject: [PATCH 35/64] Updated license copyright. --- LICENSE.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE.txt b/LICENSE.txt index 84fe1dc..f30d392 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,4 +1,4 @@ -Copyright (c) 2016, Erik C. Thauvin (erik@thauvin.net) +Copyright (c) 2016-2017, Erik C. Thauvin (erik@thauvin.net) All rights reserved. Redistribution and use in source and binary forms, with or without From ece42cb69f52ded03eac3469ac560f5be1912775 Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Wed, 8 Mar 2017 13:16:02 -0800 Subject: [PATCH 36/64] Updated scopes. --- .idea/scopes/Copyright.xml | 3 + .idea/scopes/Source.xml | 3 - kobalt-exec.iml | 782 ++++++++++++++++++------------------- kobalt/Build.kt.iml | 18 +- 4 files changed, 403 insertions(+), 403 deletions(-) create mode 100644 .idea/scopes/Copyright.xml delete mode 100644 .idea/scopes/Source.xml diff --git a/.idea/scopes/Copyright.xml b/.idea/scopes/Copyright.xml new file mode 100644 index 0000000..e487d4e --- /dev/null +++ b/.idea/scopes/Copyright.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/.idea/scopes/Source.xml b/.idea/scopes/Source.xml deleted file mode 100644 index d4fb9bf..0000000 --- a/.idea/scopes/Source.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/kobalt-exec.iml b/kobalt-exec.iml index 0573f36..b9f476d 100644 --- a/kobalt-exec.iml +++ b/kobalt-exec.iml @@ -21,397 +21,10 @@ - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -427,9 +40,396 @@ - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/kobalt/Build.kt.iml b/kobalt/Build.kt.iml index 4bbec09..1bd660b 100644 --- a/kobalt/Build.kt.iml +++ b/kobalt/Build.kt.iml @@ -18,15 +18,6 @@ - - - - - - - - - @@ -36,5 +27,14 @@ + + + + + + + + + \ No newline at end of file From 8788ee465854c08bbcb156735de0e8bacf43ac0a Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Tue, 21 Mar 2017 15:17:08 -0700 Subject: [PATCH 37/64] Updated to Kobalt 1.0.19. --- .gitattributes | 7 ++++--- .idea/kobalt.xml | 2 +- kobalt-exec.iml | 2 +- kobalt/wrapper/kobalt-wrapper.properties | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.gitattributes b/.gitattributes index 92d2493..6ec2ae2 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,4 +1,5 @@ -# Normalize line endings in text files to LF on checkin. -# (this overrides core.autocrlf) - +# Set the default behavior, in case people don't have core.autocrlf set. * text=auto + +# batch files are specific to windows and always crlf +*.bat eol=crlf diff --git a/.idea/kobalt.xml b/.idea/kobalt.xml index 5bc4181..48dce39 100644 --- a/.idea/kobalt.xml +++ b/.idea/kobalt.xml @@ -5,7 +5,7 @@