aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.Client/prebuild.ps1
diff options
context:
space:
mode:
authorrtm516 <rtm516@users.noreply.github.com>2026-03-07 19:55:44 +0000
committerGitHub <noreply@github.com>2026-03-07 13:55:44 -0600
commit9cac3e039483c59477bae2edc03a3780afe49bd6 (patch)
tree7f21f31b42b41438da81e11c07a9d9bb3cf4289a /Minecraft.Client/prebuild.ps1
parente5ad785803ff5867b5d5c38efb85947819eb72db (diff)
Change F3 rendering and add git version information (#836)
* Change F3 rendering and add git version information * Change position, block, chunk and facing * Limit position decimal places * Move LCE unique to the bottom and add more java features * Fix chunk information disappearing after y256 * Add chunk count information * Move build number script to prebuild.ps1 * We dont need to specify vector and wstring are from std * Restore build number to fix multiplayer * Use short symbolic-ref * Restore original BuildVer.h --------- Co-authored-by: Loki <lokio.casebstv@gmail.com> Co-authored-by: Loki Rautio <lokirautio@gmail.com>
Diffstat (limited to 'Minecraft.Client/prebuild.ps1')
-rw-r--r--Minecraft.Client/prebuild.ps124
1 files changed, 24 insertions, 0 deletions
diff --git a/Minecraft.Client/prebuild.ps1 b/Minecraft.Client/prebuild.ps1
new file mode 100644
index 00000000..fa2c487c
--- /dev/null
+++ b/Minecraft.Client/prebuild.ps1
@@ -0,0 +1,24 @@
+$sha = (git rev-parse --short=7 HEAD)
+$ref = (git symbolic-ref --short HEAD)
+$build = 560 # Note: Build/network has to stay static for now, as without it builds wont be able to play together. We can change it later when we have a better versioning scheme in place.
+$suffix = ""
+
+# TODO Re-enable
+# If we are running in GitHub Actions, use the run number as the build number
+# if ($env:GITHUB_RUN_NUMBER) {
+# $build = $env:GITHUB_RUN_NUMBER
+# }
+
+# If we have uncommitted changes, add a suffix to the version string
+if (git status --porcelain) {
+ $suffix = "-dev"
+}
+
+@"
+#pragma once
+
+#define VER_PRODUCTBUILD $build
+#define VER_PRODUCTVERSION_STR_W L"$sha$suffix ($ref)"
+#define VER_FILEVERSION_STR_W VER_PRODUCTVERSION_STR_W
+#define VER_NETWORK VER_PRODUCTBUILD
+"@ | Set-Content "Common/BuildVer.h"