-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Script to quickly update the version number
- Loading branch information
1 parent
315ef40
commit 040adec
Showing
2 changed files
with
27 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Update the version number in pom,xml, Const.java and Create-Package.ps1 | ||
if ($args.Length -lt 2) { | ||
Write-Output "Update PDF Juggler version in pom.xml, Const.java and Create-Package.ps1`n" | ||
Write-Output "Usage: Update-Version.ps1 <old_version> <new_version>`n" | ||
Write-Output " old_version: the old version (usually in x.y format)" | ||
Write-Output " new_version: the new version (usually in x.y format)`n" | ||
exit | ||
} | ||
$oldVersion = $args[0] | ||
$newVersion = $args[1] | ||
Function Update-File ($file, $original, $replacement) | ||
{ | ||
Write-Output "Updating $file from ${oldVersion} to ${newVersion}" | ||
(Get-Content $file).replace($original, $replacement) | Set-Content $file | ||
} | ||
|
||
Update-File pom.xml ` | ||
"<version>$oldVersion</version><!-- Main version -->" ` | ||
"<version>$newVersion</version><!-- Main version -->" | ||
Update-File src/main/java/cloud/bernardi/pdfjuggler/Const.java ` | ||
"public static final String VERSION = `"$oldVersion`";" ` | ||
"public static final String VERSION = `"$newVersion`";" | ||
Update-File Create-Package.ps1 ` | ||
"`$Version = `"$oldVersion`"" ` | ||
"`$Version = `"$newVersion`"" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters