Add target to set default target manifest
This commit is contained in:
parent
ce365799a6
commit
87c513b0d8
|
|
@ -146,4 +146,9 @@
|
||||||
<PackageReference Include="Microsoft.Extensions.Logging.AzureAppServices" Version="$(AspNetCoreVersion)" PrivateAssets="None" Condition="'$(BUILD_PACKAGE_CACHE)' == 'true'" />
|
<PackageReference Include="Microsoft.Extensions.Logging.AzureAppServices" Version="$(AspNetCoreVersion)" PrivateAssets="None" Condition="'$(BUILD_PACKAGE_CACHE)' == 'true'" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
<ItemGroup>
|
||||||
|
<Content Include="build\**\*.xml" Package="true" />
|
||||||
|
<Content Include="build\**\*.targets" Package="true" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,48 @@
|
||||||
|
<Project>
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<PublishWithAspNetCoreTargetManifest Condition="'$(PublishWithAspNetCoreTargetManifest)'==''">true</PublishWithAspNetCoreTargetManifest>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
*****************************************************************************
|
||||||
|
Target: PublishWithAspNetCoreTargetManifest
|
||||||
|
Append the default ASP.NET Core runtime package store manifest during publish
|
||||||
|
*****************************************************************************
|
||||||
|
-->
|
||||||
|
<Target
|
||||||
|
Name="PublishWithAspNetCoreTargetManifest"
|
||||||
|
BeforeTargets="Publish"
|
||||||
|
DependsOnTargets="PrepareForPublish"
|
||||||
|
Condition="'$(PublishWithAspNetCoreTargetManifest)'=='true' and '$(PublishableProject)'=='true'" >
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<ManifestRuntimeIdentifier>$(AspNetCoreTargetManifestRuntimeIdentifier)</ManifestRuntimeIdentifier>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<PropertyGroup Condition="'$(AspNetCoreTargetManifestRuntimeIdentifier)'==''">
|
||||||
|
<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>
|
||||||
|
|
||||||
|
<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" />
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetManifest>$(TargetManifest);$(MSBuildThisFileDirectory)manifest.$(ManifestRuntimeIdentifier).xml</TargetManifest>
|
||||||
|
</PropertyGroup>
|
||||||
|
</Target>
|
||||||
|
</Project>
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
<Project>
|
||||||
|
<Import Project="$(MSBuildThisFileDirectory)..\PublishWithAspNetCoreTargetManifest.targets" />
|
||||||
|
</Project>
|
||||||
Loading…
Reference in New Issue