|
1 | 1 | <Project>
|
| 2 | + |
2 | 3 | <PropertyGroup>
|
3 | 4 | <RuntimeIdentifiers>$(RuntimeIdentifiers);win-x64;win-x86</RuntimeIdentifiers>
|
4 | 5 | <Platforms>x64;x86</Platforms>
|
5 | 6 | <IISExpressAppHostConfig>$(MSBuildThisFileDirectory)applicationhost.config</IISExpressAppHostConfig>
|
6 | 7 | <IISAppHostConfig>$(MSBuildThisFileDirectory)applicationhost.iis.config</IISAppHostConfig>
|
7 | 8 | <PreserveCompilationContext>false</PreserveCompilationContext>
|
| 9 | + <!-- Work around until we get a new WebSdk --> |
| 10 | + <AspNetCoreHostingModel>OutOfProcess</AspNetCoreHostingModel> |
| 11 | + <HasTestAssetProfile Condition="'$(TestAssetProfile)' != ''">true</HasTestAssetProfile> |
| 12 | + <TestAssetOutputName Condition="'$(TestAssetOutputName)' == ''">$(MSBuildProjectName)</TestAssetOutputName> |
8 | 13 | </PropertyGroup>
|
9 | 14 |
|
10 | 15 | <Import Project="assets.props" />
|
|
26 | 31 | <IISArguments>-h "$(IISAppHostConfig)"</IISArguments>
|
27 | 32 |
|
28 | 33 | <AncmInProcessRHPath>aspnetcorev2_inprocess.dll</AncmInProcessRHPath>
|
29 |
| - |
30 |
| - <DotNetPath>$(DotNetRoot)dotnet.exe</DotNetPath> |
31 |
| - <DotNetPath Condition="'$(NativePlatform)' != 'x64'">$(DotNetRoot)$(NativePlatform)\dotnet.exe</DotNetPath> |
| 34 | + <!-- TODO: use LocalDotNetRoot instead to find dotnet.exe (see reporoot/Directory.Build.props). Requires a fix to https://github.com/dotnet/aspnetcore/issues/7196 --> |
| 35 | + <DotNetPath>$(RepoRoot).dotnet\dotnet.exe</DotNetPath> |
| 36 | + <DotNetPath Condition="'$(NativePlatform)' != 'x64'">$(RepoRoot).dotnet\$(NativePlatform)\dotnet.exe</DotNetPath> |
32 | 37 | </PropertyGroup>
|
33 | 38 |
|
34 | 39 | <Target Name="CopyLaunchSettings" AfterTargets="CoreBuild">
|
|
76 | 81 | DependsOnTargets="GeneratePublishDependencyFile;CopyFilesToPublishDirectory;PrepareInjectionApp">
|
77 | 82 | <Exec Command="$(InjectDepsApp) "$(PublishDepsFilePath)" $(RuntimeIdentifier) " />
|
78 | 83 | </Target>
|
| 84 | + |
| 85 | + <Target Name="PreventProjectReferencesFromBuilding" BeforeTargets="BeforeResolveReferences" Condition="'@(TestAssetPublishProfile->Count())' != '0'"> |
| 86 | + <PropertyGroup> |
| 87 | + <BuildProjectReferences Condition="'$(HasTestAssetProfile)' == 'true'">false</BuildProjectReferences> |
| 88 | + </PropertyGroup> |
| 89 | + </Target> |
| 90 | + |
| 91 | + <Target Name="PrepareForTestAssetPublish" BeforeTargets="PrepareForPublish" Condition="'@(TestAssetPublishProfile->Count())' != '0'"> |
| 92 | + <PropertyGroup Condition="'$(HasTestAssetProfile)' == 'true'"> |
| 93 | + <PublishDir>$(PublishDir)\$(TestAssetOutputName)-$(TestAssetProfile)\</PublishDir> |
| 94 | + </PropertyGroup> |
| 95 | + |
| 96 | + <PropertyGroup Condition="'$(HasTestAssetProfile)' != 'true'"> |
| 97 | + <IsPublishable>false</IsPublishable> |
| 98 | + <IsTransformWebConfigDisabled>true</IsTransformWebConfigDisabled> |
| 99 | + </PropertyGroup> |
| 100 | + </Target> |
| 101 | + |
| 102 | + <Target Name="PublishTestsAsset" DependsOnTargets="Publish" Returns="@(PublishedTestAsset)"> |
| 103 | + <ConvertToAbsolutePath Paths="$(PublishDir)"> |
| 104 | + <Output TaskParameter="AbsolutePaths" PropertyName="PublishAbsoluteDir" /> |
| 105 | + </ConvertToAbsolutePath> |
| 106 | + |
| 107 | + <ItemGroup> |
| 108 | + <PublishedTestAsset Include="$(TestAssetOutputName)-$(TestAssetProfile)" Path="$(PublishAbsoluteDir)" /> |
| 109 | + </ItemGroup> |
| 110 | + </Target> |
| 111 | + |
| 112 | + <Target Name="PublishTestsAssets" Condition="'$(TestAssetProfile)' == '' AND '@(TestAssetPublishProfile->Count())' != '0'" Returns="@(PublishedTestAsset)"> |
| 113 | + |
| 114 | + <!-- |
| 115 | + _InsidePublishTestsAssets is to avoid invoking this target recursively |
| 116 | + Platform;PlatformTarget removal is fix builds inside VS --> |
| 117 | + <MSBuild Projects="$(MSBuildProjectFullPath)" |
| 118 | + Targets="PublishTestsAsset" |
| 119 | + RemoveProperties="Platform;PlatformTarget" |
| 120 | + Properties="PublishDir=$(PublishDir);TestAssetProfile=%(TestAssetPublishProfile.Identity);ReferenceTestTasks=false;%(TestAssetPublishProfile.Properties)"> |
| 121 | + <Output TaskParameter="TargetOutputs" ItemName="PublishedTestAsset" /> |
| 122 | + </MSBuild> |
| 123 | + </Target> |
79 | 124 | </Project>
|
0 commit comments