Skip to content
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

[release/6.0] Build ProjectTemplates in Source-Build #40840

Merged
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
$(MSBuildProjectName.EndsWith('.Test')) OR
$(MSBuildProjectName.EndsWith('.FunctionalTest')) ) ">true</IsUnitTestProject>
<IsTestAssetProject Condition=" $(RepoRelativeProjectDir.Contains('testassets')) OR $(MSBuildProjectName.Contains('TestCommon'))">true</IsTestAssetProject>
<IsProjectTemplateProject Condition=" ($(RepoRelativeProjectDir.Contains('ProjectTemplates')) OR $(MSBuildProjectName.Contains('ProjectTemplates')) ) AND
'$(IsUnitTestProject)' != 'true' AND
'$(IsTestAssetProject)' != 'true' ">true</IsProjectTemplateProject>
<IsSampleProject Condition=" $(RepoRelativeProjectDir.ToUpperInvariant().Contains('SAMPLE')) ">true</IsSampleProject>
<IsAnalyzersProject Condition="$(MSBuildProjectName.EndsWith('.Analyzers'))">true</IsAnalyzersProject>
<IsShipping Condition=" '$(IsSampleProject)' == 'true' OR
Expand Down
9 changes: 7 additions & 2 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
<Project>

<PropertyGroup>
<!-- Only build Microsoft.AspNetCore.App, Microsoft.AspNetCore.App.Ref, and ref/ assemblies in source build. -->
<!-- Only build Microsoft.AspNetCore.App, Microsoft.AspNetCore.App.Ref, ref/ assemblies, and ProjectTemplates in source build. -->
<!-- Analyzer package are needed in source build for WebSDK -->
<ExcludeFromSourceBuild
Condition="'$(ExcludeFromSourceBuild)' == '' and '$(DotNetBuildFromSource)' == 'true' and '$(IsAspNetCoreApp)' != 'true' and '$(MSBuildProjectName)' != '$(TargetingPackName)' and '$(IsAnalyzersProject)' != 'true'">true</ExcludeFromSourceBuild>
Condition="'$(ExcludeFromSourceBuild)' == '' and
'$(DotNetBuildFromSource)' == 'true' and
'$(IsAspNetCoreApp)' != 'true' and
'$(MSBuildProjectName)' != '$(TargetingPackName)' and
'$(IsAnalyzersProject)' != 'true' and
'$(IsProjectTemplateProject)' != 'true'">true</ExcludeFromSourceBuild>

<!-- If the user has specified that they want to skip building any test related projects with SkipTestBuild,
suppress all targets for TestProjects using ExcludeFromBuild. -->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<Sdk Name="Yarn.MSBuild" />
<Sdk Name="Yarn.MSBuild" Condition=" '$(DotNetBuildFromSource)' != 'true'" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Might want to add an <Error /> in one of the $(ResolveStaticWebAssetsInputsDependsOn) targets if '$(DotNetBuildFromSource)' == 'true' because the failure to find yarn or Yarn.MSBuild will likely be slightly obscure. Same in src/Components/WebAssembly/WebAssembly.Authentication/src/Microsoft.AspNetCore.Components.WebAssembly.Authentication.csproj

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean in case we ever turn these on for SourceBuild?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, fast failure sounds good for that eventuality

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated


<PropertyGroup>
<TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<Sdk Name="Yarn.MSBuild" />
<Sdk Name="Yarn.MSBuild" Condition=" '$(DotNetBuildFromSource)' != 'true'" />

<PropertyGroup>
<TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
Expand Down