Skip to content

Commit 4e3b499

Browse files
committed
Allow building with desktop msbuild only
1 parent bcd20ab commit 4e3b499

16 files changed

+349
-225
lines changed

eng/AfterSolutionBuild.targets

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

3+
<Import Project="Common.props" />
34
<Import Project="tools\RepoTasks\RepoTasks.tasks" />
45
<Import Project="SharedFramework.External.props" />
56
<Import Project="SharedFramework.Local.props" />
67

78
<!-- This is temporary until we can use FrameworkReference to build our own packages. -->
8-
<Target Name="RemoveSharedFrameworkOnlyRefsFromNuspec" AfterTargets="Pack"
9-
Condition=" '$(MSBuildRuntimeType)' == 'core' ">
9+
<Target Name="RemoveSharedFrameworkOnlyRefsFromNuspec" AfterTargets="Pack" Condition="'$(BuildManaged)' == 'true'">
1010
<ItemGroup>
1111
<_BuildOutput Include="$(ArtifactsShippingPackagesDir)*.nupkg"
1212
Exclude="$(ArtifactsShippingPackagesDir)*.symbols.nupkg" />

eng/Build.props

Lines changed: 6 additions & 190 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,6 @@
11
<Project>
2-
<Import Project="Common.props" />
32

4-
<!--
5-
@(RequiresDelayedBuild) projects can be extended many ways but this isn't fully automated because the new
6-
projects likely aren't referenced initially. To add new projects, edit RequiresDelayedBuildProjects.props
7-
manually, update the $(BuildMainlyReferenceProviders)' == 'true' item group near the bottom of this file,
8-
or edit BuildAfterTargetingPack.csproj. Then run GenerateProjectList.ps1 (even for the first option to ensure
9-
the format is correct) and undo any temporary changes. When complete, only BuildAfterTargetingPack.csproj and
10-
other @(RequiresDelayedBuild) projects should mention projects listed in RequiresDelayedBuildProjects.props.
11-
-->
12-
<Import Project="RequiresDelayedBuildProjects.props" />
13-
14-
<!-- These projects are always excluded, even when -projects is specified on command line. -->
15-
<ItemGroup>
16-
<!-- Explicitly excluded projects -->
17-
<ProjectToExclude Include="$(ProjectToExclude)" />
18-
19-
<!-- These projects use 'legacy' csproj, which is not supported by dotnet-msbuild. -->
20-
<ProjectToExclude Include="
21-
$(RepoRoot)src\Servers\HttpSys\samples\TestClient\TestClient.csproj;
22-
$(RepoRoot)src\Middleware\WebSockets\samples\TestServer\WebSockets.TestServer.csproj;
23-
"
24-
Condition=" '$(MSBuildRuntimeType)' == 'Core' " />
25-
26-
<!-- Exclude the websockets samples for now because they use classic .csproj, which is not yet supported in our build. -->
27-
<ProjectToExclude Include="$(RepoRoot)src\Middleware\WebSockets\samples\**\*.csproj" />
28-
29-
<!-- These projects are meant to be referenced only by tests or via BuildAfterTargetingPack.csproj. -->
30-
<ProjectToExclude
31-
Include="$(RepoRoot)src\**\testassets\**\*.*proj;
32-
@(RequiresDelayedBuild);
33-
"
34-
Exclude="$(RepoRoot)src\Components\WebAssembly\testassets\WasmLinkerTest\*.*proj;
35-
$(RepoRoot)src\Components\WebView\Samples\PhotinoPlatform\testassets\PhotinoTestApp\*.*proj;
36-
$(RepoRoot)src\Http\Routing\test\testassets\RoutingSandbox\*.*proj;
37-
$(RepoRoot)src\Security\Authentication\Negotiate\test\testassets\Negotiate.Client\*.*proj;
38-
$(RepoRoot)src\Security\Authentication\Negotiate\test\testassets\Negotiate.Server\*.*proj;
39-
" />
40-
41-
<!-- These projects are not meant to be built in this repo. In the Installers case, must explicitly opt in. -->
42-
<ProjectToExclude Include="
43-
$(RepoRoot)src\submodules\googletest\**\*.*proj;
44-
$(RepoRoot)src\submodules\MessagePack-CSharp\**\*.*proj;
45-
$(RepoRoot)src\Components\Web.JS\node_modules\**\*.*proj;
46-
$(RepoRoot)src\Installers\**\*.*proj;
47-
$(RepoRoot)src\ProjectTemplates\Web.ProjectTemplates\content\**\*.*proj;
48-
$(RepoRoot)src\SignalR\clients\ts\**\node_modules\**\*.*proj;
49-
" />
50-
51-
<!-- Exclude the benchmarks because they use <PackageReference>. -->
52-
<ProjectToExclude Include="
53-
$(RepoRoot)src\Components\benchmarkapps\BlazingPizza.Server\**\*.csproj;
54-
$(RepoRoot)src\Mvc\perf\**\*.csproj;
55-
$(RepoRoot)src\Servers\Kestrel\perf\PlatformBenchmarks\**\*.csproj;
56-
$(RepoRoot)src\SignalR\perf\benchmarkapps\**\*.csproj;
57-
" />
58-
</ItemGroup>
3+
<Import Project="$(MSBuildThisFileDirectory)Build\Directory.Build.props" />
594

605
<Choose>
616
<!-- Project selection can be overridden on the command line by passing in -projects. -->
@@ -71,141 +16,12 @@
7116
</ItemGroup>
7217
</When>
7318
<Otherwise>
74-
<ItemGroup Condition=" '$(TargetOsName)' == 'win' AND ('$(TargetArchitecture)' == 'x86' OR '$(TargetArchitecture)' == 'x64' OR '$(TargetArchitecture)' == 'arm64') ">
75-
<NativeProjects Include="$(RepoRoot)src\**\*.vcxproj" Exclude="@(ProjectToExclude)" AdditionalProperties="Platform=x64" />
76-
<NativeProjects Include="$(RepoRoot)src\**\*.vcxproj" Exclude="@(ProjectToExclude)" AdditionalProperties="Platform=Win32" />
77-
<NativeProjects Include="$(RepoRoot)src\**\*.vcxproj" Exclude="@(ProjectToExclude)" AdditionalProperties="Platform=arm64" />
78-
</ItemGroup>
79-
8019
<ItemGroup>
81-
<ProjectToBuild Condition=" $(BuildNative) " Include="@(NativeProjects)" Exclude="@(ProjectToExclude)" />
82-
<ProjectToExclude Condition=" !$(BuildNative) " Include="@(NativeProjects)" />
83-
84-
<NodeJsProjects
85-
Include="$(RepoRoot)eng\Npm.Workspace.nodeproj;
86-
$(RepoRoot)eng\Npm.Workspace.FunctionalTests.nodeproj;"
87-
AdditionalProperties="BuildInParallel=false"
88-
BuildInParallel="false"
89-
RestoreInParallel="false"
90-
Exclude="@(ProjectToExclude)" />
91-
92-
<ExplicitRequiresDelay Include="$(RepoRoot)eng\Npm.Workspace.FunctionalTests.nodeproj" />
93-
94-
<ProjectToBuild Condition=" '$(BuildNodeJS)' == 'true'" Include="@(NodeJsProjects)" Exclude="@(ProjectToExclude)" />
95-
<ProjectToExclude Condition=" '$(BuildNodeJS)' != 'true'" Include="@(NodeJsProjects)" />
96-
97-
<JavaProjects Include="$(RepoRoot)src\SignalR\**\*.javaproj"
98-
Exclude="@(ProjectToExclude)" />
99-
100-
<ProjectToBuild Condition=" '$(BuildJava)' == 'true'" Include="@(JavaProjects)" Exclude="@(ProjectToExclude)" />
101-
<ProjectToExclude Condition=" '$(BuildJava)' != 'true'" Include="@(JavaProjects)" />
102-
103-
<!--
104-
Use caution to avoid deep recursion. If the globbing pattern picks up something which exceeds MAX_PATH,
105-
the entire pattern will silently fail to evaluate correctly.
106-
-->
107-
<DotNetProjects Include="
108-
$(RepoRoot)src\Framework\App.Ref\src\Microsoft.AspNetCore.App.Ref.csproj;
109-
$(RepoRoot)src\Framework\App.Ref.Internal\src\Microsoft.AspNetCore.App.Ref.Internal.csproj;
110-
$(RepoRoot)src\Framework\AspNetCoreAnalyzers\test\Microsoft.AspNetCore.App.Analyzers.Test.csproj;
111-
$(RepoRoot)src\Framework\test\Microsoft.AspNetCore.App.UnitTests.csproj;
112-
$(RepoRoot)src\Assets\**\*.*proj;
113-
$(RepoRoot)src\Caching\**\*.*proj;
114-
$(RepoRoot)src\DefaultBuilder\**\*.*proj;
115-
$(RepoRoot)src\Features\JsonPatch\**\*.*proj;
116-
$(RepoRoot)src\DataProtection\**\*.*proj;
117-
$(RepoRoot)src\Antiforgery\**\*.*proj;
118-
$(RepoRoot)src\Hosting\**\*.*proj;
119-
$(RepoRoot)src\Http\**\*.*proj;
120-
$(RepoRoot)src\HttpClientFactory\**\*.*proj;
121-
$(RepoRoot)src\Html.Abstractions\**\*.*proj;
122-
$(RepoRoot)src\Identity\**\*.*proj;
123-
$(RepoRoot)src\Servers\**\*.csproj;
124-
$(RepoRoot)src\Security\**\*.*proj;
125-
$(RepoRoot)src\SiteExtensions\Microsoft.Web.Xdt.Extensions\**\*.csproj;
126-
$(RepoRoot)src\SiteExtensions\LoggingAggregate\test\**\*.csproj;
127-
$(RepoRoot)src\Shared\**\*.*proj;
128-
$(RepoRoot)src\Tools\**\*.*proj;
129-
$(RepoRoot)src\Logging.AzureAppServices\**\src\*.csproj;
130-
$(RepoRoot)src\Middleware\**\*.csproj;
131-
$(RepoRoot)src\Razor\**\*.*proj;
132-
$(RepoRoot)src\Mvc\**\*.*proj;
133-
$(RepoRoot)src\Azure\**\*.*proj;
134-
$(RepoRoot)src\SignalR\**\*.csproj;
135-
$(RepoRoot)src\StaticAssets\**\*.csproj;
136-
$(RepoRoot)src\Components\**\*.csproj;
137-
$(RepoRoot)src\Analyzers\**\*.csproj;
138-
$(RepoRoot)src\FileProviders\**\*.csproj;
139-
$(RepoRoot)src\Configuration.KeyPerFile\**\*.csproj;
140-
$(RepoRoot)src\Localization\**\*.csproj;
141-
$(RepoRoot)src\ObjectPool\**\*.csproj;
142-
$(RepoRoot)src\JSInterop\**\*.csproj;
143-
$(RepoRoot)src\WebEncoders\**\*.csproj;
144-
$(RepoRoot)src\HealthChecks\**\*.csproj;
145-
$(RepoRoot)src\Testing\**\*.csproj;
146-
$(RepoRoot)src\Grpc\**\*.csproj;
147-
$(RepoRoot)src\ProjectTemplates\**\*.csproj;
148-
$(RepoRoot)src\Extensions\**\*.csproj;
149-
$(RepoRoot)src\BuildAfterTargetingPack\*.csproj;
150-
$(RepoRoot)src\OpenApi\**\*.csproj;
151-
$(RepoRoot)eng\tools\HelixTestRunner\HelixTestRunner.csproj;
152-
"
153-
Exclude="
154-
@(ProjectToBuild);
155-
@(ProjectToExclude);
156-
$(RepoRoot)**\node_modules\**\*;
157-
$(RepoRoot)**\bin\**\*;
158-
$(RepoRoot)**\obj\**\*;"
159-
Condition=" '$(BuildMainlyReferenceProviders)' != 'true' " />
160-
<DotNetProjects Include="
161-
$(RepoRoot)src\Assets\**\*.*proj;
162-
$(RepoRoot)src\Caching\**\src\*.csproj;
163-
$(RepoRoot)src\DefaultBuilder\**\src\*.csproj;
164-
$(RepoRoot)src\Features\JsonPatch\**\src\*.csproj;
165-
$(RepoRoot)src\DataProtection\**\src\*.csproj;
166-
$(RepoRoot)src\Antiforgery\**\src\*.csproj;
167-
$(RepoRoot)src\Hosting\**\src\*.csproj;
168-
$(RepoRoot)src\Http\**\src\*.csproj;
169-
$(RepoRoot)src\HttpClientFactory\**\src\*.csproj;
170-
$(RepoRoot)src\Html.Abstractions\src\*.csproj;
171-
$(RepoRoot)src\Identity\**\src\*.csproj;
172-
$(RepoRoot)src\Servers\**\src\*.csproj;
173-
$(RepoRoot)src\Security\**\src\*.csproj;
174-
$(RepoRoot)src\SiteExtensions\**\src\*.csproj;
175-
$(RepoRoot)src\Tools\**\src\*.csproj;
176-
$(RepoRoot)src\Logging.AzureAppServices\**\src\*.csproj;
177-
$(RepoRoot)src\Middleware\**\src\*.csproj;
178-
$(RepoRoot)src\Razor\**\src\*.csproj;
179-
$(RepoRoot)src\Mvc\**\src\*.csproj;
180-
$(RepoRoot)src\Azure\**\src\*.csproj;
181-
$(RepoRoot)src\SignalR\**\src\*.csproj;
182-
$(RepoRoot)src\StaticAssets\src\*.csproj;
183-
$(RepoRoot)src\Components\**\src\*.csproj;
184-
$(RepoRoot)src\FileProviders\**\src\*.csproj;
185-
$(RepoRoot)src\Configuration.KeyPerFile\**\src\*.csproj;
186-
$(RepoRoot)src\Localization\**\src\*.csproj;
187-
$(RepoRoot)src\ObjectPool\**\src\*.csproj;
188-
$(RepoRoot)src\JSInterop\**\src\*.csproj;
189-
$(RepoRoot)src\WebEncoders\**\src\*.csproj;
190-
$(RepoRoot)src\HealthChecks\**\src\*.csproj;
191-
$(RepoRoot)src\Testing\**\src\*.csproj;
192-
$(RepoRoot)src\Extensions\**\src\*.csproj;
193-
$(RepoRoot)src\BuildAfterTargetingPack\*.csproj;
194-
$(RepoRoot)src\OpenApi\**\src\*.csproj;
195-
"
196-
Exclude="
197-
@(ProjectToBuild);
198-
@(ProjectToExclude);
199-
$(RepoRoot)**\node_modules\**\*;
200-
$(RepoRoot)**\bin\**\*;
201-
$(RepoRoot)**\obj\**\*;"
202-
Condition=" '$(BuildMainlyReferenceProviders)' == 'true' " />
203-
204-
<ProjectToBuild Condition=" '$(BuildManaged)' == 'true'" Include="@(DotNetProjects)" Exclude="@(ProjectToExclude)" />
205-
<ProjectToExclude Condition=" '$(BuildManaged)' != 'true'" Include="@(DotNetProjects)" />
206-
207-
<!-- Build installers after everything else got built. -->
208-
<ProjecttoBuild Condition="'$(BuildInstallers)' == 'true'" Include="$(MSBuildThisFileDirectory)Installers.proj" BuildInParallel="false" />
20+
<ProjectToBuild Include="$(MSBuildThisFileDirectory)Build\Native.Traversal.proj" Condition="'$(BuildNative)' == 'true'" BuildInParallel="false" />
21+
<ProjectToBuild Include="$(MSBuildThisFileDirectory)Build\NodeJS.Traversal.proj" Condition="'$(BuildNodeJS)' == 'true'" BuildInParallel="false" />
22+
<ProjectToBuild Include="$(MSBuildThisFileDirectory)Build\Java.Traversal.proj" Condition="'$(BuildJava)' == 'true'" BuildInParallel="false" />
23+
<ProjectToBuild Include="$(MSBuildThisFileDirectory)Build\Managed.Traversal.proj" Condition="'$(BuildManaged)' == 'true'" BuildInParallel="false" />
24+
<ProjectToBuild Include="$(MSBuildThisFileDirectory)Build\Installers.Traversal.proj" Condition="'$(BuildInstallers)' == 'true'" BuildInParallel="false" />
20925
</ItemGroup>
21026
</Otherwise>
21127
</Choose>

eng/Build/Directory.Build.props

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
<Project>
2+
3+
<!-- Don't import repo infrastructure -->
4+
<PropertyGroup>
5+
<ImportDirectoryPackagesProps>false</ImportDirectoryPackagesProps>
6+
</PropertyGroup>
7+
8+
<Import Project="..\Common.props" />
9+
10+
<!--
11+
@(RequiresDelayedBuild) projects can be extended many ways but this isn't fully automated because the new
12+
projects likely aren't referenced initially. To add new projects, edit RequiresDelayedBuildProjects.props
13+
manually, update the $(BuildMainlyReferenceProviders)' == 'true' item group near the bottom of this file,
14+
or edit BuildAfterTargetingPack.csproj. Then run GenerateProjectList.ps1 (even for the first option to ensure
15+
the format is correct) and undo any temporary changes. When complete, only BuildAfterTargetingPack.csproj and
16+
other @(RequiresDelayedBuild) projects should mention projects listed in RequiresDelayedBuildProjects.props.
17+
-->
18+
<Import Project="..\RequiresDelayedBuildProjects.props" />
19+
20+
<!-- These projects are always excluded, even when -projects is specified on command line. -->
21+
<ItemGroup>
22+
<!-- Explicitly excluded projects -->
23+
<ProjectToExclude Include="$(ProjectToExclude)" />
24+
25+
<!-- These projects use 'legacy' csproj, which is not supported by dotnet-msbuild. -->
26+
<ProjectToExclude Include="
27+
$(RepoRoot)src\Servers\HttpSys\samples\TestClient\TestClient.csproj;
28+
$(RepoRoot)src\Middleware\WebSockets\samples\TestServer\WebSockets.TestServer.csproj;
29+
"
30+
Condition=" '$(MSBuildRuntimeType)' == 'Core' " />
31+
32+
<!-- Exclude the websockets samples for now because they use classic .csproj, which is not yet supported in our build. -->
33+
<ProjectToExclude Include="$(RepoRoot)src\Middleware\WebSockets\samples\**\*.csproj" />
34+
35+
<!-- These projects are meant to be referenced only by tests or via BuildAfterTargetingPack.csproj. -->
36+
<ProjectToExclude
37+
Include="$(RepoRoot)src\**\testassets\**\*.*proj;
38+
@(RequiresDelayedBuild);
39+
"
40+
Exclude="$(RepoRoot)src\Components\WebAssembly\testassets\WasmLinkerTest\*.*proj;
41+
$(RepoRoot)src\Components\WebView\Samples\PhotinoPlatform\testassets\PhotinoTestApp\*.*proj;
42+
$(RepoRoot)src\Http\Routing\test\testassets\RoutingSandbox\*.*proj;
43+
$(RepoRoot)src\Security\Authentication\Negotiate\test\testassets\Negotiate.Client\*.*proj;
44+
$(RepoRoot)src\Security\Authentication\Negotiate\test\testassets\Negotiate.Server\*.*proj;
45+
" />
46+
47+
<!-- These projects are not meant to be built in this repo. In the Installers case, must explicitly opt in. -->
48+
<ProjectToExclude Include="
49+
$(RepoRoot)src\submodules\googletest\**\*.*proj;
50+
$(RepoRoot)src\submodules\MessagePack-CSharp\**\*.*proj;
51+
$(RepoRoot)src\Components\Web.JS\node_modules\**\*.*proj;
52+
$(RepoRoot)src\Installers\**\*.*proj;
53+
$(RepoRoot)src\ProjectTemplates\Web.ProjectTemplates\content\**\*.*proj;
54+
$(RepoRoot)src\SignalR\clients\ts\**\node_modules\**\*.*proj;
55+
" />
56+
57+
<!-- Exclude the benchmarks because they use <PackageReference>. -->
58+
<ProjectToExclude Include="
59+
$(RepoRoot)src\Components\benchmarkapps\BlazingPizza.Server\**\*.csproj;
60+
$(RepoRoot)src\Mvc\perf\**\*.csproj;
61+
$(RepoRoot)src\Servers\Kestrel\perf\PlatformBenchmarks\**\*.csproj;
62+
$(RepoRoot)src\SignalR\perf\benchmarkapps\**\*.csproj;
63+
" />
64+
</ItemGroup>
65+
66+
</Project>

eng/Build/Directory.Build.targets

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<Project>
2+
3+
<Target Name="GetReferencesProvided" Returns="ProvidesReferenceOrRequiresDelay">
4+
<MSBuild Projects="@(ProjectReference);@(ExplicitRequiresDelay)"
5+
Targets="GetReferencesProvided"
6+
BuildInParallel="true"
7+
SkipNonexistentTargets="true"
8+
SkipNonexistentProjects="true">
9+
<Output TaskParameter="TargetOutputs" ItemName="ProvidesReferenceOrRequiresDelay" />
10+
</MSBuild>
11+
</Target>
12+
13+
</Project>

0 commit comments

Comments
 (0)