Allow host info passed in from the command line to override machine settings (#5904)
* Allow host info passed in from the command line to override machine settings * Simplify the logic * Address PR comments to keep a separate HostRid and HostOSName that are static * Rename to BuildInfo.props * Address PR comments * Fix the previous merge * Fix spacing * Address PR comments
This commit is contained in:
parent
22816d7958
commit
45a1e9e56c
13 changed files with 73 additions and 25 deletions
|
@ -22,10 +22,6 @@
|
|||
|
||||
<GitInfoCommitHash>%(GitInfoCommitHashLines.Identity)</GitInfoCommitHash>
|
||||
|
||||
<ShouldOverWriteThePropsFile
|
||||
Condition=" 'ForceStringComparison$(CommitCount)' != 'ForceStringComparison$(GitInfoCommitCount)' Or
|
||||
'$(CommitHash)' != '$(GitInfoCommitHash)' ">true</ShouldOverWriteThePropsFile>
|
||||
|
||||
<GitCommitInfoPropsContent>
|
||||
<Project ToolsVersion="15.0">
|
||||
<PropertyGroup>
|
||||
|
@ -34,12 +30,19 @@
|
|||
</PropertyGroup>
|
||||
</Project>
|
||||
</GitCommitInfoPropsContent>
|
||||
|
||||
<ExistingGitCommitInfoProps Condition=" Exists('$(GitCommitInfoProps)') ">
|
||||
$([System.IO.File]::ReadAllText($(GitCommitInfoProps)))
|
||||
</ExistingGitCommitInfoProps>
|
||||
|
||||
<ShouldOverwriteGitCommitInfoPropsFile>false</ShouldOverwriteGitCommitInfoPropsFile>
|
||||
<ShouldOverwriteGitCommitInfoPropsFile
|
||||
Condition=" '$(ExistingGitCommitInfoProps.Trim())' != '$(GitCommitInfoPropsContent.Trim())' ">true</ShouldOverwriteGitCommitInfoPropsFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<WriteLinesToFile File="$(GitCommitInfoProps)"
|
||||
Lines="$(GitCommitInfoPropsContent)"
|
||||
Condition=" '$(ShouldOverwriteThePropsFile)' == 'true' "
|
||||
Condition=" '$(ShouldOverwriteGitCommitInfoPropsFile)' == 'true' "
|
||||
Overwrite="true" />
|
||||
|
||||
</Target>
|
||||
</Project>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue