|
1 |
| -<Project Sdk="Microsoft.NET.Sdk"> |
| 1 | +<Project Sdk="Microsoft.NET.Sdk"> |
2 | 2 |
|
3 | 3 | <PropertyGroup>
|
4 |
| - <TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework> |
| 4 | + <TargetFramework>netstandard2.0</TargetFramework> |
| 5 | + <TargetName>Microsoft.AspNetCore.Blazor.Build.Tasks</TargetName> |
| 6 | + <AssemblyName>Microsoft.AspNetCore.Blazor.Build</AssemblyName> |
5 | 7 | <Description>Build mechanism for ASP.NET Core Blazor applications.</Description>
|
6 |
| - <OutputType>Exe</OutputType> |
7 | 8 | <IsShippingPackage>true</IsShippingPackage>
|
8 | 9 | <HasReferenceAssembly>false</HasReferenceAssembly>
|
| 10 | + <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies> |
9 | 11 | </PropertyGroup>
|
10 | 12 |
|
11 | 13 | <!-- Pack settings -->
|
12 | 14 | <PropertyGroup>
|
13 | 15 | <!-- Producing this package requires building with NodeJS enabled. -->
|
14 | 16 | <IsPackable Condition="'$(BuildNodeJS)' == 'false'">false</IsPackable>
|
15 |
| - <GenerateNuspecDependsOn>$(GenerateNuspecDependsOn);Publish</GenerateNuspecDependsOn> |
16 | 17 | <NoPackageAnalysis>true</NoPackageAnalysis>
|
17 | 18 | <NuspecFile>Microsoft.AspNetCore.Blazor.Build.nuspec</NuspecFile>
|
18 | 19 | </PropertyGroup>
|
19 | 20 |
|
20 | 21 | <ItemGroup>
|
21 | 22 | <NuspecProperty Include="configuration=$(Configuration)" />
|
22 |
| - <NuspecProperty Include="publishDir=$(PublishDir)" /> |
| 23 | + <NuspecProperty Include="taskskDir=$(OutputPath)tools" /> |
23 | 24 | <NuspecProperty Include="componentsversion=$(ComponentsPackageVersion)" />
|
24 | 25 | <NuspecProperty Include="razorversion=$(MicrosoftAspNetCoreRazorDesignPackageVersion)" />
|
25 | 26 | <NuspecProperty Include="blazormonoversion=$(MicrosoftAspNetCoreBlazorMonoPackageVersion)" />
|
26 | 27 | </ItemGroup>
|
27 | 28 |
|
28 | 29 | <ItemGroup>
|
29 | 30 | <ProjectReference Condition="'$(BuildNodeJS)' != 'false' and '$(BuildingInsideVisualStudio)' != 'true'" Include="$(RepoRoot)src\Components\Web.JS\Microsoft.AspNetCore.Components.Web.JS.npmproj" ReferenceOutputAssembly="false" />
|
30 |
| - <Reference Include="Microsoft.Extensions.CommandLineUtils.Sources" /> |
| 31 | + <Reference Include="Microsoft.Build.Framework" PrivateAssets="All" /> |
| 32 | + <Reference Include="Microsoft.Build.Utilities.Core" PrivateAssets="All" /> |
31 | 33 | <Reference Include="System.Reflection.Metadata" />
|
32 | 34 | </ItemGroup>
|
33 | 35 |
|
34 |
| - <ItemGroup> |
35 |
| - <Compile Include="..\..\..\Shared\src\JsonSerializerOptionsProvider.cs" /> |
36 |
| - </ItemGroup> |
| 36 | + <Target Name="CopyBuildTask" BeforeTargets="Build" AfterTargets="PrepareForRun"> |
| 37 | + <!-- |
| 38 | + The task produced by this project is referenced within this solution. When building, Visual Studio will lock up the assembly. |
| 39 | + Any attempts to overwrite the binary with a newer version will fail. This is particularly grating if a developer "Rebuilds" the project |
| 40 | + after an initial build since that would always attempt to overwrite the tasks dll |
| 41 | +
|
| 42 | + This target attempts to make this solution more usable at the cost of a more onerous inner-loop build of the Blazor.Build tasks. |
| 43 | + We'll copy the tasks to a location other that than the build output and use that in the Blazor.Build.targets. In the most common |
| 44 | + case where these tasks aren't being worked on, everything should work great. However, if you're attemping to modify these tasks, |
| 45 | + you will need to manaully stop MSBuild.exe processes |
| 46 | + --> |
| 47 | + |
| 48 | + <ItemGroup> |
| 49 | + <_FilesToCopy Include="$(OutputPath)*.*" /> |
| 50 | + </ItemGroup> |
| 51 | + |
| 52 | + <Copy SourceFiles="@(_FilesToCopy)" DestinationFolder="$(OutputPath)tools" SkipUnchangedFiles="true" Retries="1" ContinueOnError="true"> |
| 53 | + <Output TaskParameter="CopiedFiles" ItemName="FileWrites" /> |
| 54 | + </Copy> |
| 55 | + </Target> |
| 56 | + |
37 | 57 | </Project>
|
0 commit comments