Examples cleanup.
This commit is contained in:
parent
a55d7f34eb
commit
5672ad96b0
2 changed files with 5 additions and 4 deletions
|
@ -37,7 +37,8 @@ The `commandLine` directive is used to execute command line(s) during the build
|
||||||
exec {
|
exec {
|
||||||
commandLine("cmd", "/c", "stop.bat", dir = "../tomcat/bin", os = setOf(Os.WINDOWS))
|
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("./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
|
```kotlin
|
||||||
exec {
|
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))
|
commandLine("cmd", "/c", "stop.bat 2> error.txt", os = setOf(Os.WINDOWS))
|
||||||
}
|
}
|
||||||
```
|
```
|
|
@ -39,14 +39,14 @@ val example = project {
|
||||||
dependsOn = listOf("exec", "run")
|
dependsOn = listOf("exec", "run")
|
||||||
|
|
||||||
val echo = arrayOf("echo", "Test", "Example")
|
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(*echo, os = setOf(Os.LINUX, Os.MINGW, Os.CYGWIN))
|
||||||
|
commandLine("cmd", "/c", *echo, os = setOf(Os.WINDOWS))
|
||||||
}
|
}
|
||||||
|
|
||||||
exec {
|
exec {
|
||||||
taskName = "ps"
|
taskName = "ps"
|
||||||
dependsOn = listOf() // no dependencies
|
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("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))
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue