Change version numbering

This commit is contained in:
Jafea7 2025-05-04 20:22:20 +10:00
parent 672b0f8102
commit e8439d7b71
7 changed files with 38 additions and 5 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

23
update-version.sh Executable file
View File

@ -0,0 +1,23 @@
#!/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
pushd master
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."
popd