Change version numbering

This commit is contained in:
Jafea7 2025-05-04 20:22:20 +10:00
parent 239831daa8
commit a78c9f182b
7 changed files with 34 additions and 5 deletions

View File

@ -8,7 +8,7 @@
<parent> <parent>
<groupId>ctbrec</groupId> <groupId>ctbrec</groupId>
<artifactId>master</artifactId> <artifactId>master</artifactId>
<version>5.3.2</version> <version>25.05.04</version>
<relativePath>../master</relativePath> <relativePath>../master</relativePath>
</parent> </parent>

View File

@ -223,7 +223,7 @@ public class CamrecApplication extends Application {
LOG.debug("Creating GUI"); LOG.debug("Creating GUI");
DesktopIntegration.setRecorder(recorder); DesktopIntegration.setRecorder(recorder);
DesktopIntegration.setPrimaryStage(primaryStage); DesktopIntegration.setPrimaryStage(primaryStage);
CamrecApplication.title = "CTB Recorder " + Version.getVersion(); CamrecApplication.title = "CTB Recorder " + Version.getVersion().toDisplayString();
primaryStage.setTitle(title); primaryStage.setTitle(title);
InputStream icon = getClass().getResourceAsStream("/icon.png"); InputStream icon = getClass().getResourceAsStream("/icon.png");
primaryStage.getIcons().add(new Image(icon)); primaryStage.getIcons().add(new Image(icon));

View File

@ -8,7 +8,7 @@
<parent> <parent>
<groupId>ctbrec</groupId> <groupId>ctbrec</groupId>
<artifactId>master</artifactId> <artifactId>master</artifactId>
<version>5.3.2</version> <version>25.05.04</version>
<relativePath>../master</relativePath> <relativePath>../master</relativePath>
</parent> </parent>

View File

@ -14,6 +14,11 @@ public class Version implements Comparable<Version> {
int revision = 0; int revision = 0;
String designator = ""; String designator = "";
public String toDisplayString() {
return String.format("%02d.%02d.%02d", major, minor, revision) +
(designator.isEmpty() ? "" : "-" + designator);
}
public static Version of(String s) { public static Version of(String s) {
Objects.requireNonNull(s, "Version string cannot be null"); Objects.requireNonNull(s, "Version string cannot be null");
Pattern p = Pattern.compile("(\\d+)\\.(\\d+)\\.(\\d+)(?:-(.+))?"); Pattern p = Pattern.compile("(\\d+)\\.(\\d+)\\.(\\d+)(?:-(.+))?");

View File

@ -11,7 +11,7 @@
<groupId>ctbrec</groupId> <groupId>ctbrec</groupId>
<artifactId>master</artifactId> <artifactId>master</artifactId>
<packaging>pom</packaging> <packaging>pom</packaging>
<version>5.3.2</version> <version>25.05.04</version>
<modules> <modules>
<module>../common</module> <module>../common</module>
@ -49,6 +49,11 @@
<redirectTestOutputToFile>true</redirectTestOutputToFile> <redirectTestOutputToFile>true</redirectTestOutputToFile>
</configuration> </configuration>
</plugin> </plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>2.15.0</version>
</plugin>
</plugins> </plugins>
</pluginManagement> </pluginManagement>
<plugins> <plugins>

View File

@ -8,7 +8,7 @@
<parent> <parent>
<groupId>ctbrec</groupId> <groupId>ctbrec</groupId>
<artifactId>master</artifactId> <artifactId>master</artifactId>
<version>5.3.2</version> <version>25.05.04</version>
<relativePath>../master</relativePath> <relativePath>../master</relativePath>
</parent> </parent>

19
update-version.sh Executable file
View File

@ -0,0 +1,19 @@
#!/bin/bash
# Usage: ./update-version.sh 1.2.3
NEW_VERSION=$1
if [[ -z "$NEW_VERSION" ]]; then
echo "Usage: $0 <new-version>"
exit 1
fi
echo "Updating Maven project version to $NEW_VERSION..."
# Step 1: Update the parent POM and all modules
mvn versions:set -DnewVersion="$NEW_VERSION"
# Step 2: Commit changes
mvn versions:commit
echo "Version updated to $NEW_VERSION in all modules."