diff --git a/lib/klutter-kore/src/test/groovy/dev/buijs/klutter/kore/shared/ExecutableSpec.groovy b/lib/klutter-kore/src/test/groovy/dev/buijs/klutter/kore/shared/ExecutableSpec.groovy deleted file mode 100644 index 7d253673..00000000 --- a/lib/klutter-kore/src/test/groovy/dev/buijs/klutter/kore/shared/ExecutableSpec.groovy +++ /dev/null @@ -1,37 +0,0 @@ -package dev.buijs.klutter.kore.shared - -import dev.buijs.klutter.kore.KlutterException -import spock.lang.Shared -import spock.lang.Specification - -import java.nio.file.Files - -class ExecutableSpec extends Specification { - - @Shared - def working = Files.createTempDirectory("").toFile() - - def "Verify executing a command"() { - - given: - def sayHello = ExecutableKt.execute('''echo hello world''', working) - - expect: - sayHello == "hello world\n" - - } - - def "When a command fails an exception is thrown"() { - - when: - ExecutableKt.execute('''mv foo''', working) - - then: - KlutterException e = thrown() - e.message == "Failed to execute command: \nusage: " + - "mv [-f | -i | -n] [-hv] source target\n" + - " mv [-f | -i | -n] [-v] source ... directory\n" - - } - -} \ No newline at end of file diff --git a/lib/klutter-tasks/src/main/kotlin/dev/buijs/klutter/tasks/ArtifactBuildTask.kt b/lib/klutter-tasks/src/main/kotlin/dev/buijs/klutter/tasks/ArtifactBuildTask.kt index ac7a8e28..6a9f363d 100644 --- a/lib/klutter-tasks/src/main/kotlin/dev/buijs/klutter/tasks/ArtifactBuildTask.kt +++ b/lib/klutter-tasks/src/main/kotlin/dev/buijs/klutter/tasks/ArtifactBuildTask.kt @@ -23,8 +23,6 @@ package dev.buijs.klutter.tasks import dev.buijs.klutter.kore.KlutterException import dev.buijs.klutter.kore.KlutterTask -import dev.buijs.klutter.kore.shared.execute -import mu.KotlinLogging import java.io.BufferedOutputStream import java.io.File import java.io.FileOutputStream diff --git a/lib/klutter-tasks/src/main/kotlin/dev/buijs/klutter/tasks/BuildKlutterPluginProjectTask.kt b/lib/klutter-tasks/src/main/kotlin/dev/buijs/klutter/tasks/BuildKlutterPluginProjectTask.kt index 3bb2328b..be5bc4a6 100644 --- a/lib/klutter-tasks/src/main/kotlin/dev/buijs/klutter/tasks/BuildKlutterPluginProjectTask.kt +++ b/lib/klutter-tasks/src/main/kotlin/dev/buijs/klutter/tasks/BuildKlutterPluginProjectTask.kt @@ -23,7 +23,6 @@ package dev.buijs.klutter.tasks import dev.buijs.klutter.kore.KlutterTask import dev.buijs.klutter.kore.project.Project -import dev.buijs.klutter.kore.shared.execute /** * Task to build a Klutter plugin project. diff --git a/lib/klutter-kore/src/main/kotlin/dev/buijs/klutter/kore/shared/Executable.kt b/lib/klutter-tasks/src/main/kotlin/dev/buijs/klutter/tasks/Executable.kt similarity index 85% rename from lib/klutter-kore/src/main/kotlin/dev/buijs/klutter/kore/shared/Executable.kt rename to lib/klutter-tasks/src/main/kotlin/dev/buijs/klutter/tasks/Executable.kt index 57473e9e..af9ccf33 100644 --- a/lib/klutter-kore/src/main/kotlin/dev/buijs/klutter/kore/shared/Executable.kt +++ b/lib/klutter-tasks/src/main/kotlin/dev/buijs/klutter/tasks/Executable.kt @@ -1,10 +1,10 @@ -package dev.buijs.klutter.kore.shared +package dev.buijs.klutter.tasks import dev.buijs.klutter.kore.KlutterException import java.io.File import java.util.concurrent.TimeUnit -fun String.execute(runFrom: File): String { +internal fun String.execute(runFrom: File): String { val process = ProcessBuilder() .command(split(" ")) .directory(runFrom) diff --git a/lib/klutter-tasks/src/main/kotlin/dev/buijs/klutter/tasks/GenerateKlutterPluginProjectTask.kt b/lib/klutter-tasks/src/main/kotlin/dev/buijs/klutter/tasks/GenerateKlutterPluginProjectTask.kt index af0211e3..dea40f36 100644 --- a/lib/klutter-tasks/src/main/kotlin/dev/buijs/klutter/tasks/GenerateKlutterPluginProjectTask.kt +++ b/lib/klutter-tasks/src/main/kotlin/dev/buijs/klutter/tasks/GenerateKlutterPluginProjectTask.kt @@ -22,7 +22,6 @@ package dev.buijs.klutter.tasks import dev.buijs.klutter.kore.KlutterTask -import dev.buijs.klutter.kore.shared.execute import dev.buijs.klutter.kore.shared.verifyExists import java.io.File