dotnet-installer/build/GitCommitInfo.targets

33 lines
1.2 KiB
Text
Raw Normal View History

2017-02-08 22:02:29 +00:00
<Project ToolsVersion="15.0">
<Target Name="WriteGitCommitInfoProps"
DependsOnTargets="BuildDotnetCliBuildFramework">
2017-02-10 20:13:44 +00:00
<GetCommitCount>
<Output TaskParameter="CommitCount" PropertyName="GitInfoCommitCount" />
</GetCommitCount>
<GetCommitHash>
2017-02-08 22:02:29 +00:00
<Output TaskParameter="CommitHash" PropertyName="GitInfoCommitHash" />
</GetCommitHash>
<PropertyGroup>
<ShouldOverWriteThePropsFile
Condition=" '$(CommitCount)' != '$(GitInfoCommitCount)' Or
2017-02-10 20:13:44 +00:00
'$(CommitHash)' != '$(GitInfoCommitHash)' ">true</ShouldOverWriteThePropsFile>
2017-02-08 22:02:29 +00:00
<GitCommitInfoPropsContent>
&lt;Project ToolsVersion=&quot;15.0&quot;&gt;
&lt;PropertyGroup&gt;
&lt;CommitCount&gt;$(GitInfoCommitCount)&lt;/CommitCount&gt;
2017-02-08 22:02:29 +00:00
&lt;CommitHash&gt;$(GitInfoCommitHash)&lt;/CommitHash&gt;
&lt;/PropertyGroup&gt;
&lt;/Project&gt;
</GitCommitInfoPropsContent>
</PropertyGroup>
<WriteLinesToFile File="$(GitCommitInfoProps)"
Lines="$(GitCommitInfoPropsContent)"
2017-02-09 18:50:21 +00:00
Condition=" '$(ShouldOverwriteThePropsFile)' == 'true' "
Overwrite="true" />
2017-02-08 22:02:29 +00:00
</Target>
</Project>