aspnetcore/build/testsite.props

88 lines
4.7 KiB
XML

<Project>
<PropertyGroup>
<RuntimeIdentifiers>win7-x64;win7-x86</RuntimeIdentifiers>
<Platforms>x64;x86</Platforms>
<IISExpressAppHostConfig>$(MSBuildThisFileDirectory)applicationhost.config</IISExpressAppHostConfig>
<IISAppHostConfig>$(MSBuildThisFileDirectory)applicationhost.iis.config</IISAppHostConfig>
<NativePlatform Condition="'$(Platform)' == 'AnyCPU'">x64</NativePlatform>
<NativePlatform Condition="'$(NativePlatform)' == ''">$(Platform)</NativePlatform>
</PropertyGroup>
<PropertyGroup Condition="'$(NativePlatform)' == 'x86'">
<IISExpressPath>$(MSBuildProgramFiles32)\IIS Express\iisexpress.exe</IISExpressPath>
<IISPath>$(SystemRoot)\SysWOW64\inetsrv\w3wp.exe</IISPath>
<NativeFolder>Win32</NativeFolder>
</PropertyGroup>
<PropertyGroup Condition="'$(NativePlatform)' == 'x64'">
<IISExpressPath>$(ProgramW6432)\IIS Express\iisexpress.exe</IISExpressPath>
<IISPath>$(SystemRoot)\System32\inetsrv\w3wp.exe</IISPath>
<NativeFolder>x64</NativeFolder>
</PropertyGroup>
<PropertyGroup>
<!-- For standalone publish, all dlls are flattened to the same folder.
Set the base path to the request handler
-->
<BasePathForRequestHandler Condition="'$(RuntimeIdentifier)' == ''">$(NativePlatform)\</BasePathForRequestHandler>
</PropertyGroup>
<ItemGroup Condition="'$(OS)' == 'Windows_NT'">
<None Include="$(MSBuildThisFileDirectory)..\src\AspNetCoreModuleV2\RequestHandler\bin\$(Configuration)\$(NativeFolder)\aspnetcorerh.dll" CopyToOutputDirectory="PreserveNewest" Visible="true" Link="$(BasePathForRequestHandler)%(FileName)%(Extension)" />
<None Include="$(MSBuildThisFileDirectory)..\src\AspNetCoreModuleV2\RequestHandler\bin\$(Configuration)\$(NativeFolder)\aspnetcorerh.pdb" CopyToOutputDirectory="PreserveNewest" Visible="true" Link="$(BasePathForRequestHandler)%(FileName)%(Extension)" />
<None Include="$(MSBuildThisFileDirectory)..\src\AspNetCoreModuleV2\AspNetCore\bin\$(Configuration)\$(NativeFolder)\aspnetcoreV2.dll" CopyToOutputDirectory="PreserveNewest" Visible="true" Link="$(NativePlatform)\%(FileName)%(Extension)" />
<None Include="$(MSBuildThisFileDirectory)..\src\AspNetCoreModuleV2\AspNetCore\bin\$(Configuration)\$(NativeFolder)\aspnetcoreV2.pdb" CopyToOutputDirectory="PreserveNewest" Visible="true" Link="$(NativePlatform)\%(FileName)%(Extension)" />
</ItemGroup>
<PropertyGroup>
<IISExpressArguments>/config:"$(IISExpressAppHostConfig)"</IISExpressArguments>
<IISArguments>-h "$(IISAppHostConfig)"</IISArguments>
<AncmPath>$(NativePlatform)\aspnetcoreV2.dll</AncmPath>
<AncmRHPath>$(NativePlatform)\aspnetcorerh.dll</AncmRHPath>
<DotNetPath>$(userprofile)\.dotnet\$(NativePlatform)\dotnet.exe</DotNetPath>
</PropertyGroup>
<Target Name="CopyLaunchSettings" AfterTargets="CoreBuild">
<!-- This would always override launch settings files in test projects by the default one -->
<Copy SourceFiles="$(MSBuildThisFileDirectory)launchSettings.json" DestinationFolder="$(MSBuildProjectDirectory)\Properties" />
</Target>
<!-- Deps file injection-->
<ItemGroup>
<ProjectReference Include="$(MSBuildThisFileDirectory)..\test\TestTasks\TestTasks.csproj">
<ReferenceOutputAssembly>False</ReferenceOutputAssembly>
</ProjectReference>
</ItemGroup>
<Target Name="PrepareInjectionApp">
<PropertyGroup>
<InjectDepsAssembly>$(MSBuildThisFileDirectory)..\test\TestTasks\bin\$(Configuration)\$(TargetFramework)\TestTasks</InjectDepsAssembly>
<InjectDepsApp Condition="'$(TargetFramework)' == 'net461'">$(InjectDepsAssembly)</InjectDepsApp>
<InjectDepsArguments>"win7-$(NativePlatform)" "$(AncmRHPath)"</InjectDepsArguments>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'net461'">
<InjectDepsAssembly>$(InjectDepsAssembly).exe</InjectDepsAssembly>
<InjectDepsApp>$(InjectDepsAssembly)</InjectDepsApp>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' != 'net461'">
<InjectDepsAssembly>$(InjectDepsAssembly).dll</InjectDepsAssembly>
<InjectDepsApp>dotnet</InjectDepsApp>
<InjectDepsArguments>$(InjectDepsAssembly) $(InjectDepsArguments)</InjectDepsArguments>
</PropertyGroup>
</Target>
<Target Name="InjectRequestHandler" AfterTargets="GenerateBuildDependencyFile" DependsOnTargets="PrepareInjectionApp">
<Exec Command="$(InjectDepsApp) $(InjectDepsArguments) &quot;$(ProjectDepsFilePath)&quot;" />
</Target>
<Target Name="InjectRequestHandlerOnPublish" AfterTargets="GeneratePublishDependencyFile" DependsOnTargets="PrepareInjectionApp">
<Exec Command="$(InjectDepsApp) $(InjectDepsArguments) &quot;$(PublishDepsFilePath)&quot;" />
</Target>
</Project>