Added taskName and dependsOn parameters.

This commit is contained in:
Erik C. Thauvin 2017-05-29 00:05:34 -07:00
parent 9d78094586
commit 2517aabd97
6 changed files with 159 additions and 62 deletions

View file

@ -8,7 +8,7 @@ The PropertyFile plug-in provides an optional task for editing [property files](
import net.thauvin.erik.kobalt.plugin.propertyfile.*
val bs = buildScript {
plugins("net.thauvin.erik:kobalt-property-file:")
plugins("net.thauvin.erik:kobalt-property-file:0.9.1")
}
val p = project {
@ -92,6 +92,43 @@ The rules used when setting a property value are:
Operations occur after the rules are evaluated.
## taskName
Additionally, you can specify a task name to easily identify multiple `propertyFile` tasks.
```kotlin
propertyFile {
taskName = "updateMinor"
file = "version.properties"
entry(key = "product.build.minor", type = Types.INT, operation = Operations.ADD)
}
propertyFile {
taskName = "updatePatch"
file = "version.properties"
entry(key = "product.build.patch", type = Types.INT, operation = Operations.ADD)
}
```
```sh
./kobaltw updateMinor
./kobaltw updatePatch
```
## dependsOn
By default the `propertyFile` task has no dependencies, use the `dependsOn` parameter to change the dependencies:
```kotlin
propertyFile {
dependsOn = listOf("assemble", "run")
file = "version.properties"
entry(key = "product.build.date" , type = Types.DATE, value = "now")
}
```
## Differences with the [ant PropertyFile task](https://ant.apache.org/manual/Tasks/propertyfile.html)
* The comments and layout of the original property file will not be preserved.