Added SetVersion script, and updated versions to 1.0.1.
This commit is contained in:
parent
017e01a935
commit
ceddc49adf
2
pom.xml
2
pom.xml
|
@ -6,7 +6,7 @@
|
|||
|
||||
<groupId>com.andrewlalis</groupId>
|
||||
<artifactId>perfin</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<version>1.0.1</version>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>21</maven.compiler.source>
|
||||
|
|
|
@ -0,0 +1,53 @@
|
|||
import java.io.*;
|
||||
import java.nio.file.*;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* Utility script that updates the program's version in the many places where
|
||||
* it's used, as opposed to making a fancy system to introspect the POM to get
|
||||
* the version. Simply call <code>java scripts/SetVersion.java <your version here></code>
|
||||
* and it'll update all the necessary files.
|
||||
*/
|
||||
class SetVersion {
|
||||
public static void main(String[] args) throws Exception {
|
||||
if (args.length < 1) {
|
||||
System.out.println("Missing required version argument.");
|
||||
System.exit(1);
|
||||
}
|
||||
String version = args[0].strip();
|
||||
System.out.println("Setting application to version " + version + " Is this okay? (yes/no)");
|
||||
var reader = new BufferedReader(new InputStreamReader(System.in));
|
||||
String response = reader.readLine();
|
||||
if (!response.equalsIgnoreCase("yes")) {
|
||||
System.out.println("Exiting.");
|
||||
System.exit(1);
|
||||
}
|
||||
|
||||
replaceInFile(
|
||||
Path.of("scripts", "package-linux-deb.sh"),
|
||||
"--app-version .* \\\\",
|
||||
"--app-version \"" + version + "\" \\\\"
|
||||
);
|
||||
replaceInFile(
|
||||
Path.of("scripts", "package-windows-msi.ps1"),
|
||||
"--app-version .* `",
|
||||
"--app-version \"" + version + "\" `"
|
||||
);
|
||||
replaceInFile(
|
||||
Path.of("pom.xml"),
|
||||
"<version>.*</version>",
|
||||
"<version>" + version + "</version>"
|
||||
);
|
||||
replaceInFile(
|
||||
Path.of("src", "main", "resources", "main-view.fxml"),
|
||||
"text=\"Perfin .*\"",
|
||||
"text=\"Perfin Version " + version + "\""
|
||||
);
|
||||
}
|
||||
|
||||
private static void replaceInFile(Path file, String pattern, String replacement) throws IOException {
|
||||
System.out.println("Replacing " + pattern + " with " + replacement + " in " + file);
|
||||
String fileContent = Files.readString(file);
|
||||
Files.writeString(file, fileContent.replaceFirst(pattern, replacement));
|
||||
}
|
||||
}
|
|
@ -24,7 +24,7 @@ module_path="$module_path:target/modules/h2-2.2.224.jar"
|
|||
|
||||
jpackage \
|
||||
--name "Perfin" \
|
||||
--app-version "1.0.0" \
|
||||
--app-version "1.0.1" \
|
||||
--description "Desktop application for personal finance. Add your accounts, track transactions, and store receipts, invoices, and more." \
|
||||
--icon design/perfin-logo_256.png \
|
||||
--vendor "Andrew Lalis" \
|
||||
|
|
|
@ -12,7 +12,7 @@ $modulePath = "$modulePath;target\modules\h2-2.2.224.jar"
|
|||
|
||||
jpackage `
|
||||
--name "Perfin" `
|
||||
--app-version "1.0.0" `
|
||||
--app-version "1.0.1" `
|
||||
--description "Desktop application for personal finance. Add your accounts, track transactions, and store receipts, invoices, and more." `
|
||||
--icon design\perfin-logo_256.ico `
|
||||
--vendor "Andrew Lalis" `
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
</top>
|
||||
<bottom>
|
||||
<HBox styleClass="std-padding,std-spacing">
|
||||
<Label text="Perfin v0.0.1"/>
|
||||
<Label text="Perfin Version 1.0.1"/>
|
||||
</HBox>
|
||||
</bottom>
|
||||
</BorderPane>
|
||||
|
|
Loading…
Reference in New Issue