diff --git a/README.md b/README.md index 67f18d7..c119f25 100755 --- a/README.md +++ b/README.md @@ -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). diff --git a/examples/README.md b/examples/README.md new file mode 100644 index 0000000..cce7e7f --- /dev/null +++ b/examples/README.md @@ -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 +``` diff --git a/examples/src/main/java/com/example/PropertyFileExampleMain.java b/examples/src/main/java/com/example/PropertyFileExampleMain.java index a3dfc35..b23e1e8 100644 --- a/examples/src/main/java/com/example/PropertyFileExampleMain.java +++ b/examples/src/main/java/com/example/PropertyFileExampleMain.java @@ -11,7 +11,10 @@ public class PropertyFileExampleMain { final Path path = Paths.get("version.properties"); if (Files.exists(path)) { final List content = Files.readAllLines(path); - System.out.println("> cat " + path.getFileName()); + System.out.println(""" + +---------------------------+ + | version.properties | + +---------------------------+"""); for (final String line : content) { System.out.println(line); } diff --git a/examples/version.properties b/examples/version.properties index a32e756..435570e 100644 --- a/examples/version.properties +++ b/examples/version.properties @@ -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