More cleanup.
This commit is contained in:
parent
34fd91a682
commit
639f43893e
3 changed files with 29 additions and 24 deletions
46
README.md
46
README.md
|
@ -1,6 +1,6 @@
|
|||
# PropertyFile plug-in for [Kobalt](http://beust.com/kobalt/home/index.html)
|
||||
|
||||
[](http://opensource.org/licenses/BSD-3-Clause) [](https://travis-ci.org/ethauvin/kobalt-property-file)
|
||||
[](http://opensource.org/licenses/BSD-3-Clause) [](https://travis-ci.org/ethauvin/kobalt-property-file)
|
||||
|
||||
The PropertyFile plug-in provides an optional task for editing [property files](https://docs.oracle.com/javase/tutorial/essential/environment/properties.html). It is inspired by the [ant PropertyFile task](https://ant.apache.org/manual/Tasks/propertyfile.html).
|
||||
|
||||
|
@ -17,9 +17,9 @@ val p = project {
|
|||
propertyFile {
|
||||
file = "version.properties"
|
||||
comment = "##Generated file - do not modify!"
|
||||
entry(key = "product.build.major", type = Types.INT, value = "3")
|
||||
entry(key = "product.build.major", value = "3")
|
||||
entry(key = "product.build.minor", type = Types.INT, operation = Operations.ADD)
|
||||
entry(key = "product.build.patch", type = Types.INT, value = "0")
|
||||
entry(key = "product.build.patch", value = "0")
|
||||
entry(key = "product.build.date" , type = Types.DATE, value = "now")
|
||||
}
|
||||
}
|
||||
|
@ -41,17 +41,19 @@ Attribute | Description | Required
|
|||
|
||||
## Entry
|
||||
|
||||
The `entry` function is used to specify modifications to be made to the property file.
|
||||
The `entry` function is used to specify edits to be made to the property file.
|
||||
|
||||
Attribute | Description | Required
|
||||
:-----------|:----------------------------------------------------------------------------------------------------------------- |:----------------------------------------------
|
||||
`key` | The name of the property name/value pair. | Yes, unless `operation` is `Operations.DELETE`
|
||||
`value` | The value of the property. | Yes, unless `operation` is `Operations.DELETE`
|
||||
`default` | The initial value to set for the property if not already defined. For `Type.DATE`, the `now` keyword can be used. | Yes, unless `operation` is `Operations.DELETE`
|
||||
`type` | Tread the value as `Types.INT`, `Types.DATE`, or `Types.STRING` (default). | No
|
||||
`operation` | See [operations](#operations). | No
|
||||
`pattern` | For `Types.INT` and `Types.DATE` only. If present, will parse the value as [DecimalFormat](https://docs.oracle.com/javase/7/docs/api/java/text/DecimalFormat.html) or [SimpleDateFormat](https://docs.oracle.com/javase/6/docs/api/java/text/SimpleDateFormat.html) patterns, respectively. | No
|
||||
`unit` | The unit value to be applied to `Operations.ADD` and `Operations.SUBTRACT` for `Types.DATE`. See [Units](#units). | No
|
||||
Attribute | Description
|
||||
:-----------|:-----------------------------------------------------------------------------------------------------------------
|
||||
`key` | The name of the property name/value pair.
|
||||
`value` | The value of the property.
|
||||
`default` | The initial value to set for the property if not already defined. For `Type.DATE`, the `now` keyword can be used.
|
||||
`type` | Tread the value as `Types.INT`, `Types.DATE`, or `Types.STRING`. If none specified, `Types.STRING` is assumed.
|
||||
`operation` | See [operations](#operations).
|
||||
`pattern` | For `Types.INT` and `Types.DATE` only. If present, will parse the value as [DecimalFormat](https://docs.oracle.com/javase/7/docs/api/java/text/DecimalFormat.html) or [SimpleDateFormat](https://docs.oracle.com/javase/6/docs/api/java/text/SimpleDateFormat.html) patterns, respectively.
|
||||
`unit` | The unit value to be applied to `Operations.ADD` and `Operations.SUBTRACT` for `Types.DATE`. See [Units](#units).
|
||||
|
||||
`key` is required. `value` or `default` are required unless the `operation` is `Operations.DELETE`.
|
||||
|
||||
## Operations
|
||||
|
||||
|
@ -61,21 +63,21 @@ Operation | Description
|
|||
:---------------------|:-------------------------------------------------------------------------
|
||||
`Operations.ADD` | Adds a value to an entry.
|
||||
`Operations.DELETE` | Deletes an entry.
|
||||
`Operations.SET` | Sets the entry value. This is the default.
|
||||
`Operations.SET` | Sets the entry value. This is the default operation.
|
||||
`Operations.SUBTRACT` | Subtracts a value from the entry. For `Types.INT` and `Types.DATE` only.
|
||||
|
||||
## Units
|
||||
|
||||
The following units are available for `Types.DATE` with `Operations.ADD` and `Operations.SUBTRACT`:
|
||||
|
||||
* Units.MILLISECOND
|
||||
* Units.SECOND
|
||||
* Units.MINUTE
|
||||
* Units.HOUR
|
||||
* Units.DAY
|
||||
* Units.WEEK
|
||||
* Units.MONTH
|
||||
* Units.YEAR
|
||||
* `Units.MILLISECOND`
|
||||
* `Units.SECOND`
|
||||
* `Units.MINUTE`
|
||||
* `Units.HOUR`
|
||||
* `Units.DAY`
|
||||
* `Units.WEEK`
|
||||
* `Units.MONTH`
|
||||
* `Units.YEAR`
|
||||
|
||||
## Rules
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue