forked from omriharel/deej
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild-dev.bat
26 lines (20 loc) · 836 Bytes
/
build-dev.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
@ECHO OFF
ECHO Building deej (development)...
REM set repo root in relation to script path to avoid cwd dependency
SET "DEEJ_ROOT=%~dp0..\.."
REM shove git commit, version tag into env
for /f "delims=" %%a in ('git rev-list -1 --abbrev-commit HEAD') do @set GIT_COMMIT=%%a
for /f "delims=" %%a in ('git describe --tags --always') do @set VERSION_TAG=%%a
set BUILD_TYPE=dev
ECHO Embedding build-time parameters:
ECHO - gitCommit %GIT_COMMIT%
ECHO - versionTag %VERSION_TAG%
ECHO - buildType %BUILD_TYPE%
go build -o "%DEEJ_ROOT%\deej-dev.exe" -ldflags "-X main.gitCommit=%GIT_COMMIT% -X main.versionTag=%VERSION_TAG% -X main.buildType=%BUILD_TYPE%" "%DEEJ_ROOT%\cmd"
if %ERRORLEVEL% NEQ 0 GOTO BUILDERROR
ECHO Done.
GOTO DONE
:BUILDERROR
ECHO Failed to build deej in development mode! See above output for details.
EXIT /B 1
:DONE