Updated examples
This commit is contained in:
parent
bf0c9bf1fe
commit
26f0709562
4 changed files with 43 additions and 5 deletions
|
@ -1,7 +1,7 @@
|
||||||
# [Bld](https://github.com/rife2/rife2/wiki/What-Is-Bld) Extension to Create or Modify Properties Files
|
# [Bld](https://github.com/rife2/rife2/wiki/What-Is-Bld) Extension to Create or Modify Properties Files
|
||||||
|
|
||||||
[](http://opensource.org/licenses/BSD-3-Clause)
|
[](http://opensource.org/licenses/BSD-3-Clause)
|
||||||
[](https://github.com/rife2/bld-property-file/actions/workflows/gradle.yml)
|
[](https://github.com/rife2/bld-property-file/actions/workflows/bld.yml)
|
||||||
|
|
||||||
|
|
||||||
An extension for creating or modifying [property files](https://docs.oracle.com/javase/tutorial/essential/environment/properties.html) with [bld](https://github.com/rife2/rife2/wiki/What-Is-Bld). It is inspired by the [ant PropertyFile task](https://ant.apache.org/manual/Tasks/propertyfile.html).
|
An extension for creating or modifying [property files](https://docs.oracle.com/javase/tutorial/essential/environment/properties.html) with [bld](https://github.com/rife2/rife2/wiki/What-Is-Bld). It is inspired by the [ant PropertyFile task](https://ant.apache.org/manual/Tasks/propertyfile.html).
|
||||||
|
|
35
examples/README.md
Normal file
35
examples/README.md
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
# [Bld Property File](https://github.com/rife2/bld-property-file) Extension Examples
|
||||||
|
|
||||||
|
## Compile
|
||||||
|
|
||||||
|
First make sure the project is compiled, by issuing the following command:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
./bld compile
|
||||||
|
```
|
||||||
|
## Run
|
||||||
|
|
||||||
|
To run the examples, issue one of the following command or combination there off.
|
||||||
|
|
||||||
|
```shell
|
||||||
|
./bld updateMajor run
|
||||||
|
./bld updateMinor run
|
||||||
|
./bld updatePatch run
|
||||||
|
```
|
||||||
|
Upon execution, the content of the `verison.properties` file will be displayed, reflecting the modification to the
|
||||||
|
`version.major`, `version.minor` or `version.patch` properties.
|
||||||
|
|
||||||
|
```shell
|
||||||
|
./bld updatePatch run
|
||||||
|
```
|
||||||
|
|
||||||
|
```shell
|
||||||
|
+---------------------------+
|
||||||
|
| version.properties |
|
||||||
|
+---------------------------+
|
||||||
|
#
|
||||||
|
#Sun Apr 02 17:19:10 PDT 2023
|
||||||
|
version.major=1
|
||||||
|
version.minor=0
|
||||||
|
version.patch=1
|
||||||
|
```
|
|
@ -11,7 +11,10 @@ public class PropertyFileExampleMain {
|
||||||
final Path path = Paths.get("version.properties");
|
final Path path = Paths.get("version.properties");
|
||||||
if (Files.exists(path)) {
|
if (Files.exists(path)) {
|
||||||
final List<String> content = Files.readAllLines(path);
|
final List<String> content = Files.readAllLines(path);
|
||||||
System.out.println("> cat " + path.getFileName());
|
System.out.println("""
|
||||||
|
+---------------------------+
|
||||||
|
| version.properties |
|
||||||
|
+---------------------------+""");
|
||||||
for (final String line : content) {
|
for (final String line : content) {
|
||||||
System.out.println(line);
|
System.out.println(line);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#
|
#
|
||||||
#Sun Apr 02 15:20:15 PDT 2023
|
#Sun Apr 02 17:19:10 PDT 2023
|
||||||
version.major=3
|
version.major=1
|
||||||
version.minor=0
|
version.minor=0
|
||||||
version.patch=0
|
version.patch=1
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue