From 694b88d65792e4d8c4cfc1f9bea1f40b0429e487 Mon Sep 17 00:00:00 2001 From: John Luo <jt.luo@mail.utoronto.ca> Date: Mon, 5 Jun 2017 17:11:49 -0700 Subject: [PATCH 1/2] Use file globbing to resolve manifests --- .../Microsoft.AspNetCore.All.csproj | 9 --------- .../PublishWithAspNetCoreTargetManifest.targets | 12 ++++++++---- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/src/Microsoft.AspNetCore.All/Microsoft.AspNetCore.All.csproj b/src/Microsoft.AspNetCore.All/Microsoft.AspNetCore.All.csproj index 71fb230..a6e4707 100644 --- a/src/Microsoft.AspNetCore.All/Microsoft.AspNetCore.All.csproj +++ b/src/Microsoft.AspNetCore.All/Microsoft.AspNetCore.All.csproj @@ -22,13 +22,4 @@ <Content Include="build\**\*.targets" PackagePath="%(Identity)" /> </ItemGroup> - <Target Name="UpdateManifestVersionNumbers" BeforeTargets="GenerateNuspec"> - <PropertyGroup> - <ManifestTargetsFile>$(MSBuildThisFileDirectory)build\PublishWithAspNetCoreTargetManifest.targets</ManifestTargetsFile> - </PropertyGroup> - - <Exec Command="powershell.exe -command "(Get-Content $(ManifestTargetsFile)).replace('__MANIFEST_VERSION__','$(VersionPrefix)-$(VersionSuffix)') | Set-Content $(ManifestTargetsFile)"" Condition="'$(OS)' == 'Windows_NT'"/> - <Exec Command="sed -i -e "s/__MANIFEST_VERSION__/$(VersionPrefix)-$(VersionSuffix)/g" $(ManifestTargetsFile)" Condition="'$(OS)' != 'Windows_NT'"/> - </Target> - </Project> diff --git a/src/Microsoft.AspNetCore.All/build/PublishWithAspNetCoreTargetManifest.targets b/src/Microsoft.AspNetCore.All/build/PublishWithAspNetCoreTargetManifest.targets index b729b98..ceb7c7c 100644 --- a/src/Microsoft.AspNetCore.All/build/PublishWithAspNetCoreTargetManifest.targets +++ b/src/Microsoft.AspNetCore.All/build/PublishWithAspNetCoreTargetManifest.targets @@ -3,10 +3,6 @@ <PublishWithAspNetCoreTargetManifest Condition="'$(PublishWithAspNetCoreTargetManifest)'=='' and '$(RuntimeIdentifier)'=='' and '$(RuntimeIdentifiers)'=='' and '$(PublishableProject)'=='true'">true</PublishWithAspNetCoreTargetManifest> </PropertyGroup> - <PropertyGroup Condition="'$(PublishWithAspNetCoreTargetManifest)'=='true'"> - <TargetManifestFiles>$(TargetManifestFiles);$(MSBuildThisFileDirectory)aspnetcore-store-__MANIFEST_VERSION__-win7-x64.xml;$(MSBuildThisFileDirectory)aspnetcore-store-__MANIFEST_VERSION__-win7-x86.xml;$(MSBuildThisFileDirectory)aspnetcore-store-__MANIFEST_VERSION__-osx-x64.xml;$(MSBuildThisFileDirectory)aspnetcore-store-__MANIFEST_VERSION__-linux-x64.xml</TargetManifestFiles> - </PropertyGroup> - <!-- ****************************************************************************** Target: PublishWithAspNetCoreTargetManifest @@ -22,5 +18,13 @@ Error if PublishWithAspNetCoreTargetManifest is set to true for standalone app <Error Text="PublishWithAspNetCoreTargetManifest cannot be set to true for standalone apps." Condition="'$(RuntimeIdentifier)'!='' or '$(RuntimeIdentifiers)'!=''" /> + + <ItemGroup> + <AspNetCoreTargetManifestFiles Include="$(MSBuildThisFileDirectory)aspnetcore-store-*.xml"/> + </ItemGroup> + + <PropertyGroup> + <TargetManifestFiles>$(TargetManifestFiles);@(AspNetCoreTargetManifestFiles)</TargetManifestFiles> + </PropertyGroup> </Target> </Project> From 87b716b8e836b93d6a210be73b575a3387cc7746 Mon Sep 17 00:00:00 2001 From: John Luo <jt.luo@mail.utoronto.ca> Date: Tue, 6 Jun 2017 11:13:23 -0700 Subject: [PATCH 2/2] Update target ordering --- .../build/PublishWithAspNetCoreTargetManifest.targets | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Microsoft.AspNetCore.All/build/PublishWithAspNetCoreTargetManifest.targets b/src/Microsoft.AspNetCore.All/build/PublishWithAspNetCoreTargetManifest.targets index ceb7c7c..f49dc6a 100644 --- a/src/Microsoft.AspNetCore.All/build/PublishWithAspNetCoreTargetManifest.targets +++ b/src/Microsoft.AspNetCore.All/build/PublishWithAspNetCoreTargetManifest.targets @@ -11,8 +11,7 @@ Error if PublishWithAspNetCoreTargetManifest is set to true for standalone app --> <Target Name="PublishWithAspNetCoreTargetManifest" - BeforeTargets="Publish" - DependsOnTargets="PrepareForPublish" + AfterTargets="PrepareForPublish" Condition="'$(PublishWithAspNetCoreTargetManifest)'=='true'" > <Error