-
Notifications
You must be signed in to change notification settings - Fork 10.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move some targets into a Directory.Build.targets file (#39712)
- not used outside IIS testassets folder nits: - remove / update outdated comments - use `$(DotNetRoot)` property
- Loading branch information
Showing
4 changed files
with
52 additions
and
52 deletions.
There are no files selected for viewing
48 changes: 48 additions & 0 deletions
48
src/Servers/IIS/IIS/test/testassets/Directory.Build.targets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<Project> | ||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory)..\, Directory.Build.targets))\Directory.Build.targets" /> | ||
|
||
<PropertyGroup> | ||
<!-- Work around until we get a new WebSdk --> | ||
<AspNetCoreHostingModel>OutOfProcess</AspNetCoreHostingModel> | ||
|
||
<HasTestAssetProfile Condition="'$(TestAssetProfile)' != ''">true</HasTestAssetProfile> | ||
<TestAssetOutputName>$(MSBuildProjectName)</TestAssetOutputName> | ||
</PropertyGroup> | ||
|
||
<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>$(PublishDir)\$(TestAssetOutputName)-$(TestAssetProfile)\</PublishDir> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup Condition="'$(HasTestAssetProfile)' != 'true'"> | ||
<IsPublishable>false</IsPublishable> | ||
<IsTransformWebConfigDisabled>true</IsTransformWebConfigDisabled> | ||
</PropertyGroup> | ||
</Target> | ||
|
||
<Target Name="PublishTestsAsset" DependsOnTargets="Publish" Returns="@(PublishedTestAsset)"> | ||
<ConvertToAbsolutePath Paths="$(PublishDir)"> | ||
<Output TaskParameter="AbsolutePaths" PropertyName="PublishAbsoluteDir" /> | ||
</ConvertToAbsolutePath> | ||
|
||
<ItemGroup> | ||
<PublishedTestAsset Include="$(TestAssetOutputName)-$(TestAssetProfile)" Path="$(PublishAbsoluteDir)" /> | ||
</ItemGroup> | ||
</Target> | ||
|
||
<Target Name="PublishTestsAssets" Condition="'$(TestAssetProfile)' == '' AND '@(TestAssetPublishProfile->Count())' != '0'" Returns="@(PublishedTestAsset)"> | ||
<!-- Platform;PlatformTarget removal is to fix builds inside VS. --> | ||
<MSBuild Projects="$(MSBuildProjectFullPath)" | ||
Targets="PublishTestsAsset" | ||
RemoveProperties="Platform;PlatformTarget" | ||
Properties="PublishDir=$(PublishDir);TestAssetProfile=%(TestAssetPublishProfile.Identity);ReferenceTestTasks=false;%(TestAssetPublishProfile.Properties)"> | ||
<Output TaskParameter="TargetOutputs" ItemName="PublishedTestAsset" /> | ||
</MSBuild> | ||
</Target> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters