-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable restore for ref and src projects in libs (#33553)
- Use RestoreUseStaticGraphEvaluation which improves no-op restore by 10-15x down to 10-20 seconds. - .builds msbuild files renamed to .proj as RestoreUseStaticGraphEvaluation throws for non .proj files without an env var set. - Introducing subsets for libraries and mono and replacing -buildtests switch which was only working for libraries in favor of the subset switch -subset tests which works consistently. - Fixing the Microsoft.DotNet.CodeAnalysis analyzer which wasn't running and adding missing exclusions. - Separating restore and build phases in different parts in the repo (ie for installer.tasks) as generated props and targets need to be imported which requires a reevaluation in the build phase. - Fix eng/docker/build-docker-sdk.ps1 by using the official build entrypoints (cc @alnikola) - Remove a few depprojs in favor of project restore (faster restore :)) - Fix root code coverage measurement not working correctly - Traversal support instead of dir.traversal.targets or manual build target defines. - Introduce a root Build.proj entrypoint which is responsible for building and restoring the repository. This is necessary to enable the new NuGet fast restore which works best and fastest with a single entrypoint. - Avoid binclashes in libraries and between libraries and installer (netstandard.depproj vs netstandard.csproj) - Upgrading the SDK to 5.0 latest - Code cleanup
- Loading branch information
1 parent
59ca590
commit 42183b1
Showing
105 changed files
with
798 additions
and
1,161 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -27,7 +27,7 @@ bld/ | |
msbuild.log | ||
msbuild.err | ||
msbuild.wrn | ||
msbuild.binlog | ||
*.binlog | ||
.deps/ | ||
.dirstamp | ||
.libs/ | ||
|
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,80 @@ | ||
<Project Sdk="Microsoft.Build.Traversal"> | ||
|
||
<!-- | ||
Subsets are already imported by Directory.Build.props. | ||
Reference the projects for traversal build. Ordering matters here. | ||
--> | ||
<ItemGroup> | ||
<ProjectReference Include="@(CoreClrProject)" /> | ||
<ProjectReference Include="@(MonoProject)" /> | ||
<ProjectReference Include="@(LibrariesProject)" /> | ||
<ProjectReference Include="@(InstallerProject)" /> | ||
</ItemGroup> | ||
|
||
<!-- | ||
Exclude installer depproj and pkgproj from static graph restore. We restore them below. | ||
Remove when https://github.com/NuGet/Home/issues/9398 is fixed. | ||
--> | ||
<ItemGroup Condition="'$(MSBuildRestoreSessionId)' != ''"> | ||
<ProjectReference Remove="@(DepprojProjectToBuild)" /> | ||
<ProjectReference Remove="@(PkgprojProjectToBuild)" /> | ||
<ProjectReference Remove="@(BundleProjectToBuild)" /> | ||
</ItemGroup> | ||
|
||
<!-- Custom arcade target which isn't available in Microsoft.Build.Traversal. --> | ||
<Target Name="Rebuild" DependsOnTargets="Clean;Build" /> | ||
|
||
<Import Project="$(RepositoryEngineeringDir)SubsetValidation.targets" /> | ||
|
||
<!-- Upfront restore hooks --> | ||
<Import Project="$(RepositoryEngineeringDir)restore\docs.targets" Condition="'$(DotNetBuildFromSource)' != 'true'" /> | ||
<Import Project="$(RepositoryEngineeringDir)restore\optimizationData.targets" Condition="'$(DotNetBuildFromSource)' != 'true' and '$(EnableNgenOptimization)' == 'true'" /> | ||
<Import Project="$(RepositoryEngineeringDir)restore\runtimeprops.targets" /> | ||
|
||
<!-- | ||
Use synthetic inputs/outputs to avoid building it all the time. This should let devs build with | ||
MSBuild node reuse enabled (the Arcade default). If it were built every time, it would hit file | ||
locking issues vs. the persistent nodes that loaded the task DLL for the previous build. It | ||
isn't particularly accurate, but better than nothing. | ||
--> | ||
<Target Name="BuildRepoTasks" | ||
DependsOnTargets="GetRepoTasksSrc" | ||
BeforeTargets="Restore" | ||
Inputs="@(RepoTasksSrc)" | ||
Outputs="$(RepoTasksOutputFile)"> | ||
<ItemGroup> | ||
<RepoTaskProjects Include="$(RepoTasksDir)**\*.csproj" /> | ||
</ItemGroup> | ||
|
||
<MSBuild Projects="@(RepoTaskProjects)" | ||
Properties="MSBuildRestoreSessionId=$([System.Guid]::NewGuid());Configuration=Debug;Platform=AnyCPU" | ||
Targets="Restore"/> | ||
|
||
<MSBuild Projects="@(RepoTaskProjects)" | ||
Properties="Configuration=Debug;Platform=AnyCPU" | ||
Targets="Build"/> | ||
|
||
<WriteLinesToFile File="$(RepoTasksOutputFile)" | ||
Lines="$(RepoTasksOutputFile)" | ||
Overwrite="true" /> | ||
</Target> | ||
|
||
<Target Name="GetRepoTasksSrc"> | ||
<PropertyGroup> | ||
<RepoTasksDir>$(RepoTasksDir)</RepoTasksDir> | ||
<RepoTasksOutputFile>$(ArtifactsObjDir)runtime.tasks\Debug\build-semaphore.txt</RepoTasksOutputFile> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<RepoTasksSrc Include="$(RepoTasksDir)**\*.cs*" /> | ||
</ItemGroup> | ||
</Target> | ||
|
||
<Target Name="RestoreWithoutStaticGraph" | ||
BeforeTargets="Restore"> | ||
<MSBuild Projects="@(LibrariesRestoreProject);@(DepprojProjectToBuild);@(PkgprojProjectToBuild);@(BundleProjectToBuild)" | ||
Properties="MSBuildRestoreSessionId=$([System.Guid]::NewGuid());RestoreUseStaticGraphEvaluation=false" | ||
Targets="Restore" /> | ||
</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
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
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
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
Oops, something went wrong.