|
407 | 407 | </ImportGroup>
|
408 | 408 | <Target Name="_GetBuildInfo" BeforeTargets="PrepareForBuild">
|
409 | 409 | <PropertyGroup>
|
410 |
| - <HG Condition="$(HG) == ''">hg</HG> |
411 |
| - <_HG>$(HG)</_HG> |
412 |
| - <_HG Condition="$(HG.Contains(` `))">"$(HG)"</_HG> |
| 410 | + <GIT Condition="$(GIT) == ''">git</GIT> |
| 411 | + <_GIT>$(GIT)</_GIT> |
| 412 | + <_GIT Condition="$(GIT.Contains(` `))">"$(GIT)"</_GIT> |
413 | 413 | </PropertyGroup>
|
414 |
| - <Message Text="Getting build info from $(_HG)" Importance="high" /> |
| 414 | + <Message Text="Getting build info from $(_GIT)" Importance="high" /> |
415 | 415 | <MakeDir Directories="$(IntDir)" Condition="!Exists($(IntDir))" />
|
416 |
| - <Exec Command="$(_HG) id -b > "$(IntDir)hgbranch.txt"" ContinueOnError="true" /> |
417 |
| - <Exec Command="$(_HG) id -i > "$(IntDir)hgversion.txt"" ContinueOnError="true" /> |
418 |
| - <Exec Command="$(_HG) id -t > "$(IntDir)hgtag.txt"" ContinueOnError="true" /> |
| 416 | + <Exec Command="$(_GIT) name-rev --name-only HEAD > "$(IntDir)gitbranch.txt"" ContinueOnError="true" /> |
| 417 | + <Exec Command="$(_GIT) rev-parse HEAD > "$(IntDir)gitversion.txt"" ContinueOnError="true" /> |
| 418 | + <Exec Command="$(_GIT) name-rev --tags --name id -t > "$(IntDir)gittag.txt"" ContinueOnError="true" /> |
419 | 419 | <PropertyGroup>
|
420 |
| - <HgBranch Condition="Exists('$(IntDir)hgbranch.txt')">$([System.IO.File]::ReadAllText('$(IntDir)hgbranch.txt').Trim())</HgBranch> |
421 |
| - <HgVersion Condition="Exists('$(IntDir)hgversion.txt')">$([System.IO.File]::ReadAllText('$(IntDir)hgversion.txt').Trim())</HgVersion> |
422 |
| - <HgTag Condition="Exists('$(IntDir)hgtag.txt')">$([System.IO.File]::ReadAllText('$(IntDir)hgtag.txt').Trim())</HgTag> |
| 420 | + <GitBranch Condition="Exists('$(IntDir)gitbranch.txt')">$([System.IO.File]::ReadAllText('$(IntDir)gitbranch.txt').Trim())</GitBranch> |
| 421 | + <GitVersion Condition="Exists('$(IntDir)gitversion.txt')">$([System.IO.File]::ReadAllText('$(IntDir)gitversion.txt').Trim())</GitVersion> |
| 422 | + <GitTag Condition="Exists('$(IntDir)gittag.txt')">$([System.IO.File]::ReadAllText('$(IntDir)gittag.txt').Trim())</GitTag> |
423 | 423 | </PropertyGroup>
|
424 |
| - <Message Text="Building $(HgTag):$(HgVersion) $(HgBranch)" Importance="high" /> |
| 424 | + <Message Text="Building $(GitTag):$(GitVersion) $(GitBranch)" Importance="high" /> |
425 | 425 | <ItemGroup>
|
426 | 426 | <ClCompile Include="..\Modules\getbuildinfo.c">
|
427 |
| - <PreprocessorDefinitions>HGVERSION="$(HgVersion)";HGTAG="$(HgTag)";HGBRANCH="$(HgBranch)";%(PreprocessorDefinitions)</PreprocessorDefinitions> |
| 427 | + <PreprocessorDefinitions>GITVERSION="$(GitVersion)";GITTAG="$(GitTag)";GITBRANCH="$(GitBranch)";%(PreprocessorDefinitions)</PreprocessorDefinitions> |
428 | 428 | </ClCompile>
|
429 | 429 | </ItemGroup>
|
430 | 430 | </Target>
|
|
0 commit comments