aspnetcore/src/Servers/IIS/build/testsite.props

103 lines
5.2 KiB
XML

<Project>
<PropertyGroup>
<RuntimeIdentifiers>$(RuntimeIdentifiers);win7-x64;win7-x86</RuntimeIdentifiers>
<Platforms>x64;x86</Platforms>
<IISExpressAppHostConfig>$(MSBuildThisFileDirectory)applicationhost.config</IISExpressAppHostConfig>
<IISAppHostConfig>$(MSBuildThisFileDirectory)applicationhost.iis.config</IISAppHostConfig>
<PreserveCompilationContext>false</PreserveCompilationContext>
<DisableFastUpToDateCheck>true</DisableFastUpToDateCheck>
<!-- Work around until we get a new WebSdk -->
<AspNetCoreHostingModel>OutOfProcess</AspNetCoreHostingModel>
<HasTestAssetProfile Condition="'$(TestAssetProfile)' != ''">true</HasTestAssetProfile>
<AppendRuntimeIdentifierToOutputPath Condition="'$(HasTestAssetProfile)' == 'true'">false</AppendRuntimeIdentifierToOutputPath>
<TestAssetOutputName Condition="'$(TestAssetOutputName)' == ''">$(MSBuildProjectName)</TestAssetOutputName>
</PropertyGroup>
<Import Project="assets.props" />
<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>
<IISExpressArguments>/config:"$(IISExpressAppHostConfig)" /systray:false</IISExpressArguments>
<IISArguments>-h "$(IISAppHostConfig)"</IISArguments>
<AncmInProcessRHPath>aspnetcorev2_inprocess.dll</AncmInProcessRHPath>
<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" SkipUnchangedFiles="true" />
</Target>
<!-- Deps file injection-->
<ItemGroup Condition="('$(InProcessTestSite)' == 'true') AND ('$(ReferenceTestTasks)' != 'false')">
<ProjectReference Include="$(MSBuildThisFileDirectory)..\IIS\test\testassets\TestTasks\TestTasks.csproj">
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
</ItemGroup>
<Target Name="PrepareInjectionApp" Condition="'$(InProcessTestSite)' == 'true'">
<PropertyGroup>
<InjectDepsAssembly>$(MSBuildThisFileDirectory)..\IIS\test\testassets\TestTasks\bin\$(Configuration)\$(TargetFramework)\TestTasks</InjectDepsAssembly>
</PropertyGroup>
<PropertyGroup Condition=" '$(TargetFrameworkIdentifier)' != '.NETFramework' ">
<InjectDepsApp>dotnet $(InjectDepsAssembly).dll</InjectDepsApp>
</PropertyGroup>
</Target>
<Target Name="InjectRequestHandler"
Condition=" '$(InProcessTestSite)' == 'true' AND '$(BuildIisNativeProjects)' == 'true' AND '$(TargetFrameworkIdentifier)' != '.NETFramework'"
AfterTargets="GenerateBuildDependencyFile"
DependsOnTargets="PrepareInjectionApp">
<Exec Command="$(InjectDepsApp) &quot;$(ProjectDepsFilePath)&quot; $(RuntimeIdentifier) " />
</Target>
<Target Name="InjectRequestHandlerOnPublish"
Condition=" '$(InProcessTestSite)' == 'true' AND '$(BuildIisNativeProjects)' == 'true' AND '$(TargetFrameworkIdentifier)' != '.NETFramework'"
AfterTargets="GeneratePublishDependencyFile"
DependsOnTargets="PrepareInjectionApp">
<Exec Command="$(InjectDepsApp) &quot;$(PublishDepsFilePath)&quot; $(RuntimeIdentifier) " />
</Target>
<Target Name="PreventProjectReferencesFromBuilding" BeforeTargets="BeforeResolveReferences" Condition="'@(TestAssetPublishProfile->Count())' != '0'">
<PropertyGroup>
<BuildProjectReferences Condition="'$(HasTestAssetProfile)' == 'true'">false</BuildProjectReferences>
</PropertyGroup>
</Target>
<Target Name="PrepareForTestAssetPublish" BeforeTargets="PrepareForPublish" Condition="'@(TestAssetPublishProfile->Count())' != '0'">
<PropertyGroup Condition="'$(HasTestAssetProfile)' == 'true'">
<PublishDir>$(OutputPath)$(PublishDirName)\$(TestAssetOutputName)-$(TestAssetProfile)\</PublishDir>
</PropertyGroup>
<PropertyGroup Condition="'$(HasTestAssetProfile)' != 'true'">
<IsPublishable>false</IsPublishable>
<IsTransformWebConfigDisabled>true</IsTransformWebConfigDisabled>
</PropertyGroup>
</Target>
<Target Name="PublishTestsAssets" AfterTargets="Build;Publish" Condition="'$(TestAssetProfile)' == '' AND '@(TestAssetPublishProfile->Count())' != '0'">
<!--
_InsidePublishTestsAssets is to avoid invoking this target recursively
Platform;PlatformTarget removal is fix builds inside VS -->
<MSBuild Projects="$(MSBuildProjectFullPath)"
Targets="Publish"
RemoveProperties="Platform;PlatformTarget"
Properties="TestAssetProfile=%(TestAssetPublishProfile.Identity);ReferenceTestTasks=false;%(TestAssetPublishProfile.Properties)" />
</Target>
</Project>