Skip to content

Commit

Permalink
[release/6.0] Build ProjectTemplates in Source-Build (#40840)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
wtgodbe committed Apr 5, 2022
1 parent 8107aa5 commit bcac6ee
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 4 deletions.
3 changes: 3 additions & 0 deletions Directory.Build.props
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
@@ -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
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

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

<PropertyGroup>
<TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
Expand All @@ -25,6 +25,7 @@
<PropertyGroup>
<YarnWorkingDir>$(MSBuildThisFileDirectory)Interop\</YarnWorkingDir>
<ResolveStaticWebAssetsInputsDependsOn>
CheckForSourceBuild;
CompileInterop;
IncludeCompileInteropOutput;
$(ResolveStaticWebAssetsInputsDependsOn)
Expand Down Expand Up @@ -91,5 +92,11 @@
<FileWrites Include="$(_InteropBuildOutput)" />
</ItemGroup>
</Target>

<Target Name="CheckForSourceBuild" Condition=" '$(DotNetBuildFromSource)' == 'true'">
<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." />
</Target>

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

</Project>
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

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

<PropertyGroup>
<TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
Expand All @@ -26,6 +26,7 @@
<PropertyGroup>
<YarnWorkingDir>$(MSBuildThisFileDirectory)Interop\</YarnWorkingDir>
<ResolveStaticWebAssetsInputsDependsOn>
CheckForSourceBuild;
CompileInterop;
IncludeCompileInteropOutput;
$(ResolveStaticWebAssetsInputsDependsOn)
Expand Down Expand Up @@ -93,4 +94,10 @@
</ItemGroup>
</Target>

<Target Name="CheckForSourceBuild" Condition=" '$(DotNetBuildFromSource)' == 'true'">
<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." />
</Target>

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

</Project>

0 comments on commit bcac6ee

Please sign in to comment.