-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move some targets into a Directory.Build.targets file #39712
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,9 @@ | ||
<Project Sdk="Microsoft.NET.Sdk.Web"> | ||
|
||
<Import Project="..\..\..\..\build\testsite.props" /> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework> | ||
<AssemblyName>InProcessWebSite</AssemblyName> | ||
<TestAssetOutputName>InProcessNewShimWebSite</TestAssetOutputName> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Another nit: Setting matches the default. |
||
<DefineConstants>FORWARDCOMPAT</DefineConstants> | ||
<CompileUsingReferenceAssemblies>false</CompileUsingReferenceAssemblies> | ||
<ImplicitUsings>disable</ImplicitUsings> | ||
|
@@ -61,5 +59,4 @@ | |
</PackageReference> | ||
<Reference Include="xunit.assert" /> | ||
</ItemGroup> | ||
|
||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory)..\, Directory.Build.props))\Directory.Build.props" /> | ||
|
||
<PropertyGroup> | ||
<!-- Tests do not work on Helix or when bin/ directory is not in project directory due to undeclared dependency on test content. --> | ||
<!-- Local testing does not work when bin/ directory is not in project directory due to deployer expectations. --> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: I don't think this was about "test content". Problem seems rooted in the various deployers. |
||
<BaseOutputPath /> | ||
<OutputPath /> | ||
</PropertyGroup> | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Tratcher any context about what this workaround comment is talking about?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wondered about this too❕
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LOL, no, but it happened back in 3.0 so it's probably safe to say we got a fresh WebSdk update since then 😁.
dougbu@a474a05
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current default (in Microsoft.NET.Sdk.Web.ProjectSystem.targets) is
inprocess
and this override may make sense still. Let's use this space to answerMicrosoft.NET.Sdk.Web
❔There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On (1), I suspect (given the names), the current setting is unhelpful for both InProcess*WebSite projects. Suggest we simply delete these lines and focus on the other projects.
On (2), "break" is probably too strong a word but I did change things. Good thing tests are still working.