Put the commit hash into the msvc binary package
This commit is contained in:
parent
9fcad3a144
commit
a703349883
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -17,4 +17,3 @@ configure text
|
||||
*.sh eol=lf
|
||||
configure eol=lf
|
||||
VERSION.txt eol=lf
|
||||
shared/GetCommitHash.cmd text eol=crlf
|
||||
|
@ -106,7 +106,8 @@ def build(arch, packageDir, xp=False):
|
||||
'"' + devCmdPath + '" && '
|
||||
" vcbuild.bat" +
|
||||
" --gyp-msvs-version " + versionInfo["gyp_version"] +
|
||||
" --msvc-platform " + archInfo["msvc_platform"]
|
||||
" --msvc-platform " + archInfo["msvc_platform"] +
|
||||
" --commit-hash " + common_ship.commitHash
|
||||
)
|
||||
|
||||
subprocess.check_call(commandLine, shell=True, env=newEnv)
|
||||
|
@ -6,13 +6,9 @@ rem -- output nothing instead.
|
||||
mkdir ..\gen 2>nul
|
||||
|
||||
set /p VERSION=<..\..\VERSION.txt
|
||||
git rev-parse HEAD >nul 2>nul && (
|
||||
for /F "delims=" %%i IN ('git rev-parse HEAD') DO set COMMIT=%%i
|
||||
) || (
|
||||
set COMMIT=none
|
||||
)
|
||||
set COMMIT=%1
|
||||
|
||||
echo // AUTO-GENERATED BY %0>..\gen\GenVersion.h
|
||||
echo // AUTO-GENERATED BY %0 %*>..\gen\GenVersion.h
|
||||
echo const char GenVersion_Version[] = "%VERSION%";>>..\gen\GenVersion.h
|
||||
echo const char GenVersion_Commit[] = "%COMMIT%";>>..\gen\GenVersion.h
|
||||
|
||||
|
@ -9,6 +9,9 @@
|
||||
# can be configured by passing variables to make, e.g.:
|
||||
# make -j4 CXX=i686-w64-mingw32-g++ LDFLAGS="-static -static-libgcc -static-libstdc++"
|
||||
|
||||
'variables': {
|
||||
'WINPTY_COMMIT_HASH%': '<!(cmd /c "cd shared && GetCommitHash.bat")',
|
||||
},
|
||||
'target_defaults' : {
|
||||
'defines' : [
|
||||
'UNICODE',
|
||||
@ -19,7 +22,7 @@
|
||||
'include_dirs': [
|
||||
# Add the 'src/gen' directory to the include path and force gyp to
|
||||
# run the script (re)generating the version header.
|
||||
'<!(cmd /c "cd shared && UpdateGenVersion.bat")',
|
||||
'<!(cmd /c "cd shared && UpdateGenVersion.bat <(WINPTY_COMMIT_HASH)")',
|
||||
],
|
||||
},
|
||||
'targets' : [
|
||||
|
@ -43,6 +43,11 @@ if "%1" == "--toolset" (
|
||||
shift && shift
|
||||
goto :ParamLoop
|
||||
)
|
||||
if "%1" == "--commit-hash" (
|
||||
set GYP_ARGS=%GYP_ARGS% -D WINPTY_COMMIT_HASH=%2
|
||||
shift && shift
|
||||
goto :ParamLoop
|
||||
)
|
||||
echo error: Unrecognized argument: %1
|
||||
exit /b 1
|
||||
:ParamDone
|
||||
|
Loading…
Reference in New Issue
Block a user