Blame SOURCES/core-setup-4510-commit-id.patch

bb9e87
From e02ee86364b9db3edc298a6a081004aa07473d09 Mon Sep 17 00:00:00 2001
bb9e87
From: Omair Majid <omajid@redhat.com>
bb9e87
Date: Wed, 29 Aug 2018 17:03:25 -0400
bb9e87
Subject: [PATCH] Allow setting the commit id using /p:LatestCommit
bb9e87
bb9e87
This is similar to how CommitCount is already supported.
bb9e87
bb9e87
This lets consumers who are building outside a git repo, such as
bb9e87
source-build, set a commit id which is displayed by `dotnet --info`
bb9e87
and `strings dotnet | grep '@(#)'`.
bb9e87
bb9e87
See: https://github.com/dotnet/source-build/issues/651
bb9e87
See: https://github.com/dotnet/cli/pull/5945
bb9e87
---
bb9e87
 dir.targets | 9 +++++----
bb9e87
 1 file changed, 5 insertions(+), 4 deletions(-)
bb9e87
bb9e87
diff --git a/dir.targets b/dir.targets
bb9e87
index 8d34872c6..59dc1ebde 100644
bb9e87
--- a/dir.targets
bb9e87
+++ b/dir.targets
bb9e87
@@ -17,7 +17,8 @@
bb9e87
     <Exec Command="$(DotnetToolCommand) build $(MSBuildThisFileDirectory)tools-local/tasks/core-setup.tasks.csproj" />
bb9e87
   </Target>
bb9e87
 
bb9e87
-  <Target Name="GetLatestCommitHash">
bb9e87
+  
bb9e87
+          Condition="'$(LatestCommit)' == ''">
bb9e87
     
bb9e87
     <Exec Command="git rev-parse HEAD 2>&1" StandardOutputImportance="Low" IgnoreExitCode="true" IgnoreStandardErrorWarningFormat="true" ConsoleToMSBuild="true">
bb9e87
       <Output TaskParameter="ConsoleOutput" PropertyName="LatestCommit" />
bb9e87
@@ -29,13 +30,13 @@
bb9e87
     </PropertyGroup>
bb9e87
   </Target>
bb9e87
 
bb9e87
-  <Target Name="GetCommitCount">
bb9e87
+  
bb9e87
+          Condition="'$(CommitCount)' == ''">
bb9e87
     
bb9e87
           StandardOutputImportance="Low"
bb9e87
           IgnoreExitCode="true"
bb9e87
           IgnoreStandardErrorWarningFormat="true"
bb9e87
-          ConsoleToMSBuild="true"
bb9e87
-          Condition="'$(CommitCount)' == ''">
bb9e87
+          ConsoleToMSBuild="true">
bb9e87
      <Output TaskParameter="ConsoleOutput" PropertyName="CommitCount" />
bb9e87
      <Output TaskParameter="ExitCode" PropertyName="CommitCountExitCode" />
bb9e87
     </Exec>