dotnet-installer/build/BuildInfo.targets

42 lines
1.8 KiB
XML

<Project ToolsVersion="15.0">
<Target Name="WriteBuildInfoProps"
DependsOnTargets="BuildDotnetCliBuildFramework">
<GetCurrentRuntimeInformation>
<Output TaskParameter="Rid" PropertyName="HostRid" />
<Output TaskParameter="OSName" PropertyName="HostOSName" />
<Output TaskParameter="OSPlatform" PropertyName="HostOSPlatform" />
</GetCurrentRuntimeInformation>
<PropertyGroup>
<Rid Condition=" '$(Rid)' == '' ">$(HostRid)</Rid>
<Architecture Condition=" '$(Architecture)' == '' ">x64</Architecture>
<OSName Condition=" '$(OSName)' == '' ">$(HostOSName)</OSName>
<OSPlatform Condition=" '$(OSPlatform)' == '' ">$(HostOSPlatform)</OSPlatform>
<BuildInfoPropsContent>
&lt;Project ToolsVersion=&quot;15.0&quot;&gt;
&lt;PropertyGroup&gt;
&lt;Rid&gt;$(Rid)&lt;/Rid&gt;
&lt;Architecture&gt;$(Architecture)&lt;/Architecture&gt;
&lt;OSName&gt;$(OSName)&lt;/OSName&gt;
&lt;OSPlatform&gt;$(OSPlatform)&lt;/OSPlatform&gt;
&lt;/PropertyGroup&gt;
&lt;/Project&gt;
</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>