From 2ae852b73a8f1bdc076835c2ebbc3e33ab10cb91 Mon Sep 17 00:00:00 2001 From: Brad Lewis <22850972+BradLewis@users.noreply.github.com> Date: Wed, 23 Jul 2025 07:43:40 -0400 Subject: Add version information to the build scripts --- build.bat | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'build.bat') diff --git a/build.bat b/build.bat index 6582e0d..387210e 100644 --- a/build.bat +++ b/build.bat @@ -1,12 +1,18 @@ @echo off setlocal enabledelayedexpansion + + +for /f %%a in ('git rev-parse --short HEAD 2^>NUL') do set commit_hash=%%a +for /f %%d in ('powershell -command "[DateTime]::UtcNow.ToString('yyyy-MM-dd')"') do set today=%%d +set version=dev-%today%-%commit_hash% + if "%1" == "test" ( odin test tests -collection:src=src -debug -define:ODIN_TEST_THREADS=1 -define:ODIN_TEST_TRACK_MEMORY=false -extra-linker-flags:"/STACK:4000000,2000000" ) else if "%1" == "single_test" ( odin test tests -collection:src=src -define:ODIN_TEST_NAMES=%2 -define:ODIN_TEST_TRACK_MEMORY=false -debug -extra-linker-flags:"/STACK:4000000,2000000" ) else if "%1" == "debug" ( - odin build src\ -show-timings -microarch:native -collection:src=src -out:ols.exe -o:minimal -no-bounds-check -use-separate-modules -debug -extra-linker-flags:"/STACK:4000000,2000000" + odin build src\ -show-timings -microarch:native -collection:src=src -out:ols.exe -o:minimal -no-bounds-check -use-separate-modules -debug -extra-linker-flags:"/STACK:4000000,2000000" -define:VERSION=%version%-debug ) else ( - odin build src\ -show-timings -microarch:native -collection:src=src -out:ols.exe -o:speed -no-bounds-check -extra-linker-flags:"/STACK:4000000,2000000" -) + odin build src\ -show-timings -microarch:native -collection:src=src -out:ols.exe -o:speed -no-bounds-check -extra-linker-flags:"/STACK:4000000,2000000" -define:VERSION=%version% +) -- cgit v1.2.3