On build, emit <clientproject>.blazor.config to the output dir - transitively into host projects too

This commit is contained in:
Steve Sanderson 2017-12-12 17:18:35 +00:00
parent c4fea86603
commit d0096ec78e
4 changed files with 24 additions and 1 deletions

View File

@ -4,6 +4,8 @@
<TargetFramework>netcoreapp2.0</TargetFramework>
</PropertyGroup>
<!-- In real apps, the following items would come from the Microsoft.Blazor package -->
<Import Project="..\..\src\Microsoft.Blazor.BuildTools\BlazorBuild.targets" />
<ItemGroup>
<ProjectReference Include="..\..\src\Microsoft.Blazor\Microsoft.Blazor.csproj" />
</ItemGroup>

View File

@ -4,4 +4,7 @@
<TargetFramework>netcoreapp2.0</TargetFramework>
</PropertyGroup>
<!-- In real apps, the following items would come from the Microsoft.Blazor package -->
<Import Project="..\..\src\Microsoft.Blazor.BuildTools\BlazorBuild.targets" />
</Project>

View File

@ -11,10 +11,15 @@
-->
<ItemGroup>
<ProjectReference Include="..\..\src\Microsoft.Blazor.DevHost\Microsoft.Blazor.DevHost.csproj" ReferenceOutputAssembly="false" />
<ProjectReference Include="..\..\src\Microsoft.Blazor\Microsoft.Blazor.csproj" />
</ItemGroup>
<PropertyGroup>
<RunArguments>run --project ..\..\src\Microsoft.Blazor.DevHost --no-build serve</RunArguments>
</PropertyGroup>
<!-- In real apps, the following items would come from the Microsoft.Blazor package -->
<Import Project="..\..\src\Microsoft.Blazor.BuildTools\BlazorBuild.targets" />
<ItemGroup>
<ProjectReference Include="..\..\src\Microsoft.Blazor\Microsoft.Blazor.csproj" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,13 @@
<Project>
<Target Name="GenerateBlazorMetadataFile" BeforeTargets="GetCopyToOutputDirectoryItems">
<PropertyGroup>
<BlazorMetadataFileName>$(AssemblyName).blazor.config</BlazorMetadataFileName>
<BlazorMetadataFilePath>$(TargetDir)$(BlazorMetadataFileName)</BlazorMetadataFilePath>
</PropertyGroup>
<WriteLinesToFile File="$(BlazorMetadataFilePath)" Lines="$(MSBuildProjectFullPath)" Overwrite="true" Encoding="Unicode"/>
<WriteLinesToFile File="$(BlazorMetadataFilePath)" Lines="$(OutDir)$(AssemblyName).dll" Overwrite="false" Encoding="Unicode"/>
<ItemGroup>
<ContentWithTargetPath Include="$(BlazorMetadataFilePath)" TargetPath="$(BlazorMetadataFileName)" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>
</Target>
</Project>