aspnetcore/src/Microsoft.AspNetCore.All/build/PublishWithAspNetCoreTarget...

45 lines
2.7 KiB
XML

<Project>
<PropertyGroup>
<PublishWithAspNetCoreTargetManifest Condition="'$(PublishWithAspNetCoreTargetManifest)'==''">true</PublishWithAspNetCoreTargetManifest>
<ManifestRuntimeIdentifier Condition="'$(PublishWithAspNetCoreTargetManifest)'=='true' and '$(PublishableProject)'=='true'" >$(AspNetCoreTargetManifestRuntimeIdentifier)</ManifestRuntimeIdentifier>
</PropertyGroup>
<PropertyGroup Condition="'$(PublishWithAspNetCoreTargetManifest)'=='true' and '$(PublishableProject)'=='true' and '$(ManifestRuntimeIdentifier)'==''">
<ManifestRuntimeIdentifier
Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Windows)))'
and '$([System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture)'=='X64'">win7-x64</ManifestRuntimeIdentifier>
<ManifestRuntimeIdentifier
Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Windows)))'
and '$([System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture)'=='X86'">win7-x86</ManifestRuntimeIdentifier>
<ManifestRuntimeIdentifier
Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::OSX)))'">osx.10.12-x64</ManifestRuntimeIdentifier>
<ManifestRuntimeIdentifier
Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Linux)))'">linux-x64</ManifestRuntimeIdentifier>
</PropertyGroup>
<PropertyGroup Condition="'$(PublishWithAspNetCoreTargetManifest)'=='true' and '$(PublishableProject)'=='true'">
<TargetManifestFiles>$(TargetManifestFiles);$(MSBuildThisFileDirectory)manifest.$(ManifestRuntimeIdentifier).xml</TargetManifestFiles>
</PropertyGroup>
<!--
*******************************************************
Target: PublishWithAspNetCoreTargetManifest
Error if manifest runtime identifier cannot be resolved
*******************************************************
-->
<Target
Name="PublishWithAspNetCoreTargetManifest"
BeforeTargets="Publish"
DependsOnTargets="PrepareForPublish"
Condition="'$(PublishWithAspNetCoreTargetManifest)'=='true' and '$(PublishableProject)'=='true'" >
<Error
Text="Could not resolve manifest runtime identifier. Please specify the the runtime identifier via the AspNetCoreTargetManifestRuntimeIdentifier property."
Condition="'$(ManifestRuntimeIdentifier)'==''" />
<Message
Text="Appending default ASP.NET Core runtime package store manifest for use during publish based for the runtime $(ManifestRuntimeIdentifier)."
Importance="low" />
</Target>
</Project>