|
|
@@ -1,5 +1,10 @@
|
|
|
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
|
|
|
|
+ <PropertyGroup>
|
|
|
+ <_MvcTestingTasksAssembly Condition="$(_MvcTestingTasksAssembly) == ''">$(MSBuildThisFileDirectory)..\tasks\Microsoft.AspNetCore.Mvc.Testing.dll</_MvcTestingTasksAssembly>
|
|
|
+ </PropertyGroup>
|
|
|
+ <UsingTask TaskName="GenerateMvcTestManifestTask" AssemblyFile="$(_MvcTestingTasksAssembly)"/>
|
|
|
+
|
|
|
<!--
|
|
|
Work around https://github.com/NuGet/Home/issues/4412. MVC uses DependencyContext.Load() which looks next to a .dll
|
|
|
for a .deps.json. Information isn't available elsewhere. Need the .deps.json file for all web site applications.
|
|
|
@@ -23,30 +28,25 @@
|
|
|
</ItemGroup>
|
|
|
</Target>
|
|
|
|
|
|
- <Target Name="_AddContentRootForProjectReferences" BeforeTargets="GetAssemblyAttributes" DependsOnTargets="_ResolveMvcTestProjectReferences">
|
|
|
+ <Target Name="_AddContentRootForProjectReferences" BeforeTargets="PrepareResources" DependsOnTargets="_ResolveMvcTestProjectReferences">
|
|
|
<ItemGroup>
|
|
|
- <WebApplicationFactoryContentRootAttribute
|
|
|
- Condition="'%(_ContentRootProjectReferences.Identity)' != ''"
|
|
|
- Include="%(_ContentRootProjectReferences.Identity)"
|
|
|
- AssemblyName="%(_ContentRootProjectReferences.FusionName)"
|
|
|
- ContentRootPath="$([System.IO.Path]::GetDirectoryName(%(_ContentRootProjectReferences.MSBuildSourceProjectFile)))"
|
|
|
- ContentRootTest="$([System.IO.Path]::GetFileName(%(_ContentRootProjectReferences.MSBuildSourceProjectFile)))"
|
|
|
- Priority="0" />
|
|
|
+ <_ManifestProjects Include="%(_ContentRootProjectReferences.FusionName)">
|
|
|
+ <ContentRoot>$([System.IO.Path]::GetDirectoryName(%(_ContentRootProjectReferences.MSBuildSourceProjectFile)))</ContentRoot>
|
|
|
+ </_ManifestProjects>
|
|
|
</ItemGroup>
|
|
|
|
|
|
+ <GenerateMvcTestManifestTask ManifestPath="$(IntermediateOutputPath)MvcTestingAppManifest.json" Projects="@(_ManifestProjects)"/>
|
|
|
+
|
|
|
<ItemGroup>
|
|
|
- <AssemblyAttribute
|
|
|
- Condition=" '%(WebApplicationFactoryContentRootAttribute.Identity)' != '' "
|
|
|
- Include="Microsoft.AspNetCore.Mvc.Testing.WebApplicationFactoryContentRootAttribute">
|
|
|
- <_Parameter1>%(WebApplicationFactoryContentRootAttribute.AssemblyName)</_Parameter1>
|
|
|
- <_Parameter2>%(WebApplicationFactoryContentRootAttribute.ContentRootPath)</_Parameter2>
|
|
|
- <_Parameter3>%(WebApplicationFactoryContentRootAttribute.ContentRootTest)</_Parameter3>
|
|
|
- <_Parameter4>%(WebApplicationFactoryContentRootAttribute.Priority)</_Parameter4>
|
|
|
- </AssemblyAttribute>
|
|
|
+ <ContentWithTargetPath Include="$(IntermediateOutputPath)MvcTestingAppManifest.json"
|
|
|
+ TargetPath="MvcTestingAppManifest.json"
|
|
|
+ CopyToOutputDirectory="PreserveNewest"
|
|
|
+ CopyToPublishDirectory="Never"/>
|
|
|
+ <FileWrites Include="$(IntermediateOutputPath)MvcTestingAppManifest.json" />
|
|
|
</ItemGroup>
|
|
|
</Target>
|
|
|
|
|
|
- <Target Name="CopyAditionalFiles" AfterTargets="Build;_ResolveMvcTestProjectReferences" Condition="'$(TargetFramework)'!=''">
|
|
|
+ <Target Name="_MvcCopyDependencyFiles" AfterTargets="Build;_ResolveMvcTestProjectReferences" Condition="'$(TargetFramework)'!=''">
|
|
|
<ItemGroup>
|
|
|
<DepsFilePaths
|
|
|
Condition="'%(_ContentRootProjectReferences.Identity)' != ''"
|
|
|
@@ -56,4 +56,4 @@
|
|
|
<Copy SourceFiles="%(DepsFilePaths.FullPath)" DestinationFolder="$(OutDir)" Condition="Exists('%(DepsFilePaths.FullPath)')" />
|
|
|
</Target>
|
|
|
|
|
|
-</Project>
|
|
|
+</Project>
|