Updated examples

This commit is contained in:
Erik C. Thauvin 2023-04-02 17:24:46 -07:00
parent bf0c9bf1fe
commit 26f0709562
4 changed files with 43 additions and 5 deletions

View file

@ -1,7 +1,7 @@
# [Bld](https://github.com/rife2/rife2/wiki/What-Is-Bld) Extension to Create or Modify Properties Files
[![License (3-Clause BSD)](https://img.shields.io/badge/license-BSD%203--Clause-blue.svg?style=flat-square)](http://opensource.org/licenses/BSD-3-Clause)
[![GitHub CI](https://github.com/rife2/bld-property-file/actions/workflows/bld.yml/badge.svg)](https://github.com/rife2/bld-property-file/actions/workflows/gradle.yml)
[![GitHub CI](https://github.com/rife2/bld-property-file/actions/workflows/bld.yml/badge.svg)](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).

35
examples/README.md Normal file
View 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
```

View file

@ -11,7 +11,10 @@ public class PropertyFileExampleMain {
final Path path = Paths.get("version.properties");
if (Files.exists(path)) {
final List<String> content = Files.readAllLines(path);
System.out.println("> cat " + path.getFileName());
System.out.println("""
+---------------------------+
| version.properties |
+---------------------------+""");
for (final String line : content) {
System.out.println(line);
}

View file

@ -1,5 +1,5 @@
#
#Sun Apr 02 15:20:15 PDT 2023
version.major=3
#Sun Apr 02 17:19:10 PDT 2023
version.major=1
version.minor=0
version.patch=0
version.patch=1