Moving the GitCommitHash code to a target to be shared amongst a couple of other targets.
This commit is contained in:
parent
ca6e86d472
commit
befcc966a5
3 changed files with 10 additions and 8 deletions
|
@ -2,7 +2,7 @@
|
|||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Target Name="FinalizeBuild"
|
||||
BeforeTargets="AfterBuild"
|
||||
DependsOnTargets="GenerateFullNuGetVersion">
|
||||
DependsOnTargets="GenerateFullNuGetVersion;GetCommitHash">
|
||||
<CopyBlobsToLatest FeedUrl="$(DotnetPublishSdkAssetsBlobFeedUrl)"
|
||||
AccountKey="$(DotNetPublishSdkAssetsBlobFeedKey)"
|
||||
NugetVersion="$(FullNugetVersion)"
|
||||
|
|
|
@ -414,13 +414,7 @@
|
|||
ReplacementStrings="$(ReplacementString)" />
|
||||
</Target>
|
||||
|
||||
<Target Name="GenerateVersionFile" DependsOnTargets="SetupBundledComponents">
|
||||
<Exec Command="git rev-parse HEAD"
|
||||
ConsoleToMSBuild="true"
|
||||
Condition=" '$(GitCommitHash)' == '' ">
|
||||
<Output TaskParameter="ConsoleOutput" PropertyName="GitCommitHash" />
|
||||
</Exec>
|
||||
|
||||
<Target Name="GenerateVersionFile" DependsOnTargets="SetupBundledComponents;GetCommitHash">
|
||||
<WriteLinesToFile File="$(SdkOutputDirectory).version"
|
||||
Lines="$(GitCommitHash);$(Version);$(Rid)"
|
||||
Overwrite="true" />
|
||||
|
|
|
@ -5,4 +5,12 @@
|
|||
<FullNugetVersion Condition=" '$(VersionSuffixDateStamp)' != '' And '$(VersionSuffixBuildOfTheDay)' != '' ">$(FullNugetVersion).$(VersionSuffixDateStamp).$(VersionSuffixBuildOfTheDay)</FullNugetVersion>
|
||||
</PropertyGroup>
|
||||
</Target>
|
||||
|
||||
<Target Name="GetCommitHash">
|
||||
<Exec Command="git rev-parse HEAD"
|
||||
ConsoleToMSBuild="true"
|
||||
Condition=" '$(GitCommitHash)' == '' ">
|
||||
<Output TaskParameter="ConsoleOutput" PropertyName="GitCommitHash" />
|
||||
</Exec>
|
||||
</Target>
|
||||
</Project>
|
||||
|
|
Loading…
Add table
Reference in a new issue