aspnetcore/testapps/ApplicationUsingPrecompiled.../ApplicationUsingPrecompiled...

32 lines
1.5 KiB
XML

<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFrameworks>netcoreapp2.0;net461</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
<RuntimeIdentifier Condition="!$(TargetFramework.StartsWith('netcoreapp'))">win7-x64</RuntimeIdentifier>
<ClassLibraryProjectPath>..\ClassLibraryWithPrecompiledViews\ClassLibraryWithPrecompiledViews.csproj</ClassLibraryProjectPath>
</PropertyGroup>
<Import Project="..\..\build\common-testapps.props" />
<ItemGroup>
<ProjectReference Include="$(ClassLibraryProjectPath)" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="$(AspNetCoreVersion)" />
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="$(AspNetCoreVersion)" />
<PackageReference Include="Microsoft.Extensions.Configuration.CommandLine" Version="$(AspNetCoreVersion)" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="$(AspNetCoreVersion)" />
</ItemGroup>
<Target Name="CopyPrecompiledViewAssets" BeforeTargets="Publish">
<MSBuild
Projects="$(ClassLibraryProjectPath)"
Targets="MvcRazorPrecompile"
Properties="TargetFramework=$(TargetFramework);Configuration=$(Configuration)" />
<ItemGroup>
<PrecompiledArtifacts Include="..\ClassLibraryWithPrecompiledViews\obj\precompiled\$(TargetFramework)\*.dll" />
</ItemGroup>
<Copy SourceFiles="@(PrecompiledArtifacts)" DestinationFolder="$(PublishDir)" />
</Target>
</Project>