summaryrefslogtreecommitdiff
path: root/build/windows/set-smapi-version.ps1
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2021-12-05 19:10:39 -0500
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2021-12-05 19:10:39 -0500
commit8a2618d812e4e2f36161907af5af5c484eb37abf (patch)
treec164325cf57fb43e4375e94dc584fbc3ab3ceeb5 /build/windows/set-smapi-version.ps1
parent42e878e77d58569be81e34ca206a78e0ebe0604d (diff)
parent5b5dd47c22a1332a4c432d6a1cd414b5c83388d7 (diff)
downloadSMAPI-8a2618d812e4e2f36161907af5af5c484eb37abf.tar.gz
SMAPI-8a2618d812e4e2f36161907af5af5c484eb37abf.tar.bz2
SMAPI-8a2618d812e4e2f36161907af5af5c484eb37abf.zip
Merge branch 'develop' into stable
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`""
+}