40 lines
1.6 KiB
Text
40 lines
1.6 KiB
Text
|
<Project ToolsVersion="15.0">
|
||
|
<Target Name="WriteBuildInfoProps"
|
||
|
DependsOnTargets="BuildDotnetCliBuildFramework">
|
||
|
|
||
|
<GetCurrentRuntimeInformation>
|
||
|
<Output TaskParameter="Rid" PropertyName="HostRid" />
|
||
|
<Output TaskParameter="OSName" PropertyName="HostOSName" />
|
||
|
</GetCurrentRuntimeInformation>
|
||
|
|
||
|
<PropertyGroup>
|
||
|
<Rid Condition=" '$(Rid)' == '' ">$(HostRid)</Rid>
|
||
|
<Architecture Condition=" '$(Architecture)' == '' ">x64</Architecture>
|
||
|
<OSName Condition=" '$(OSName)' == '' ">$(HostOSName)</OSName>
|
||
|
|
||
|
<BuildInfoPropsContent>
|
||
|
<Project ToolsVersion="15.0">
|
||
|
<PropertyGroup>
|
||
|
<Rid>$(Rid)</Rid>
|
||
|
<Architecture>$(Architecture)</Architecture>
|
||
|
<OSName>$(OSName)</OSName>
|
||
|
</PropertyGroup>
|
||
|
</Project>
|
||
|
</BuildInfoPropsContent>
|
||
|
|
||
|
<ExistingBuildInfoPropsContent Condition=" Exists('$(BuildInfoProps)') ">
|
||
|
$([System.IO.File]::ReadAllText($(BuildInfoProps)))
|
||
|
</ExistingBuildInfoPropsContent>
|
||
|
|
||
|
<ShouldOverwriteBuildInfoPropsFile>false</ShouldOverwriteBuildInfoPropsFile>
|
||
|
<ShouldOverwriteBuildInfoPropsFile
|
||
|
Condition=" '$(ExistingBuildInfoPropsContent.Trim())' != '$(BuildInfoPropsContent.Trim())' ">true</ShouldOverwriteBuildInfoPropsFile>
|
||
|
</PropertyGroup>
|
||
|
|
||
|
<WriteLinesToFile File="$(BuildInfoProps)"
|
||
|
Lines="$(BuildInfoPropsContent)"
|
||
|
Condition=" '$(ShouldOverwriteBuildInfoPropsFile)' == 'true' "
|
||
|
Overwrite="true" />
|
||
|
</Target>
|
||
|
</Project>
|