Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/dotnet/runtime.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorViktor Hofer <viktor.hofer@microsoft.com>2020-04-06 12:54:10 +0300
committerGitHub <noreply@github.com>2020-04-06 12:54:10 +0300
commit42183b1b86656a348e0b6af7fa7c75072865f759 (patch)
treef178d9b245efa810cbd23597c92429d873c46032 /Build.proj
parent59ca590949ade88c712e4ca8c6835acd0e9cbf46 (diff)
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
Diffstat (limited to 'Build.proj')
-rw-r--r--Build.proj80
1 files changed, 80 insertions, 0 deletions
diff --git a/Build.proj b/Build.proj
new file mode 100644
index 00000000000..0ecff09e855
--- /dev/null
+++ b/Build.proj
@@ -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> \ No newline at end of file