Added taskName and dependsOn parameters.
This commit is contained in:
parent
9d78094586
commit
2517aabd97
6 changed files with 159 additions and 62 deletions
39
README.md
39
README.md
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue