Skip to content

Commit bcac6ee

Browse files
authored
[release/6.0] Build ProjectTemplates in Source-Build (#40840)
* Revert "Revert "[release/6.0] Build ProjectTemplates in Source-Build (#40650)" (#40805)" This reverts commit a351c43. * Update Microsoft.Authentication.WebAssembly.Msal.csproj * Update Microsoft.AspNetCore.Components.WebAssembly.Authentication.csproj * Update Microsoft.Authentication.WebAssembly.Msal.csproj * Update Microsoft.AspNetCore.Components.WebAssembly.Authentication.csproj * Workaround
1 parent 8107aa5 commit bcac6ee

File tree

4 files changed

+26
-4
lines changed

4 files changed

+26
-4
lines changed

Directory.Build.props

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@
3030
$(MSBuildProjectName.EndsWith('.Test')) OR
3131
$(MSBuildProjectName.EndsWith('.FunctionalTest')) ) ">true</IsUnitTestProject>
3232
<IsTestAssetProject Condition=" $(RepoRelativeProjectDir.Contains('testassets')) OR $(MSBuildProjectName.Contains('TestCommon'))">true</IsTestAssetProject>
33+
<IsProjectTemplateProject Condition=" ($(RepoRelativeProjectDir.Contains('ProjectTemplates')) OR $(MSBuildProjectName.Contains('ProjectTemplates')) ) AND
34+
'$(IsUnitTestProject)' != 'true' AND
35+
'$(IsTestAssetProject)' != 'true' ">true</IsProjectTemplateProject>
3336
<IsSampleProject Condition=" $(RepoRelativeProjectDir.ToUpperInvariant().Contains('SAMPLE')) ">true</IsSampleProject>
3437
<IsAnalyzersProject Condition="$(MSBuildProjectName.EndsWith('.Analyzers'))">true</IsAnalyzersProject>
3538
<IsShipping Condition=" '$(IsSampleProject)' == 'true' OR

Directory.Build.targets

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
<Project>
22

33
<PropertyGroup>
4-
<!-- Only build Microsoft.AspNetCore.App, Microsoft.AspNetCore.App.Ref, and ref/ assemblies in source build. -->
4+
<!-- Only build Microsoft.AspNetCore.App, Microsoft.AspNetCore.App.Ref, ref/ assemblies, and ProjectTemplates in source build. -->
55
<!-- Analyzer package are needed in source build for WebSDK -->
66
<ExcludeFromSourceBuild
7-
Condition="'$(ExcludeFromSourceBuild)' == '' and '$(DotNetBuildFromSource)' == 'true' and '$(IsAspNetCoreApp)' != 'true' and '$(MSBuildProjectName)' != '$(TargetingPackName)' and '$(IsAnalyzersProject)' != 'true'">true</ExcludeFromSourceBuild>
7+
Condition="'$(ExcludeFromSourceBuild)' == '' and
8+
'$(DotNetBuildFromSource)' == 'true' and
9+
'$(IsAspNetCoreApp)' != 'true' and
10+
'$(MSBuildProjectName)' != '$(TargetingPackName)' and
11+
'$(IsAnalyzersProject)' != 'true' and
12+
'$(IsProjectTemplateProject)' != 'true'">true</ExcludeFromSourceBuild>
813

914
<!-- If the user has specified that they want to skip building any test related projects with SkipTestBuild,
1015
suppress all targets for TestProjects using ExcludeFromBuild. -->

src/Components/WebAssembly/Authentication.Msal/src/Microsoft.Authentication.WebAssembly.Msal.csproj

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk.Razor">
22

3-
<Sdk Name="Yarn.MSBuild" />
3+
<Import Project="Sdk.props" Sdk="Yarn.MSBuild" Condition=" '$(DotNetBuildFromSource)' != 'true'" />
44

55
<PropertyGroup>
66
<TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
@@ -25,6 +25,7 @@
2525
<PropertyGroup>
2626
<YarnWorkingDir>$(MSBuildThisFileDirectory)Interop\</YarnWorkingDir>
2727
<ResolveStaticWebAssetsInputsDependsOn>
28+
CheckForSourceBuild;
2829
CompileInterop;
2930
IncludeCompileInteropOutput;
3031
$(ResolveStaticWebAssetsInputsDependsOn)
@@ -91,5 +92,11 @@
9192
<FileWrites Include="$(_InteropBuildOutput)" />
9293
</ItemGroup>
9394
</Target>
95+
96+
<Target Name="CheckForSourceBuild" Condition=" '$(DotNetBuildFromSource)' == 'true'">
97+
<Error Text="The Yarn.Msbuild SDK is currently excluded from SourceBuild. If you are enabling this project for SourceBuild, remove the condition on the Yarn.Msbuild SDK above." />
98+
</Target>
9499

100+
<Import Project="Sdk.targets" Sdk="Yarn.MSBuild" Condition=" '$(DotNetBuildFromSource)' != 'true'" />
101+
95102
</Project>

src/Components/WebAssembly/WebAssembly.Authentication/src/Microsoft.AspNetCore.Components.WebAssembly.Authentication.csproj

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk.Razor">
22

3-
<Sdk Name="Yarn.MSBuild" />
3+
<Import Project="Sdk.props" Sdk="Yarn.MSBuild" Condition=" '$(DotNetBuildFromSource)' != 'true'" />
44

55
<PropertyGroup>
66
<TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
@@ -26,6 +26,7 @@
2626
<PropertyGroup>
2727
<YarnWorkingDir>$(MSBuildThisFileDirectory)Interop\</YarnWorkingDir>
2828
<ResolveStaticWebAssetsInputsDependsOn>
29+
CheckForSourceBuild;
2930
CompileInterop;
3031
IncludeCompileInteropOutput;
3132
$(ResolveStaticWebAssetsInputsDependsOn)
@@ -93,4 +94,10 @@
9394
</ItemGroup>
9495
</Target>
9596

97+
<Target Name="CheckForSourceBuild" Condition=" '$(DotNetBuildFromSource)' == 'true'">
98+
<Error Text="The Yarn.Msbuild SDK is currently excluded from SourceBuild. If you are enabling this project for SourceBuild, remove the condition on the Yarn.Msbuild SDK above." />
99+
</Target>
100+
101+
<Import Project="Sdk.targets" Sdk="Yarn.MSBuild" Condition=" '$(DotNetBuildFromSource)' != 'true'" />
102+
96103
</Project>

0 commit comments

Comments
 (0)