summaryrefslogtreecommitdiff
path: root/build/windows/set-smapi-version.ps1
diff options
context:
space:
mode:
Diffstat (limited to 'build/windows/set-smapi-version.ps1')
-rw-r--r--build/windows/set-smapi-version.ps125
1 files changed, 25 insertions, 0 deletions
diff --git a/build/windows/set-smapi-version.ps1 b/build/windows/set-smapi-version.ps1
new file mode 100644
index 00000000..ff6b2096
--- /dev/null
+++ b/build/windows/set-smapi-version.ps1
@@ -0,0 +1,25 @@
+#
+#
+# This is the PowerShell equivalent of ../unix/set-smapi-version.sh.
+# When making changes, both scripts should be updated.
+#
+#
+
+
+. "$PSScriptRoot\lib\in-place-regex.ps1"
+
+# get version number
+$version=$args[0]
+if (!$version) {
+ $version = Read-Host "SMAPI release version (like '4.0.0')"
+}
+
+# move to SMAPI root
+cd "$PSScriptRoot/../.."
+
+# apply changes
+In-Place-Regex -Path "build/common.targets" -Search "<Version>.+</Version>" -Replace "<Version>$version</Version>"
+In-Place-Regex -Path "src/SMAPI/Constants.cs" -Search "RawApiVersion = `".+?`";" -Replace "RawApiVersion = `"$version`";"
+ForEach ($modName in "ConsoleCommands","ErrorHandler","SaveBackup") {
+ In-Place-Regex -Path "src/SMAPI.Mods.$modName/manifest.json" -Search "`"(Version|MinimumApiVersion)`": `".+?`"" -Replace "`"`$1`": `"$version`""
+}