From c66ab97d19269caf851487a6666f92e3e01ceedd Mon Sep 17 00:00:00 2001 From: Fan Yang Date: Fri, 19 Jan 2024 17:07:12 +0800 Subject: [PATCH] add build script on Windows --- build.bat | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 build.bat diff --git a/build.bat b/build.bat new file mode 100644 index 0000000..68761b4 --- /dev/null +++ b/build.bat @@ -0,0 +1,11 @@ +@echo off +set PATH=%PATH%;H:\msys64\mingw64\bin +set CGO_ENABLED=1 +for /F "tokens=*" %%R in ('git rev-parse --short HEAD') do set REV=%%R +for /F "tokens=*" %%A in ('date /T') do set TODAY=%%A +@echo on +go build -ldflags="-s -w -X main.sha1ver=%REV% -X 'main.buildTime=%TODAY%'" -tags lua51 -o getnovel-lua51.exe +go build -ldflags="-s -w -X main.sha1ver=%REV% -X 'main.buildTime=%TODAY%'" -tags lua52 -o getnovel-lua52.exe +go build -ldflags="-s -w -X main.sha1ver=%REV% -X 'main.buildTime=%TODAY%'" -tags lua53 -o getnovel-lua53.exe +go build -ldflags="-s -w -X main.sha1ver=%REV% -X 'main.buildTime=%TODAY%'" -tags lua54 -o getnovel-lua54.exe +go build -ldflags="-s -w -X main.sha1ver=%REV% -X 'main.buildTime=%TODAY%'" -tags luajit -o getnovel-luajit.exe