Added build number to version readout.

This commit is contained in:
Sandy Mossgrave 2023-05-08 00:15:39 +00:00
parent 713c0f068a
commit 4bbcbcf290
5 changed files with 14 additions and 3 deletions

4
.gitignore vendored
View File

@ -3,3 +3,7 @@
/priestessconfig.txtbkup
/target/
dependency-reduced-pom.xml
buildNumber.properties
.classpath
.project
.settings/

View File

@ -4,7 +4,7 @@
<groupId>com.tinyplantnews.priestess</groupId>
<artifactId>Priestess</artifactId>
<name>Priestesss of the Bean Goose Cult</name>
<version>0.1</version>
<version>0.2</version>
<packaging>jar</packaging>
<scm>
<connection>scm:git:https://tinyplantnews.com/git/Priestess.git</connection>

View File

@ -209,7 +209,7 @@ public class Configuration {
private static Properties getJarProperties() {
Properties props = new Properties();
try {
props.load(Configuration.class.getClassLoader().getResourceAsStream("version/version.properties"));
props.load(Configuration.class.getClassLoader().getResourceAsStream("version.properties"));
} catch (IOException e) {
log.log(Level.SEVERE, "Problem encountered while loading basic jar properties: {0}", e);
return null;
@ -219,15 +219,18 @@ public class Configuration {
public static final String PROGNAME;
public static final String VERSION;
public static final String BUILD;
static {
Properties props = getJarProperties();
if (props == null) {
PROGNAME = "Priestess, probably";
VERSION = "(version unknown)";
BUILD = "(unknown build number)";
} else {
PROGNAME = props.getProperty("progname");
VERSION = props.getProperty("version");
BUILD = props.getProperty("build");
}
}

View File

@ -41,6 +41,7 @@ import org.reactivestreams.Publisher;
import reactor.core.publisher.Mono;
import static com.tinyplantnews.priestess.Configuration.PROGNAME;
import static com.tinyplantnews.priestess.Configuration.VERSION;
import static com.tinyplantnews.priestess.Configuration.BUILD;
/**
*
@ -863,7 +864,7 @@ public class Priestess {
public final Callback listCommandsCommand = new Callback() {
@Override
public Publisher<Mono> apply(CommandArgs o) {
o.replyWith(PROGNAME + " " + VERSION);
o.replyWith(PROGNAME + " " + VERSION + " build number " + BUILD);
for (String name : Command.commands.keySet()) {
o.replyWith(" Help for command " + name + ": " + Command.commands.get(name).getHelp());
}

View File

@ -0,0 +1,3 @@
progname=${name}
version=${version}
build=${buildNumber}