Ensure Microsoft.AspNetCore.Blazor.Build is packed in a post-publish form so it's cross-plat compatible

This commit is contained in:
Steve Sanderson 2018-02-27 20:22:19 +00:00
parent ccd4de4d8c
commit 9a17a343cc
3 changed files with 19 additions and 8 deletions

View File

@ -1,5 +1,4 @@
Invoke-WebRequest -useb 'https://dot.net/v1/dotnet-install.ps1' -OutFile .\build\dotnet-install.ps1
.\build\dotnet-install.ps1 -channel Current -version 2.1.3 -InstallDir dotnetsdk
Get-Command dotnet | Format-List source
dotnet --version
dotnet pack Blazor.sln --configuration Release

View File

@ -1,18 +1,30 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<TargetFrameworks>netcoreapp2.0</TargetFrameworks>
<OutputType>Exe</OutputType>
<OutDir>tools</OutDir>
<OutDir>tools</OutDir> <!-- So we can use the tool from source within the repo without having to pack -->
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup>
<Target Name="SetPackageProperties" BeforeTargets="_IntermediatePack">
<!-- Pack settings -->
<PropertyGroup>
<NoPackageAnalysis>true</NoPackageAnalysis>
<NuspecFile>Microsoft.AspNetCore.Blazor.Build.nuspec</NuspecFile>
<IntermediatePackDir>$(MSBuildProjectDirectory)/bin/$(Configuration)/publish/</IntermediatePackDir>
<PublishDir>$(IntermediatePackDir)$(TargetFramework)/</PublishDir>
</PropertyGroup>
<!-- Executes /t:Publish for all target frameworks before packing-->
<Target Name="PublishAll" BeforeTargets="_IntermediatePack">
<PropertyGroup>
<NoPackageAnalysis>true</NoPackageAnalysis>
<NuspecFile>Microsoft.AspNetCore.Blazor.Build.nuspec</NuspecFile>
<NuspecProperties>version=$(PackageVersion)</NuspecProperties>
<CopyLocalLockFileAssemblies>false</CopyLocalLockFileAssemblies>
<NuspecProperties>version=$(PackageVersion);publishDir=$([MSBuild]::NormalizeDirectory($(IntermediatePackDir)))</NuspecProperties>
</PropertyGroup>
<ItemGroup>
<_TargetFramework Include="$(TargetFrameworks)" />
</ItemGroup>
<MSBuild Projects="$(MSBuildProjectFullPath)" Targets="Publish" Properties="TargetFramework=%(_TargetFramework.Identity)" />
</Target>
<ItemGroup>

View File

@ -10,6 +10,6 @@
<file src="_._" target="lib/netstandard1.0/" />
<file src="build\**" target="build" />
<file src="targets\**" target="targets" />
<file src="tools\**" target="tools" />
<file src="$publishdir$\netcoreapp2.0\**\*" target="tools/" />
</files>
</package>