From 6120484e46886fbc798c85a523bfe196faa1f60f Mon Sep 17 00:00:00 2001 From: Steve Dower Date: Sat, 4 Mar 2017 10:08:09 -0800 Subject: [PATCH] bpo-27593: Updates Windows build to use information from git (#262) (#448) * bpo-27593: Updates Windows build to use information from git (#262) * bpo-27593: Updates Windows build to use information from git * Fixes git command (#451) --- Demo/turtle/tdemo_two_canvases.py | 0 PCbuild/build.bat | 6 +++++- PCbuild/pythoncore.vcxproj | 22 +++++++++++++++------- 3 files changed, 20 insertions(+), 8 deletions(-) mode change 100644 => 100755 Demo/turtle/tdemo_two_canvases.py diff --git a/Demo/turtle/tdemo_two_canvases.py b/Demo/turtle/tdemo_two_canvases.py old mode 100644 new mode 100755 diff --git a/PCbuild/build.bat b/PCbuild/build.bat index 766378fb2daa9c..b8f4191fd1fc17 100644 --- a/PCbuild/build.bat +++ b/PCbuild/build.bat @@ -104,6 +104,10 @@ if "%platf%"=="x64" ( ) ) +if not exist "%GIT%" where git > "%TEMP%\git.loc" 2> nul && set /P GIT= < "%TEMP%\git.loc" & del "%TEMP%\git.loc" +if exist "%GIT%" set GITProperty=/p:GIT="%GIT%" +if not exist "%GIT%" echo Cannot find Git on PATH & set GITProperty= + rem Setup the environment call "%dir%env.bat" %vs_platf% >nul @@ -140,7 +144,7 @@ msbuild "%dir%pcbuild.proj" /t:%target% %parallel% %verbose%^ /p:Configuration=%conf% /p:Platform=%platf%^ /p:IncludeExternals=%IncludeExternals%^ /p:IncludeSSL=%IncludeSSL% /p:IncludeTkinter=%IncludeTkinter%^ - /p:IncludeBsddb=%IncludeBsddb%^ + /p:IncludeBsddb=%IncludeBsddb% %GITProperty%^ %1 %2 %3 %4 %5 %6 %7 %8 %9 @echo off diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj index da5d5d9ed3c8a8..b894e27f83260c 100644 --- a/PCbuild/pythoncore.vcxproj +++ b/PCbuild/pythoncore.vcxproj @@ -391,17 +391,25 @@ - - - - $([System.IO.File]::ReadAllText('$(IntDir)hgbranch.txt').Trim()) - $([System.IO.File]::ReadAllText('$(IntDir)hgversion.txt').Trim()) - $([System.IO.File]::ReadAllText('$(IntDir)hgtag.txt').Trim()) + git + <_GIT>$(GIT) + <_GIT Condition="$(GIT.Contains(` `))">"$(GIT)" + + + + + + + $([System.IO.File]::ReadAllText('$(IntDir)gitbranch.txt').Trim()) + $([System.IO.File]::ReadAllText('$(IntDir)gitversion.txt').Trim()) + $([System.IO.File]::ReadAllText('$(IntDir)gittag.txt').Trim()) + + - HGVERSION="$(HgVersion)";HGTAG="$(HgTag)";HGBRANCH="$(HgBranch)";%(PreprocessorDefinitions) + GITVERSION="$(GitVersion)";GITTAG="$(GitTag)";GITBRANCH="$(GitBranch)";%(PreprocessorDefinitions)