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