Updated example to cat the version properties file.

This commit is contained in:
Erik C. Thauvin 2018-07-07 01:40:16 -07:00
parent abe1ca269c
commit b50f2bad9a
10 changed files with 58 additions and 26 deletions

View file

@ -41,4 +41,7 @@ run {
doFirst {
println "Version: $version"
}
}
// args = ['example.properties']
args = ['version.properties']
}

View file

@ -1,12 +1,20 @@
/*
* This Java source file was generated by the Gradle 'init' task.
*/
public class App {
public static void main(String[] args) {
System.out.println(new App().getGreeting());
}
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.List;
public String getGreeting() {
return "Hello world.";
public class App {
public static void main(String... args) throws IOException {
if (args.length == 1) {
final Path path = Paths.get(args[0]);
if (Files.exists(path)) {
final List<String> content = Files.readAllLines(path);
System.out.println("> cat " + path.getFileName());
for (final String line : content) {
System.out.println(line);
}
}
}
}
}
}

View file

@ -1,5 +1,5 @@
#Generated by the Semver Plugin for Gradle
#Tue Jul 03 21:18:17 PDT 2018
#Sat Jul 07 01:16:12 PDT 2018
version.prerelease=
version.buildmeta=
version.patch=2