42 lines
1.9 KiB
Text
42 lines
1.9 KiB
Text
|
<Project ToolsVersion="15.0">
|
||
|
<Target Name="WriteGitCommitInfoProps"
|
||
|
DependsOnTargets="BuildDotnetCliBuildFramework">
|
||
|
<GetCommitHash RepoRoot="$(RepoRoot)">
|
||
|
<Output TaskParameter="CommitHash" PropertyName="GitInfoCommitHash" />
|
||
|
</GetCommitHash>
|
||
|
|
||
|
<GenerateBuildVersionInfo RepoRoot="$(RepoRoot)"
|
||
|
VersionMajor="$(VersionMajor)"
|
||
|
VersionMinor="$(VersionMinor)"
|
||
|
VersionPatch="$(VersionPatch)"
|
||
|
ReleaseSuffix="$(ReleaseSuffix)">
|
||
|
<Output TaskParameter="CommitCount" PropertyName="GitInfoCommitCount" />
|
||
|
<Output TaskParameter="MsiVersion" PropertyName="BuildInfoMsiVersion" />
|
||
|
<Output TaskParameter="VersionBadgeMoniker" PropertyName="BuildInfoVersionBadgeMoniker" />
|
||
|
</GenerateBuildVersionInfo>
|
||
|
|
||
|
<PropertyGroup>
|
||
|
<ShouldOverWriteThePropsFile
|
||
|
Condition=" '$(CommitHash)' != '$(GitInfoCommitHash)' Or
|
||
|
'$(CommitCount)' != '$(GitInfoCommitCount)' Or
|
||
|
'$(MsiVersion)' != '$(BuildInfoMsiVersion)' Or
|
||
|
'$(VersionBadgeMoniker)' != '$(BuildInfoVersionBadgeMoniker)' ">true</ShouldOverWriteThePropsFile>
|
||
|
|
||
|
<GitCommitInfoPropsContent>
|
||
|
<Project ToolsVersion="15.0">
|
||
|
<PropertyGroup>
|
||
|
<CommitHash>$(GitInfoCommitHash)</CommitHash>
|
||
|
<CommitCount>$(GitInfoCommitCount)</CommitCount>
|
||
|
<MsiVersion>$(BuildInfoMsiVersion)</MsiVersion>
|
||
|
<VersionBadgeMoniker>$(BuildInfoVersionBadgeMoniker)</VersionBadgeMoniker>
|
||
|
</PropertyGroup>
|
||
|
</Project>
|
||
|
</GitCommitInfoPropsContent>
|
||
|
</PropertyGroup>
|
||
|
|
||
|
<WriteLinesToFile File="$(GitCommitInfoProps)"
|
||
|
Lines="$(GitCommitInfoPropsContent)"
|
||
|
Condition=" '$(ShouldOverwriteThePropsFile)' == 'true' "/>
|
||
|
</Target>
|
||
|
</Project>
|