Enable restore for ref and src projects in libs (#33553)
authorViktor Hofer <viktor.hofer@microsoft.com>
Mon, 6 Apr 2020 09:54:10 +0000 (11:54 +0200)
committerGitHub <noreply@github.com>
Mon, 6 Apr 2020 09:54:10 +0000 (11:54 +0200)
- 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

105 files changed:
.gitignore
Build.proj [new file with mode: 0644]
Directory.Build.props
docs/coding-guidelines/package-projects.md
docs/coding-guidelines/project-guidelines.md
docs/project/library-servicing.md
docs/workflow/building/libraries/README.md
docs/workflow/debugging/libraries/debugging-packages.md
docs/workflow/testing/libraries/testing.md
eng/Analyzers.props
eng/Build.props
eng/Configurations.props
eng/SubsetValidation.targets [new file with mode: 0644]
eng/Subsets.props
eng/Tools.props
eng/Version.Details.xml
eng/Versions.props
eng/build.ps1
eng/build.sh
eng/codeAnalysis.targets [deleted file]
eng/docker/build-docker-sdk.ps1
eng/docker/libraries-sdk.linux.Dockerfile
eng/illink.targets
eng/packaging.props
eng/pipelines/libraries/build-job.yml
eng/pipelines/libraries/build-test-job.yml
eng/pipelines/libraries/enterprise/linux.yml
eng/pipelines/libraries/run-test-job.yml
eng/restore/docs.targets
eng/restore/harvestPackages.targets [moved from src/libraries/restore/harvestPackages/harvestPackages.depproj with 55% similarity]
eng/restore/optimizationData.targets
eng/restore/repoRestore.props
eng/restore/repoRestore.targets
eng/restore/runtimeprops.targets [new file with mode: 0644]
eng/testing/coverage.targets
eng/testing/tests.props
global.json
src/coreclr/build.cmd
src/coreclr/build.sh
src/coreclr/src/.nuget/Microsoft.NETCore.ILAsm/Microsoft.NETCore.ILAsm.proj [moved from src/mono/netcore/nuget/Microsoft.NETCore.Tool.MonoAOT/Microsoft.NETCore.Tool.MonoAOT.builds with 100% similarity]
src/coreclr/src/.nuget/Microsoft.NETCore.ILDAsm/Microsoft.NETCore.ILDAsm.proj [moved from src/mono/netcore/nuget/Microsoft.NETCore.Runtime.Mono/Microsoft.NETCore.Runtime.Mono.builds with 100% similarity]
src/coreclr/src/.nuget/Microsoft.NETCore.TestHost/Microsoft.NETCore.TestHost.proj [moved from src/coreclr/src/.nuget/Microsoft.NETCore.TestHost/Microsoft.NETCore.TestHost.builds with 100% similarity]
src/coreclr/src/.nuget/coreclr-packages.proj [moved from src/coreclr/src/.nuget/packages.builds with 80% similarity]
src/coreclr/src/System.Private.CoreLib/System.Private.CoreLib.csproj
src/installer/pkg/Directory.Build.props
src/installer/pkg/packaging/installers.proj
src/installer/pkg/projects/Directory.Build.props
src/libraries/Directory.Build.props
src/libraries/Directory.Build.targets
src/libraries/Microsoft.Extensions.Configuration.Json/tests/Microsoft.Extensions.Configuration.Json.Tests.csproj
src/libraries/Microsoft.Extensions.Configuration.UserSecrets/tests/Microsoft.Extensions.Configuration.UserSecrets.Tests.csproj
src/libraries/Microsoft.Extensions.DependencyInjection/tests/Microsoft.Extensions.DependencyInjection.Tests.csproj
src/libraries/Microsoft.Extensions.DependencyInjection/tests/xunit.runner.json [deleted file]
src/libraries/Microsoft.Extensions.DependencyModel/tests/Microsoft.Extensions.DependencyModel.Tests.csproj
src/libraries/Microsoft.Extensions.Logging.EventSource/tests/Microsoft.Extensions.Logging.EventSource.Tests.csproj
src/libraries/Microsoft.VisualBasic.Core/src/Microsoft.VisualBasic.Core.vbproj
src/libraries/Native/native-binplace.proj
src/libraries/System.Diagnostics.EventLog/src/PinvokeAnalyzerExceptionList.analyzerdata
src/libraries/System.Diagnostics.PerformanceCounter/src/PinvokeAnalyzerExceptionList.analyzerdata
src/libraries/System.Management/src/PinvokeAnalyzerExceptionList.analyzerdata.netcoreapp [new file with mode: 0644]
src/libraries/System.Net.Http.WinHttpHandler/tests/FunctionalTests/System.Net.Http.WinHttpHandler.Functional.Tests.csproj
src/libraries/System.Net.Http/src/PinvokeAnalyzerExceptionList.analyzerdata [moved from src/libraries/System.Net.Http/src/PInvokeAnalyzerExceptionList.analyzerdata with 100% similarity]
src/libraries/System.Net.Sockets/src/PinvokeAnalyzerExceptionList.analyzerdata [new file with mode: 0644]
src/libraries/System.Runtime.WindowsRuntime/ref/System.Runtime.WindowsRuntime.csproj
src/libraries/System.Runtime.WindowsRuntime/src/System.Runtime.WindowsRuntime.csproj
src/libraries/System.Runtime.WindowsRuntime/tests/System.Runtime.WindowsRuntime.Tests.csproj
src/libraries/System.ServiceProcess.ServiceController/src/PinvokeAnalyzerExceptionList.analyzerdata [new file with mode: 0644]
src/libraries/build.proj [deleted file]
src/libraries/dir.traversal.targets [deleted file]
src/libraries/dirs.proj [deleted file]
src/libraries/libraries-packages.proj [moved from src/libraries/packages.builds with 62% similarity]
src/libraries/pkg/Directory.Build.props
src/libraries/pkg/Microsoft.Extensions.Internal.Transport/Microsoft.Extensions.Internal.Transport.proj [moved from src/libraries/pkg/Microsoft.Extensions.Internal.Transport/Microsoft.Extensions.Internal.Transport.builds with 100% similarity]
src/libraries/pkg/Microsoft.NETCore.Platforms.Future/Microsoft.NETCore.Platforms.Future.proj [moved from src/libraries/pkg/Microsoft.NETCore.Platforms.Future/Microsoft.NETCore.Platforms.Future.builds with 100% similarity]
src/libraries/pkg/Microsoft.NETCore.Platforms/Microsoft.NETCore.Platforms.proj [moved from src/libraries/pkg/Microsoft.NETCore.Platforms/Microsoft.NETCore.Platforms.builds with 100% similarity]
src/libraries/pkg/Microsoft.NETCore.Targets/Microsoft.NETCore.Targets.proj [moved from src/libraries/pkg/Microsoft.NETCore.Targets/Microsoft.NETCore.Targets.builds with 100% similarity]
src/libraries/pkg/Microsoft.Private.CoreFx.OOB/Microsoft.Private.CoreFx.OOB.proj [moved from src/libraries/pkg/Microsoft.Windows.Compatibility/Microsoft.Windows.Compatibility.builds with 100% similarity]
src/libraries/pkg/Microsoft.Windows.Compatibility/Microsoft.Windows.Compatibility.proj [moved from src/libraries/pkg/Microsoft.Private.CoreFx.OOB/Microsoft.Private.CoreFx.OOB.builds with 100% similarity]
src/libraries/pkg/dir.traversal.targets
src/libraries/pkg/runtime.native.System.IO.Ports/runtime.native.System.IO.Ports.pkgproj
src/libraries/pkg/runtime.native.System.IO.Ports/runtime.native.System.IO.Ports.proj [moved from src/libraries/pkg/runtime.native.System.IO.Ports/runtime.native.System.IO.Ports.builds with 100% similarity]
src/libraries/pretest.proj
src/libraries/ref.builds [deleted file]
src/libraries/ref.proj [new file with mode: 0644]
src/libraries/restore/analyzers/analyzers.depproj [deleted file]
src/libraries/restore/depproj.proj [new file with mode: 0644]
src/libraries/restore/dirs.proj [deleted file]
src/libraries/restore/netcoreapp/external.netcoreapp.depproj [moved from src/libraries/restore/netcoreapp/netcoreapp.depproj with 100% similarity]
src/libraries/restore/netstandard/external.netstandard.depproj [moved from src/libraries/restore/netstandard/netstandard.depproj with 100% similarity]
src/libraries/restore/runtime/Directory.Build.props
src/libraries/restore/runtime/runtime.depproj
src/libraries/restore/tools/tools.depproj [deleted file]
src/libraries/restore/winrt/winrt.depproj [deleted file]
src/libraries/shims/ApiCompat.proj
src/libraries/shims/Directory.Build.props
src/libraries/src.builds [deleted file]
src/libraries/src.proj [new file with mode: 0644]
src/libraries/tests.proj
src/mono/Directory.Build.props
src/mono/llvm/llvm-init.proj
src/mono/mono.proj
src/mono/netcore/System.Private.CoreLib/System.Private.CoreLib.csproj
src/mono/netcore/nuget/Microsoft.NETCore.Runtime.Mono/Microsoft.NETCore.Runtime.Mono.proj [moved from src/coreclr/src/.nuget/Microsoft.NETCore.ILDAsm/Microsoft.NETCore.ILDAsm.builds with 100% similarity]
src/mono/netcore/nuget/Microsoft.NETCore.Tool.MonoAOT/Microsoft.NETCore.Tool.MonoAOT.proj [moved from src/coreclr/src/.nuget/Microsoft.NETCore.ILAsm/Microsoft.NETCore.ILAsm.builds with 100% similarity]
src/mono/netcore/nuget/mono-packages.proj [moved from src/mono/netcore/nuget/packages.builds with 75% similarity]

index 35c0342..a9a3cae 100644 (file)
@@ -27,7 +27,7 @@ bld/
 msbuild.log
 msbuild.err
 msbuild.wrn
-msbuild.binlog
+*.binlog
 .deps/
 .dirstamp
 .libs/
diff --git a/Build.proj b/Build.proj
new file mode 100644 (file)
index 0000000..0ecff09
--- /dev/null
@@ -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
index 66e5188..06cb0f4 100644 (file)
     <ArtifactsObjDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsDir)', 'obj'))</ArtifactsObjDir>
   </PropertyGroup>
 
-  <!-- The TFMs to build and test against. -->
-  <PropertyGroup>
-    <NETCoreAppCurrentVersion>5.0</NETCoreAppCurrentVersion>
-    <NetCoreAppCurrentTargetFrameworkMoniker>.NETCoreApp,Version=v$(NETCoreAppCurrentVersion)</NetCoreAppCurrentTargetFrameworkMoniker>
-    <NetCoreAppCurrent>netcoreapp$(NETCoreAppCurrentVersion)</NetCoreAppCurrent>
-    <NetFrameworkCurrent>net472</NetFrameworkCurrent>
-  </PropertyGroup>
-
+  <!-- Configuration properties which are needed in both the (isolated) restore and build phases. -->
   <Import Project="$(RepositoryEngineeringDir)Configurations.props" />
 
   <!--
index 436439b..375ec4b 100644 (file)
@@ -55,164 +55,6 @@ Sample `System.Collections.Concurrent.pkgproj`
 </Project>
 ```
 
-### Framework-specific library
-Framework specific libraries are effectively the same as the previous example.  The difference is that the src project reference **must** refer to the `.builds` file which will provide multiple assets from multiple projects.
-
-Sample System.Net.Security.pkgproj
-```
-<Project DefaultTargets="Build">
-  <Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))" />
-  <ItemGroup>
-    <ProjectReference Include="..\ref\System.Net.Security.builds">
-      <SupportedFramework>net463;netcoreapp1.1;$(AllXamarinFrameworks)</SupportedFramework>
-    </ProjectReference>
-    <ProjectReference Include="..\src\System.Net.Security.builds" />
-  </ItemGroup>
-  <ItemGroup>
-    <InboxOnTargetFramework Include="MonoAndroid10" />
-    <InboxOnTargetFramework Include="MonoTouch10" />
-    <InboxOnTargetFramework Include="xamarinios10" />
-    <InboxOnTargetFramework Include="xamarinmac20" />
-    <InboxOnTargetFramework Include="xamarintvos10" />
-    <InboxOnTargetFramework Include="xamarinwatchos10" />
-
-    <NotSupportedOnTargetFramework Include="netcore50">
-      <PackageTargetRuntime>win7</PackageTargetRuntime>
-    </NotSupportedOnTargetFramework>
-  </ItemGroup>
-  <ItemGroup>
-  </ItemGroup>
-  <Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.targets))" />
-</Project>
-```
-
-Sample \ref .builds file defining a constant used to filter API that were added on top of the netstandard1.7 ones and are available only in netcoreapp1.1:
-
-```
-<Project DefaultTargets="Build">
-  <Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))" />
-  <PropertyGroup>
-    <OutputType>Library</OutputType>
-    <NuGetTargetMoniker>.NETStandard,Version=v1.7</NuGetTargetMoniker>
-    <DefineConstants Condition="'$(TargetFramework)' == 'netcoreapp1.1'">$(DefineConstants);netcoreapp11</DefineConstants>
-  </PropertyGroup>
-  <ItemGroup>
-    <Compile Include="System.Net.Security.cs" />
-    <Compile Include="System.Net.Security.Manual.cs" />
-  </ItemGroup>
-  <ItemGroup>
-    <None Include="project.json" />
-  </ItemGroup>
-  <Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.targets))" />
-</Project>
-```
-
-Conditional compilation using the above-mentioned constant (from `ref\System.Net.Security.cs`):
-
-```
-#if NETCOREAPP
-        public virtual void AuthenticateAsClient(string targetHost, System.Security.Cryptography.X509Certificates.X509CertificateCollection clientCertificates, bool checkCertificateRevocation) { }
-#endif
-```
-
-Sample \src .builds file (in this case the implementation is the same in both netcoreapp1.1 and netstandard1.7):
-
-```
-<Project DefaultTargets="Build">
-  <Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))" />
-  <ItemGroup>
-    <Project Include="System.Net.Security.csproj">
-      <OSGroup>Unix</OSGroup>
-    </Project>
-    <Project Include="System.Net.Security.csproj">
-      <OSGroup>Windows_NT</OSGroup>
-    </Project>
-    <Project Include="System.Net.Security.csproj">
-      <TargetFramework>net463</TargetFramework>
-    </Project>
-  </ItemGroup>
-  <Import Project="$(RepositoryEngineeringDir)dir.traversal.targets" />
-</Project>
-```
-
-Tests can be similarly filtered grouping the compilation directives under:
-```
-  <ItemGroup Condition="'$(TargetFramework)'=='netcoreapp1.1'">
-```
-(from `\tests\FunctionalTests\System.Net.Security.Tests.csproj`)
-
-### Platform-specific library
-These packages need to provide a different platform specific implementation on each platform.  They do this by splitting the implementations into separate packages and associating those platform specific packages with the primary reference package.  Each platform specific package sets `PackageTargetRuntime` to the specific platform RID that it applies.
-
-Sample `System.IO.FileSystem.pkgproj`
-```
-<Project DefaultTargets="Build">
-  <Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))" />
-  <ItemGroup>
-    <ProjectReference Include="..\ref\System.IO.FileSystem.csproj">
-      <SupportedFramework>net46;netcore50;netcoreapp1.0</SupportedFramework>
-    </ProjectReference>
-    <ProjectReference Include="..\src\Facade\System.IO.FileSystem.csproj" />
-    <ProjectReference Include="win\System.IO.FileSystem.pkgproj" />
-    <ProjectReference Include="unix\System.IO.FileSystem.pkgproj" />
-
-    <InboxOnTargetFramework Include="MonoAndroid10" />
-    <InboxOnTargetFramework Include="MonoTouch10" />
-    <InboxOnTargetFramework Include="xamarinios10" />
-    <InboxOnTargetFramework Include="xamarinmac20" />
-  </ItemGroup>
-  <Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.targets))" />
-</Project>
-```
-
-`win/System.IO.FileSystem.pkgproj`
-```
-<Project DefaultTargets="Build">
-  <Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))" />
-
-  <PropertyGroup>
-    <PackageTargetRuntime>win7</PackageTargetRuntime>
-    <PreventImplementationReference>true</PreventImplementationReference>
-  </PropertyGroup>
-
-  <ItemGroup>
-    <ProjectReference Include="..\..\src\System.IO.FileSystem.builds">
-      <AdditionalProperties>OSGroup=Windows_NT</AdditionalProperties>
-    </ProjectReference>
-
-    <!-- No implementation on platforms where our P-Invokes are not allowed -->
-    <NotSupportedOnTargetFramework Include="win8" />
-    <NotSupportedOnTargetFramework Include="wp8" />
-    <NotSupportedOnTargetFramework Include="wpa81" />
-
-    <!-- don't use the dotnet implementation for any version of desktop, it's implementation comes from the reference package -->
-    <ExternalOnTargetFramework Include="net" />
-  </ItemGroup>
-
-
-  <Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.targets))" />
-</Project>
-```
-`unix/System.IO.FileSystem.pkgproj`
-```
-<Project DefaultTargets="Build">
-  <Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))" />
-
-  <PropertyGroup>
-    <PackageTargetRuntime>unix</PackageTargetRuntime>
-    <PreventImplementationReference>true</PreventImplementationReference>
-  </PropertyGroup>
-
-  <ItemGroup>
-    <ProjectReference Include="..\..\src\System.IO.FileSystem.builds">
-      <AdditionalProperties>OSGroup=Linux</AdditionalProperties>
-    </ProjectReference>
-  </ItemGroup>
-
-  <Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.targets))" />
-</Project>
-```
-
 ## Asset selection
 
 The makeup of a package folder is primarily a grouping of project references to the projects that compose that package.  Settings within each referenced project determines where that asset will be placed in the package.  For example, reference assembly projects will be placed under the `ref/{targetMoniker}` folder in the package and implementations will be under either `lib/{targetMoniker}` or `runtimes/{rid}/lib/{targetMoniker}`.  Whenever NuGet evaluates a package in the context of a referencing project it will choose the best compile time asset (preferring `ref`, then falling back to `lib`) and runtime asset (preferring `runtimes/{rid}/lib` and falling back to `lib`) for every package that is referenced.  For more information see http://docs.nuget.org/.
@@ -221,8 +63,8 @@ Asset projects (`.csproj`, `.vbproj`, or `.depproj`) can control their `{targetM
 
 The primary thing that the library author needs to do in order to ensure the correct asset selection is:
 
-1. Configure the correct projects in your library's `.builds` file.
-2. Reference the `.builds` file from the package project.
+1. Configure the correct projects in your library's `.proj` file.
+2. Reference the `.proj` file from the package project.
 3. Provide a default PackageTargetFramework for empty-BuildTargetFramework builds in the library's `.csproj` or `.vbproj`.
     ```
     <PackageTargetFramework Condition="'$(PackageTargetFramework)' == ''">dotnet5.4</PackageTargetFramework>
index d483ceb..5572873 100644 (file)
@@ -10,9 +10,9 @@ once before you can iterate and work on a given library project.
  - Netstandard Library - Copy to `bin\ref\netstandard2.0`
  - NetFx targeting pack - Copy to `bin\ref\net472`
 - Build targeting pack
- - Build src\ref.builds which builds all references assembly projects. For reference assembly project information see [ref](#ref)
+ - Build src\libraries\ref.proj which builds all references assembly projects. For reference assembly project information see [ref](#ref)
 - Build product
- - Build src\src.builds which builds all the source library projects. For source library project information see [src](#src).
+ - Build src\libraries\src.proj which builds all the source library projects. For source library project information see [src](#src).
 - Sign product
  - Build src\sign.proj
 
index 225cbaa..52d7f5a 100644 (file)
@@ -33,9 +33,9 @@ Where the `AssemblyVersion` is set to the old version before updating. To determ
 
 If you incremented the `AssemblyVersion` in the last step, you'll also need to add an entry to [packageIndex.json](https://github.com/dotnet/runtime/blob/master/src/libraries/pkg/Microsoft.Private.PackageBaseline/packageIndex.json). Find the entry for your library in that file (again, making sure you're in the correct release branch), then find the subsection labeled `AssemblyVersionInPackageVersion`. There, add an entry that maps your new `AssemblyVersion` to your new `PackageVersion`. For an example, see [this PR](https://github.com/dotnet/runtime/commit/d0e4dcc7ebf008e7b6835cafbd03878c3a0e75f8#diff-ec9fd7a62cb0c494d86029014940382cR107), where we bumped the `PackageVersion` of `Microsoft.Diagnostics.Tracing.EventSource` from `2.0.0` to `2.0.1`, and bumped the `AssemblyVersion` from `2.0.0.0` to `2.0.1.0`. Therefore, we added an entry to `packageIndex.json` of the form `"2.0.1.0": "2.0.1"`.
 
-## Add your package to packages.builds
+## Add your package to libraries-packages.proj
 
-In order to ensure that your package gets built, you need to add it to [packages.builds](https://github.com/dotnet/runtime/blob/master/src/libraries/packages.builds). In the linked example, we were building `System.Drawing.Common`. All you have to do is add a `Project` block inside the linked ItemGroup that matches the form of the linked example, but with `System.Drawing.Common` replaced by your library's name. Again, make sure to do this in the right servicing branch.
+In order to ensure that your package gets built, you need to add it to [libraries-packages.proj](https://github.com/dotnet/runtime/blob/master/src/libraries/libraries-packages.proj). In the linked example, we were building `System.Drawing.Common`. All you have to do is add a `Project` block inside the linked ItemGroup that matches the form of the linked example, but with `System.Drawing.Common` replaced by your library's name. Again, make sure to do this in the right servicing branch.
 
 ## Test your changes
 
index eaafa3e..eecbcfe 100644 (file)
@@ -81,9 +81,9 @@ The build settings (BuildTargetFramework, TargetOS, Configuration, Architecture)
 
 For more details on the build settings see [project-guidelines](../../../coding-guidelines/project-guidelines.md#build-pivots).
 
-If you invoke the `build` script without any actions, the default action chain `-restore -build` is executed. You can chain multiple actions together (e.g., `-restore -build -buildtests`) and they will execute in the appropriate order. Note that if you specify actions like `-build` explicitly, you likely need to explicitly add `-restore` as well.
+If you invoke the `build` script without any actions, the default action chain `-restore -build` is executed.
 
-By default the `build` script only builds the product libraries and none of the tests. If you want to build the tests you can add the flag `-buildtests`. If you want to run the tests you can add the flag `-test`. To build and run the tests combine both arguments: `-buildtests -test`. To specify just the libraries, use `-subcategory libraries`.
+By default the `build` script only builds the product libraries and none of the tests. If you want to include tests, you want to add the subset `-subset libtests`. If you want to run the tests you want to use the `-test` action instead of the `-build`, e.g. `build.cmd/sh -subsetcategory libraries -test`. To specify just the libraries, use `-subcategory libraries`.
 
 **Examples**
 - Building in release mode for platform x64 (restore and build are implicit here as no actions are passed in)
@@ -93,7 +93,7 @@ By default the `build` script only builds the product libraries and none of the
 
 - Building the src assemblies and build and run tests (running all tests takes a considerable amount of time!)
 ```bash
-./build.sh -subsetCategory libraries -restore -build -buildtests -test
+./build.sh -subsetCategory libraries -restore -build -test
 ```
 
 - Building for different target frameworks (restore and build are implicit again as no action is passed in)
index be7953b..5b25a1f 100644 (file)
@@ -25,7 +25,7 @@ Assuming the current directory is `\src\contractname\`:
 
 Check the logs for output such as:
 ```
-Project "S:\c1\src\System.Net.ServicePoint\ref\System.Net.ServicePoint.builds" (1) is building "S:\c1\src\System.Net.ServicePoint\ref\System.Net.ServicePoint.csproj" (2:3) on node 1
+Project "S:\c1\src\System.Net.ServicePoint\ref\System.Net.ServicePoint.csproj" (1) is building "S:\c1\src\System.Net.ServicePoint\ref\System.Net.ServicePoint.csproj" (2:3) on node 1
 (Build target(s)).
 
 [...]
@@ -37,7 +37,7 @@ CopyFilesToOutputDirectory:
 
 [...]
 
-Project "S:\c1\src\System.Net.ServicePoint\ref\System.Net.ServicePoint.builds" (1) is building "S:\c1\src\System.Net.ServicePoint\ref\System.Net.ServicePoint.csproj" (2:4) on node 1
+Project "S:\c1\src\System.Net.ServicePoint\ref\System.Net.ServicePoint.csproj" (1) is building "S:\c1\src\System.Net.ServicePoint\ref\System.Net.ServicePoint.csproj" (2:4) on node 1
 (Build target(s)).
 
 [...]
@@ -86,7 +86,7 @@ Ensure that the right `BuildTargetFramework` (what we're testing) is set.
 To identify which of the combinations failed, search for the following pattern in the output:
 
 ```
-Project "S:\c1\src\System.Net.ServicePoint\tests\System.Net.ServicePoint.Tests.builds" (1) is building "S:\c1\src\System.Net.ServicePoint\tests\System.Net.ServicePoint.Tests.csproj"
+Project "S:\c1\src\System.Net.ServicePoint\tests\System.Net.ServicePoint.Tests.csproj" (1) is building "S:\c1\src\System.Net.ServicePoint\tests\System.Net.ServicePoint.Tests.csproj"
 (2:5) on node 1 (Build target(s)).
 ResolvePkgProjReferences:
   Resolved compile assets from .NETStandard,Version=v2.0: S:\c1\bin\ref\System.Net.ServicePoint\4.0.0.0\System.Net.ServicePoint.dll
index 73a0ebc..5a2228f 100644 (file)
@@ -7,7 +7,7 @@ To build the tests and run them you can call the libraries build script.
 **Examples**
 - The following shows how to build only the tests but not run them:
 ```
-libraries -buildtests
+libraries -subset libtests
 ```
 
 - The following builds and runs all tests in release configuration:
@@ -20,17 +20,15 @@ libraries -test -c Release
 libraries -test /p:WithoutCategories=IgnoreForCI
 ```
 
-Unless you specifiy `/p:TestNoBuild=true`, test assemblies are implicitly built when invoking the `Test` target.
+Unless you specifiy `-testnobuild`, test assemblies are implicitly built when invoking the `Test` action.
 - The following shows how to only test the libraries without building them
 ```
-libraries -test /p:TestNoBuild=true
+libraries -test -testnobuild
 ```
 
 ## Running tests on the command line
 
-To build tests you need to pass the `-buildtests` flag to `build.cmd/sh` or run `libraries -restore -build -buildtests` (note that you need to specify `-restore` and `-build` additionally as those are only implicit if no action is passed in).
-
-If you are interested in building and running the tests only for a specific library, then there are two different ways to do it:
+To build tests you need to specify the `test` subset when invoking build.cmd/sh: `libraries -subset libtests`.
 
 The easiest (and recommended) way to build and run the tests for a specific library, is to invoke the `Test` target on that library:
 ```cmd
index 2a24156..8d2cb20 100644 (file)
@@ -1,6 +1,8 @@
 <Project>
   <PropertyGroup>
     <CodeAnalysisRuleset>$(MSBuildThisFileDirectory)CodeAnalysis.ruleset</CodeAnalysisRuleset>
+    <!-- Disable analyzers in sourcebuild -->
+    <EnableAnalyzers Condition="'$(DotNetBuildFromSource)' == 'true'">false</EnableAnalyzers>
   </PropertyGroup>
   <ItemGroup Condition="'$(EnableAnalyzers)' == 'true'">
     <PackageReference Include="Microsoft.DotNet.CodeAnalysis" Version="$(MicrosoftDotNetCodeAnalysisVersion)" PrivateAssets="all" IsImplicitlyDefined="true" />
index 95f52b3..dd722c6 100644 (file)
@@ -1,98 +1,8 @@
 <Project>
-  <!--
-    Import projects for Arcade to build.
-
-    The imported file supports the '/p:Subset=<desired subset string>' dev build argument.
-
-    Each subset has its own '<subset>ProjectToBuild' items so that a project in the build can depend
-    on a whole subset, and the dependency on the subset is disregarded automatically when Subset
-    doesn't contain it.
-
-    %(ProjectToBuild.SignPhase): Indicates this project must be built before a certain signing
-      phase. Projects can depend on 'signing/stages/Sign<stage>.proj' to wait until all projects
-      that are part of a stage are complete. This allows the build to perform complex container
-      signing that isn't (can't be?) supported by Arcade's single pass, such as MSIs and bundles:
-      https://github.com/dotnet/arcade/issues/388
-  -->
-
-  <Import Project="$(MSBuildThisFileDirectory)Configurations.props" />
-  <Import Project="$(MSBuildThisFileDirectory)Subsets.props" />
-
-  <Target Name="CheckSpecifiedSubsetValidity"
-          DependsOnTargets="FindInvalidSpecifiedSubsetNames;ReportValidSubsetList"
-          BeforeTargets="Execute" />
-
-  <Target Name="FindInvalidSpecifiedSubsetNames">
-    <ItemGroup>
-      <SpecifiedSubsetName Include="$([MSBuild]::Unescape($(Subset.Replace('-', ';'))))" />
-
-      <!-- MSBuild Exclude is case-insensitive, which matches intended behavior. -->
-      <InvalidSpecifiedSubsetName Include="@(SpecifiedSubsetName)" Exclude="@(SubsetName)" />
-    </ItemGroup>
-
-    <PropertyGroup>
-      <UserRequestedHelp Condition="'%(InvalidSpecifiedSubsetName.Identity)' == 'help'">true</UserRequestedHelp>
-    </PropertyGroup>
-  </Target>
-
-  <Target Name="ReportValidSubsetList"
-          Condition="'@(InvalidSpecifiedSubsetName)' != ''">
-    <ItemGroup>
-      <SubsetName Text="- " />
-      <SubsetName Condition="'%(Category)' != ''" Text="%(Text)%(Category)|" />
-      <SubsetName Text="%(Text)%(Identity)" />
-      <SubsetName Text="%(Text) [only runs on demand]" Condition="'%(SubsetName.OnDemand)' == 'true'" />
-      <SubsetName Text="%(Text)%0A    %(Description)" />
-    </ItemGroup>
-
-    <Message Text="%0AAccepted Subset values:%0A@(SubsetName->'%(Text)', '%0A')%0A" Importance="High" />
-
-    <Error Text="Subset not recognized: @(InvalidSpecifiedSubsetName, ' ')"
-           Condition="'$(UserRequestedHelp)' != 'true'" />
-
-    <Error Text="Choose a subset to use, or do not specify a subset to perform the full build."
-           Condition="'$(UserRequestedHelp)' == 'true'" />
-  </Target>
-
-  <!--
-    Use this extensibility point to build custom tasks during Build.proj, before any restoring or
-    building happens in the repo. These DLLs would ideally live in Arcade and be restored as tools,
-    so the idea is building them here is somewhat equivalent.
-
-    Also create the host RID props file so the main build can use it statically.
-
-    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="Execute"
-          Inputs="@(RepoTasksSrc)"
-          Outputs="$(RepoTasksOutputFile)">
-    <ItemGroup>
-      <RepoTaskProjects Include="$(RepoTasksDir)**\*.csproj" />
-    </ItemGroup>
-
-    <MSBuild Projects="@(RepoTaskProjects)"
-             Properties="Configuration=Debug;Platform=AnyCPU"
-             Targets="Restore;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>
-
+  <PropertyGroup>
+    <RestoreUseStaticGraphEvaluation>true</RestoreUseStaticGraphEvaluation>  
+  </PropertyGroup>
+  <ItemGroup>
+    <ProjectToBuild Include="$(RepoRoot)Build.proj" />
+  </ItemGroup>
 </Project>
index eaa276e..b4417f2 100644 (file)
@@ -1,4 +1,29 @@
 <Project>
+  <!--
+    This file contains properties and items which are used in both the Arcade
+    steps and in the repository.
+  -->
+
+  <PropertyGroup>
+    <LibrariesProjectRoot>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'src', 'libraries'))</LibrariesProjectRoot>
+    <CoreClrProjectRoot>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'src', 'coreclr'))</CoreClrProjectRoot>
+    <MonoProjectRoot>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'src', 'mono'))</MonoProjectRoot>
+    <InstallerProjectRoot>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'src', 'installer'))</InstallerProjectRoot>
+    <RepoToolsLocalDir>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'tools-local'))</RepoToolsLocalDir>
+    <RepoTasksDir>$([MSBuild]::NormalizeDirectory('$(RepoToolsLocalDir)', 'tasks'))</RepoTasksDir>
+    <IbcOptimizationDataDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsDir)', 'ibc'))</IbcOptimizationDataDir>
+    <XmlDocDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'docs'))</XmlDocDir>
+    <RuntimePropsFile>$([MSBuild]::NormalizePath('$(ArtifactsDir)', 'tmp', '$(Configuration)', 'RuntimeOS.props'))</RuntimePropsFile>
+  </PropertyGroup>
+
+  <!-- The TFMs to build and test against. -->
+  <PropertyGroup>
+    <NETCoreAppCurrentVersion>5.0</NETCoreAppCurrentVersion>
+    <NetCoreAppCurrentTargetFrameworkMoniker>.NETCoreApp,Version=v$(NETCoreAppCurrentVersion)</NetCoreAppCurrentTargetFrameworkMoniker>
+    <NetCoreAppCurrent>netcoreapp$(NETCoreAppCurrentVersion)</NetCoreAppCurrent>
+    <NetFrameworkCurrent>net472</NetFrameworkCurrent>
+  </PropertyGroup>
+
   <!-- Honor the generic RuntimeConfiguration property. -->
   <PropertyGroup>
     <RuntimeConfiguration Condition="'$(RuntimeConfiguration)' == ''">$(Configuration)</RuntimeConfiguration>
     <MonoTargetOS Condition="'$(MonoTargetOS)' == ''">$(TargetOS)</MonoTargetOS>
     <LibrariesTargetOS Condition="'$(LibrariesTargetOS)' == ''">$(TargetOS)</LibrariesTargetOS>
   </PropertyGroup>
-</Project>
+
+  <!--Feature switches -->
+  <PropertyGroup>
+    <EnableNgenOptimization Condition="'$(EnableNgenOptimization)' == '' and '$(Configuration)' == 'Release'">true</EnableNgenOptimization>
+    <!-- Enable NuGet static graph evaluation to optimize incremental restore -->
+    <RestoreUseStaticGraphEvaluation>true</RestoreUseStaticGraphEvaluation>
+  </PropertyGroup>
+</Project>
\ No newline at end of file
diff --git a/eng/SubsetValidation.targets b/eng/SubsetValidation.targets
new file mode 100644 (file)
index 0000000..deca513
--- /dev/null
@@ -0,0 +1,48 @@
+<Project InitialTargets="FindInvalidSpecifiedSubsetNames;ReportValidSubsetList">
+  <!--
+    The imported file supports the '/p:Subset=<desired subset string>' dev build argument.
+
+    Each subset has its own '<subset>ProjectToBuild' items so that a project in the build can depend
+    on a whole subset, and the dependency on the subset is disregarded automatically when Subset
+    doesn't contain it.
+
+    %(ProjectToBuild.SignPhase): Indicates this project must be built before a certain signing
+      phase. Projects can depend on 'signing/stages/Sign<stage>.proj' to wait until all projects
+      that are part of a stage are complete. This allows the build to perform complex container
+      signing that isn't (can't be?) supported by Arcade's single pass, such as MSIs and bundles:
+      https://github.com/dotnet/arcade/issues/388
+  -->
+
+  <Target Name="FindInvalidSpecifiedSubsetNames">
+    <ItemGroup>
+      <SpecifiedSubsetName Include="$([MSBuild]::Unescape($(Subset.Replace('-', ';'))))" />
+
+      <!-- MSBuild Exclude is case-insensitive, which matches intended behavior. -->
+      <InvalidSpecifiedSubsetName Include="@(SpecifiedSubsetName)" Exclude="@(SubsetName)" />
+    </ItemGroup>
+
+    <PropertyGroup>
+      <UserRequestedHelp Condition="'%(InvalidSpecifiedSubsetName.Identity)' == 'help'">true</UserRequestedHelp>
+    </PropertyGroup>
+  </Target>
+
+  <Target Name="ReportValidSubsetList"
+          Condition="'@(InvalidSpecifiedSubsetName)' != ''">
+    <ItemGroup>
+      <SubsetName Text="- " />
+      <SubsetName Condition="'%(Category)' != ''" Text="%(Text)%(Category)|" />
+      <SubsetName Text="%(Text)%(Identity)" />
+      <SubsetName Text="%(Text) [only runs on demand]" Condition="'%(SubsetName.OnDemand)' == 'true'" />
+      <SubsetName Text="%(Text)%0A    %(Description)" />
+    </ItemGroup>
+
+    <Message Text="%0AAccepted Subset values:%0A@(SubsetName->'%(Text)', '%0A')%0A" Importance="High" />
+
+    <Error Text="Subset not recognized: @(InvalidSpecifiedSubsetName, ' ')"
+           Condition="'$(UserRequestedHelp)' != 'true'" />
+
+    <Error Text="Choose a subset to use, or do not specify a subset to perform the full build."
+           Condition="'$(UserRequestedHelp)' == 'true'" />
+  </Target>
+
+</Project>
\ No newline at end of file
index 386bed4..55b261c 100644 (file)
   -->
 
   <PropertyGroup>
-    <LibrariesProjectRoot>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'src', 'libraries'))</LibrariesProjectRoot>
-    <CoreClrProjectRoot>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'src', 'coreclr'))</CoreClrProjectRoot>
-    <MonoProjectRoot>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'src', 'mono'))</MonoProjectRoot>
-    <InstallerProjectRoot>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'src', 'installer'))</InstallerProjectRoot>
-    <RepoToolsLocalDir>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'tools-local'))</RepoToolsLocalDir>
-    <RepoTasksDir>$([MSBuild]::NormalizeDirectory('$(RepoToolsLocalDir)', 'tasks'))</RepoTasksDir>
-  </PropertyGroup>
-
-  <PropertyGroup>
     <DefaultSubsetCategories>libraries-installer-coreclr-mono</DefaultSubsetCategories>
     <DefaultSubsetCategories Condition="'$(TargetOS)' == 'iOS'">libraries-installer-mono</DefaultSubsetCategories>
     <DefaultSubsetCategories Condition="'$(TargetOS)' == 'Android'">libraries-mono</DefaultSubsetCategories>
+  </PropertyGroup>
+
+  <PropertyGroup>
+    <DefaultCoreClrSubsets>runtime-linuxdac-corelib-nativecorelib-tools-packages</DefaultCoreClrSubsets>
+
+    <DefaultMonoSubsets Condition="'$(MonoEnableLLVM)' == 'true' and '$(MonoLLVMDir)' == ''">llvm-</DefaultMonoSubsets>
+    <DefaultMonoSubsets>$(DefaultMonoSubsets)runtime-corelib-packages</DefaultMonoSubsets>
+
+    <DefaultLibrariesSubsets>depprojs-native-ref-src-pretest-packages</DefaultLibrariesSubsets>
+    <DefaultLibrariesSubsets Condition="'$(IncludeLibrariesTestSubset)' == 'true'">$(DefaultLibrariesSubsets)-libtests</DefaultLibrariesSubsets>
+
     <DefaultInstallerSubsets>corehost-managed-depproj-pkgproj-bundle-installers-test</DefaultInstallerSubsets>
     <DefaultInstallerSubsets Condition="'$(TargetOS)' == 'iOS'">depproj-pkgproj</DefaultInstallerSubsets>
-    <!-- TODO: Split into multiple sets. -->
-    <DefaultLibrariesSubsets>all</DefaultLibrariesSubsets>
-    <DefaultCoreClrSubsets>runtime-linuxdac-corelib-nativecorelib-tools-packages</DefaultCoreClrSubsets>
-    <DefaultMonoSubsets>all</DefaultMonoSubsets>
+  </PropertyGroup>
 
+  <PropertyGroup>
     <_subsetCategory Condition="'$(SubsetCategory)' != ''">$(SubsetCategory.ToLowerInvariant())</_subsetCategory>
     <_subsetCategory Condition="'$(SubsetCategory)' == ''">$(DefaultSubsetCategories)</_subsetCategory>
     <_subset Condition="'$(Subset)' != ''">$(Subset.ToLowerInvariant())</_subset>
-    <_subset Condition="'$(Subset)' == '' and $(_subsetCategory.Contains('installer'))">$(DefaultInstallerSubsets)</_subset>
-    <_subset Condition="'$(Subset)' == '' and $(_subsetCategory.Contains('libraries'))">$(_subset)-$(DefaultLibrariesSubsets)</_subset>
+    <_subset Condition="'$(Subset)' == '' and $(_subsetCategory.Contains('libraries'))">$(DefaultLibrariesSubsets)</_subset>
+    <_subset Condition="'$(Subset)' == '' and $(_subsetCategory.Contains('installer'))">$(_subset)-$(DefaultInstallerSubsets)</_subset>
     <_subset Condition="'$(Subset)' == '' and $(_subsetCategory.Contains('coreclr'))">$(_subset)-$(DefaultCoreClrSubsets)</_subset>
     <_subset Condition="'$(Subset)' == '' and $(_subsetCategory.Contains('mono'))">$(_subset)-$(DefaultMonoSubsets)</_subset>
 
   </PropertyGroup>
 
   <ItemGroup>
-    <!-- Global -->
-    <SubsetName Include="RegenerateReadmeTable" Category="" OnDemand="true" Description="Regenerates the table of asset links in the README.md file." />
-
     <!-- Libraries -->
-    <SubsetName Include="All" Category="Libraries" Description="The .NET libraries comprising the shared framework." />
+    <SubsetName Include="Native" Category="Libraries" Description="The native libraries used in the shared framework." />
+    <SubsetName Include="Ref" Category="Libraries" Description="The managed reference libraries." />
+    <SubsetName Include="Src" Category="Libraries" Description="The managed implementation libraries." />
+    <SubsetName Include="PreTest" Category="Libraries" Description="Test assets which are necessary to run tests." />
+    <SubsetName Include="Packages" Category="Libraries" Description="The projects that produce NuGet packages from libraries." />
+    <SubsetName Include="LibTests" Category="Libraries" OnDemand="true" Description="The test projects. Note that building this doesn't execute tests: you must also pass the '-test' argument." />
 
     <!-- CoreClr -->
     <SubsetName Include="Runtime" Category="CoreClr" Description="The CoreCLR .NET runtime." />
     <SubsetName Include="Packages" Category="CoreClr" Description="The projects that produce NuGet packages for the CoreCLR runtime, crossgen, and IL tools." />
 
     <!-- Mono -->
-    <SubsetName Include="All" Category="Mono" Description="The Mono .NET runtime." />
+    <SubsetName Include="Runtime" Category="Mono" Description="The Mono .NET runtime." />
+    <SubsetName Include="CoreLib" Category="Mono" Description="The managed System.Private.CoreLib library for Mono." />
+    <SubsetName Include="Packages" Category="Mono" Description="The projects that produce NuGet packages for the Mono runtime." />
 
     <!-- Installer -->
     <SubsetName Include="All" Category="Installer" Description="The .NET Core hosts, hosting libraries, bundles, and installers. Includes these projects' tests." />
     <SubsetName Include="Test" Category="Installer" Description="The test projects. Note that building this doesn't execute tests: you must also pass the '-test' argument." />
   </ItemGroup>
 
-  <!-- Global sets -->
-  <ItemGroup Condition="$(_subset.Contains('-regeneratereadmetable-'))">
-    <ProjectToBuild Include="$(RepoToolsLocalDir)regenerate-readme-table.proj" />
-  </ItemGroup>
-
-  <ItemDefinitionGroup Condition="'$(CoreCLRConfiguration)' != ''">
-    <CoreClrProjectToBuild>
-      <AdditionalProperties>Configuration=$(CoreCLRConfiguration)</AdditionalProperties>
-    </CoreClrProjectToBuild>
-    <CoreClrCoreLibProjectToBuild>
-      <AdditionalProperties>Configuration=$(CoreCLRConfiguration)</AdditionalProperties>
-    </CoreClrCoreLibProjectToBuild>
-    <CoreClrNativeCoreLibProjectToBuild>
-      <AdditionalProperties>Configuration=$(CoreCLRConfiguration)</AdditionalProperties>
-    </CoreClrNativeCoreLibProjectToBuild>
-    <CoreClrManagedToolsProjectToBuild>
-      <AdditionalProperties>Configuration=$(CoreCLRConfiguration)</AdditionalProperties>
-    </CoreClrManagedToolsProjectToBuild>
-    <CoreClrPackagesProjectToBuild>
-      <AdditionalProperties>Configuration=$(CoreCLRConfiguration)</AdditionalProperties>
-    </CoreClrPackagesProjectToBuild>
-    <CoreClrLinuxDacProjectToBuild>
-      <AdditionalProperties>Configuration=$(CoreCLRConfiguration)</AdditionalProperties>
-    </CoreClrLinuxDacProjectToBuild>
-    <CoreClrAlpineLinuxDacProjectToBuild>
-      <AdditionalProperties>Configuration=$(CoreCLRConfiguration)</AdditionalProperties>
-    </CoreClrAlpineLinuxDacProjectToBuild>
-  </ItemDefinitionGroup>
-
-  <ItemDefinitionGroup Condition="'$(MonoConfiguration)' != ''">
-    <MonoProjectToBuild>
-      <AdditionalProperties>Configuration=$(MonoConfiguration)</AdditionalProperties>
-    </MonoProjectToBuild>
-  </ItemDefinitionGroup>
-
-  <ItemDefinitionGroup Condition="'$(LibrariesConfiguration)' != ''">
-    <LibrariesProjectToBuild>
-      <AdditionalProperties>Configuration=$(LibrariesConfiguration)</AdditionalProperties>
-    </LibrariesProjectToBuild>
+  <!-- Default targets, parallelization and configurations. -->
+  <ItemDefinitionGroup>
+    <CoreClrProject>
+      <Test>false</Test>
+      <Pack>false</Pack>
+      <Publish>false</Publish>
+      <BuildInParallel>false</BuildInParallel>
+      <AdditionalProperties Condition="'$(CoreCLRConfiguration)' != ''">Configuration=$(CoreCLRConfiguration)</AdditionalProperties>
+    </CoreClrProject>
+    <MonoProject>
+      <Test>false</Test>
+      <Pack>false</Pack>
+      <Publish>false</Publish>
+      <BuildInParallel>false</BuildInParallel>
+      <AdditionalProperties Condition="'$(MonoConfiguration)' != ''">Configuration=$(MonoConfiguration)</AdditionalProperties>
+    </MonoProject>
+    <LibrariesProject>
+      <Test>false</Test>
+      <Pack>false</Pack>
+      <Publish>false</Publish>
+      <BuildInParallel>false</BuildInParallel>
+      <AdditionalProperties Condition="'$(LibrariesConfiguration)' != ''">Configuration=$(LibrariesConfiguration)</AdditionalProperties>
+    </LibrariesProject>
+    <InstallerProject>
+      <Test>false</Test>
+      <Pack>true</Pack>
+      <Publish>false</Publish>
+    </InstallerProject>
   </ItemDefinitionGroup>
 
   <!-- CoreClr sets -->
   <ItemGroup Condition="$(_subsetCategory.Contains('coreclr')) and $(_subset.Contains('-corelib-'))">
-    <CoreClrCoreLibProjectToBuild Include="$(CoreClrProjectRoot)src\System.Private.CoreLib\System.Private.CoreLib.csproj" BuildInParallel="false" />
-    <ProjectToBuild Include="@(CoreClrCoreLibProjectToBuild)" />
+    <CoreClrProject Include="$(CoreClrProjectRoot)src\System.Private.CoreLib\System.Private.CoreLib.csproj" />
   </ItemGroup>
 
   <ItemGroup Condition="$(_subsetCategory.Contains('coreclr')) and $(_subset.Contains('-runtime-'))">
-    <CoreClrProjectToBuild Include="$(CoreClrProjectRoot)runtime.proj" BuildInParallel="false" />
-    <ProjectToBuild Include="@(CoreClrProjectToBuild)" />
+    <CoreClrProject Include="$(CoreClrProjectRoot)runtime.proj" />
   </ItemGroup>
 
   <ItemGroup Condition="$(_subsetCategory.Contains('coreclr')) and $(_subset.Contains('-linuxdac-')) and $([MSBuild]::IsOsPlatform(Windows)) and '$(TargetArchitecture)' != 'x86'">
-    <CoreClrLinuxDacProjectToBuild Include="$(CoreClrProjectRoot)runtime.proj" BuildInParallel="false" AdditionalProperties="%(AdditionalProperties);CrossDac=linux" />
-    <ProjectToBuild Include="@(CoreClrLinuxDacProjectToBuild)" />
+    <CoreClrProject Include="$(CoreClrProjectRoot)runtime.proj" AdditionalProperties="%(AdditionalProperties);CrossDac=linux" />
   </ItemGroup>
 
   <ItemGroup Condition="$(_subsetCategory.Contains('coreclr')) and $(_subset.Contains('-alpinedac-')) and $([MSBuild]::IsOsPlatform(Windows)) and '$(TargetArchitecture)' != 'x86'">
-    <CoreClrAlpineLinuxDacProjectToBuild Include="$(CoreClrProjectRoot)runtime.proj" BuildInParallel="false" AdditionalProperties="%(AdditionalProperties);CrossDac=alpine" />
-    <ProjectToBuild Include="@(CoreClrAlpineLinuxDacProjectToBuild)" />
+    <CoreClrProject Include="$(CoreClrProjectRoot)runtime.proj" AdditionalProperties="%(AdditionalProperties);CrossDac=alpine" />
   </ItemGroup>
 
   <ItemGroup Condition="$(_subsetCategory.Contains('coreclr')) and $(_subset.Contains('-nativecorelib-'))">
-    <CoreClrNativeCoreLibProjectToBuild Include="$(CoreClrProjectRoot)crossgen-corelib.proj" BuildInParallel="false" />
-    <ProjectToBuild Include="@(CoreClrNativeCoreLibProjectToBuild)" />
+    <CoreClrProject Include="$(CoreClrProjectRoot)crossgen-corelib.proj" />
   </ItemGroup>
 
   <ItemGroup Condition="$(_subsetCategory.Contains('coreclr')) and $(_subset.Contains('-tools-'))">
-    <CoreClrManagedToolsProjectToBuild Include="$(CoreClrProjectRoot)src\tools\runincontext\runincontext.csproj" />
-    <CoreClrManagedToolsProjectToBuild Include="$(CoreClrProjectRoot)src\tools\r2rdump\R2RDump.csproj" />
-    <CoreClrManagedToolsProjectToBuild Include="$(CoreClrProjectRoot)src\tools\dotnet-pgo\dotnet-pgo.csproj" />
-    <CoreClrManagedToolsProjectToBuild Include="$(CoreClrProjectRoot)src\tools\ReadyToRun.SuperIlc\ReadyToRun.SuperIlc.csproj" />
-    <CoreClrManagedToolsProjectToBuild Include="$(CoreClrProjectRoot)src\tools\crossgen2\crossgen2\crossgen2.csproj" BuildInParallel="false" />
-    <ProjectToBuild Include="@(CoreClrManagedToolsProjectToBuild)" />
+    <CoreClrProject Include="$(CoreClrProjectRoot)src\tools\runincontext\runincontext.csproj" BuildInParallel="true" />
+    <CoreClrProject Include="$(CoreClrProjectRoot)src\tools\r2rdump\R2RDump.csproj" BuildInParallel="true" />
+    <CoreClrProject Include="$(CoreClrProjectRoot)src\tools\dotnet-pgo\dotnet-pgo.csproj" BuildInParallel="true" />
+    <CoreClrProject Include="$(CoreClrProjectRoot)src\tools\ReadyToRun.SuperIlc\ReadyToRun.SuperIlc.csproj" BuildInParallel="true" />
+    <CoreClrProject Include="$(CoreClrProjectRoot)src\tools\crossgen2\crossgen2\crossgen2.csproj" />
   </ItemGroup>
 
   <ItemGroup Condition="$(_subsetCategory.Contains('coreclr')) and $(_subset.Contains('-packages-'))">
-    <CoreClrPackagesProjectToBuild Include="$(CoreClrProjectRoot)src\.nuget\packages.builds" BuildInParallel="false" />
-    <ProjectToBuild Include="@(CoreClrPackagesProjectToBuild)" />
+    <CoreClrProject Include="$(CoreClrProjectRoot)src\.nuget\coreclr-packages.proj" Pack="true" />
   </ItemGroup>
+
   <!-- Mono sets -->
-  <ItemGroup Condition="$(_subsetCategory.Contains('mono')) and $(_subset.Contains('-all-'))">
-    <MonoProjectToBuild Include="$(MonoProjectRoot)mono.proj" BuildInParallel="false" />
-    <MonoProjectToBuild Include="$(MonoProjectRoot)netcore\System.Private.CoreLib\System.Private.CoreLib.csproj" BuildInParallel="false" />
-    <ProjectToBuild Include="@(MonoProjectToBuild)" />
+  <ItemGroup Condition="$(_subsetCategory.Contains('mono')) and $(_subset.Contains('-llvm-'))">
+    <MonoProject Include="$(MonoProjectRoot)llvm\llvm-init.proj" />
+  </ItemGroup>
+
+  <ItemGroup Condition="$(_subsetCategory.Contains('mono')) and $(_subset.Contains('-runtime-'))">
+    <MonoProject Include="$(MonoProjectRoot)mono.proj" />
+  </ItemGroup>
+
+  <ItemGroup Condition="$(_subsetCategory.Contains('mono')) and $(_subset.Contains('-corelib-'))">
+    <MonoProject Include="$(MonoProjectRoot)netcore\System.Private.CoreLib\System.Private.CoreLib.csproj" />
+  </ItemGroup>
+
+  <ItemGroup Condition="$(_subsetCategory.Contains('mono')) and $(_subset.Contains('-packages-'))">
+    <MonoProject Include="$(MonoProjectRoot)netcore\nuget\mono-packages.proj" Pack="True" />
   </ItemGroup>
 
   <!-- Libraries sets -->
-  <ItemGroup Condition="$(_subsetCategory.Contains('libraries')) and $(_subset.Contains('-all-'))">
-    <LibrariesProjectToBuild Include="$(LibrariesProjectRoot)build.proj" BuildInParallel="false" />
-    <ProjectToBuild Include="@(LibrariesProjectToBuild)" />
+  <ItemGroup Condition="$(_subsetCategory.Contains('libraries')) and $(_subset.Contains('-depprojs-'))">
+    <LibrariesRestoreProject Include="$(LibrariesProjectRoot)restore\depproj.proj">
+      <AdditionalProperties Condition="'$(LibrariesConfiguration)' != ''">Configuration=$(LibrariesConfiguration)</AdditionalProperties>
+    </LibrariesRestoreProject>
+  </ItemGroup>
+
+  <ItemGroup Condition="$(_subsetCategory.Contains('libraries')) and $(_subset.Contains('-native-'))">
+    <LibrariesProject Include="$(LibrariesProjectRoot)Native\build-native.proj" />
+  </ItemGroup>
+
+  <ItemGroup Condition="$(_subsetCategory.Contains('libraries')) and $(_subset.Contains('-ref-'))">
+    <LibrariesProject Include="$(LibrariesProjectRoot)ref.proj" />
+  </ItemGroup>
+
+  <ItemGroup Condition="$(_subsetCategory.Contains('libraries')) and $(_subset.Contains('-src-'))">
+    <LibrariesProject Include="$(LibrariesProjectRoot)src.proj" />
+  </ItemGroup>
+
+  <ItemGroup Condition="$(_subsetCategory.Contains('libraries')) and $(_subset.Contains('-pretest-'))">
+    <LibrariesProject Include="$(LibrariesProjectRoot)pretest.proj"  />
+  </ItemGroup>
+
+  <ItemGroup Condition="$(_subsetCategory.Contains('libraries')) and $(_subset.Contains('-packages-'))">
+    <LibrariesProject Include="$(LibrariesProjectRoot)libraries-packages.proj" Pack="true" />
+  </ItemGroup>
+
+  <ItemGroup Condition="$(_subsetCategory.Contains('libraries')) and $(_subset.Contains('-libtests-'))">
+    <LibrariesProject Include="$(LibrariesProjectRoot)tests.proj" Test="true" />
   </ItemGroup>
 
   <!-- Installer sets -->
   <ItemGroup Condition="$(_subsetCategory.Contains('installer')) and $(_subset.Contains('-corehost-'))">
     <CorehostProjectToBuild Include="$(InstallerProjectRoot)corehost\build.proj" SignPhase="Binaries" />
-    <ProjectToBuild Include="@(CorehostProjectToBuild)" />
+    <InstallerProject Include="@(CorehostProjectToBuild)" />
   </ItemGroup>
 
   <ItemGroup Condition="$(_subsetCategory.Contains('installer')) and $(_subset.Contains('-managed-'))">
     <ManagedProjectToBuild Include="$(InstallerProjectRoot)managed\**\*.csproj" SignPhase="Binaries" />
     <ManagedProjectToBuild Include="$(InstallerProjectRoot)pkg\packaging\pack-managed.proj" />
-    <ProjectToBuild Include="@(ManagedProjectToBuild)" />
+    <InstallerProject Include="@(ManagedProjectToBuild)" />
   </ItemGroup>
 
   <ItemGroup Condition="$(_subsetCategory.Contains('installer')) and $(_subset.Contains('-depproj-'))">
     <DepprojProjectToBuild Condition="'$(RuntimeFlavor)' == 'CoreCLR'" Include="$(InstallerProjectRoot)pkg\projects\**\*.depproj" SignPhase="R2RBinaries" BuildInParallel="false" />
     <DepprojProjectToBuild Condition="'$(RuntimeFlavor)' == 'Mono'" Include="$(InstallerProjectRoot)pkg\projects\**\*.depproj" SignPhase="Binaries" BuildInParallel="false" />
-    <ProjectToBuild Include="@(DepprojProjectToBuild)" />
+    <!-- Disable netstandard infra for now and discuss if we should delete it: https://github.com/dotnet/runtime/issues/2294-->
+    <DepprojProjectToBuild Remove="$(InstallerProjectRoot)pkg\projects\netstandard\src\netstandard.depproj" />
+    <InstallerProject Include="@(DepprojProjectToBuild)" />
   </ItemGroup>
 
   <ItemGroup Condition="$(_subsetCategory.Contains('installer')) and $(_subset.Contains('-pkgproj-'))">
     <PkgprojProjectToBuild Include="$(InstallerProjectRoot)pkg\projects\**\*.pkgproj" SignPhase="MsiFiles" BuildInParallel="false" />
-    <ProjectToBuild Include="@(PkgprojProjectToBuild)" />
+    <!-- Disable netstandard infra for now and discuss if we should delete it: https://github.com/dotnet/runtime/issues/2294-->
+    <PkgprojProjectToBuild Remove="$(InstallerProjectRoot)pkg\projects\netstandard\pkg\NETStandard.Library.Ref.pkgproj" />
+    <InstallerProject Include="@(PkgprojProjectToBuild)" />
   </ItemGroup>
 
   <ItemGroup Condition="$(_subsetCategory.Contains('installer')) and $(_subset.Contains('-bundle-'))">
     <BundleProjectToBuild Include="$(InstallerProjectRoot)pkg\projects\**\*.bundleproj" SignPhase="BundleInstallerFiles" BuildInParallel="false" />
-    <ProjectToBuild Include="@(BundleProjectToBuild)" />
+    <InstallerProject Include="@(BundleProjectToBuild)" />
   </ItemGroup>
 
   <ItemGroup Condition="$(_subsetCategory.Contains('installer')) and $(_subset.Contains('-installers-'))">
     <InstallerProjectToBuild Include="$(InstallerProjectRoot)pkg\packaging\installers.proj" BuildInParallel="false" />
     <InstallerProjectToBuild Include="$(InstallerProjectRoot)pkg\packaging\vs-insertion-packages.proj" BuildInParallel="false" />
-    <ProjectToBuild Include="@(InstallerProjectToBuild)" />
+    <InstallerProject Include="@(InstallerProjectToBuild)" />
   </ItemGroup>
 
   <ItemGroup Condition="$(_subsetCategory.Contains('installer')) and $(_subset.Contains('-test-'))">
     <TestProjectToBuild Include="$(InstallerProjectRoot)test\Microsoft.NET.HostModel.Tests\Microsoft.NET.HostModel.ComHost.Tests\Microsoft.NET.HostModel.ComHost.Tests.csproj" />
     <TestProjectToBuild Include="$(InstallerProjectRoot)test\HostActivation.Tests\HostActivation.Tests.csproj" />
     <TestProjectToBuild Include="$(InstallerProjectRoot)test\Microsoft.DotNet.CoreSetup.Packaging.Tests\Microsoft.DotNet.CoreSetup.Packaging.Tests.csproj" />
-    <ProjectToBuild Include="@(TestProjectToBuild)" BuildInParallel="false" />
+    <InstallerProject Include="@(TestProjectToBuild)" Pack="false" Test="true" BuildInParallel="false" />
   </ItemGroup>
 
 </Project>
index 32fc0f6..f7746f8 100644 (file)
@@ -1,50 +1,18 @@
 <Project>
   <PropertyGroup>
-    <MSBuildTreatWarningsAsErrors>false</MSBuildTreatWarningsAsErrors>
-    <EnableAnalyzers>true</EnableAnalyzers>
     <!-- Unset the repo tool manifest property in CI as we don't use repo tools there anyway,
     until https://github.com/dotnet/sdk/issues/10938 is fixed. -->
     <_RepoToolManifest Condition="'$(ContinuousIntegrationBuild)' == 'true'" />
   </PropertyGroup>
 
-  <!-- We need to import this props file which contains PackageReferences to analyzers so that
-       analyzer build assets are imported via the Tools generated props and targets -->
-  <Import Project="$(RepositoryEngineeringDir)Analyzers.props" Condition="Exists('$(RepositoryEngineeringDir)Analyzers.props') and '$(DotNetBuildFromSource)' != 'true'" />
-
-  <!-- source-built packages -->
   <ItemGroup>
-    <!-- arcade -->
-    <PackageReference Include="Microsoft.DotNet.GenFacades" Version="$(MicrosoftDotNetGenFacadesVersion)" />
     <PackageReference Include="Microsoft.DotNet.Build.Tasks.Packaging" Version="$(MicrosoftDotNetBuildTasksPackagingVersion)" />
-
-    <!-- coreclr -->
-    <!-- Download the package in the initial arcade restore step to work around race conditions when restoring an msbuild SDK. -->
-    <PackageDownload Include="Microsoft.NET.Sdk.IL" Version="[$(MicrosoftNETSdkILVersion)]" />
-
-    <!-- roslyn -->
-    <PackageReference Include="Microsoft.Net.Compilers.Toolset" Version="$(MicrosoftNetCompilersToolsetVersion)" PrivateAssets="all" IsImplicitlyDefined="true" />
-
-    <!-- mono -->
-    <PackageReference Include="illink.tasks" Version="$(ILLinkTasksVersion)" PrivateAssets="all" IsImplicitlyDefined="true" ExcludeAssets="build" GeneratePathProperty="true" />
-  </ItemGroup>
-
-  <!-- excluded from offline portion of source build -->
-  <ItemGroup Condition="'$(DotNetBuildOffline)' != 'true'">
-    <!-- arcade -->
-    <PackageReference Include="Microsoft.DotNet.GenAPI" Version="$(MicrosoftDotNetGenApiVersion)" />
   </ItemGroup>
 
   <!-- excluded from source build -->
   <ItemGroup Condition="'$(DotNetBuildFromSource)' != 'true'">
-    <PackageReference Include="Microsoft.DotNet.ApiCompat" Version="$(MicrosoftDotNetApiCompatVersion)" />
     <PackageReference Include="Microsoft.DotNet.Build.Tasks.Feed" Version="$(MicrosoftDotNetBuildTasksFeedVersion)" />
     <PackageReference Include="Microsoft.DotNet.VersionTools.Tasks" Version="$(MicrosoftDotNetVersionToolsTasksVersion)" />
-
-    <!-- SourceLink -->
-    <PackageReference Include="Microsoft.SourceLink.GitHub" Version="$(MicrosoftSourceLinkVersion)" PrivateAssets="all" IsImplicitlyDefined="true" />
-    <PackageReference Include="Microsoft.SourceLink.AzureRepos.Git" Version="$(MicrosoftSourceLinkVersion)" PrivateAssets="all" IsImplicitlyDefined="true" />
   </ItemGroup>
 
-  <Import Project="$(RepositoryEngineeringDir)restore\docs.targets" Condition="'$(DotNetBuildFromSource)' != 'true'" />
-  <Import Project="$(RepositoryEngineeringDir)restore\optimizationData.targets" Condition="'$(DotNetBuildFromSource)' != 'true' and '$(EnableNgenOptimization)' == 'true'" />
 </Project>
index 6095aa5..72011a0 100644 (file)
       <Sha>0375524a91a47ca4db3ee1be548f74bab7e26e76</Sha>
     </Dependency>
     <Dependency Name="runtime.native.System.IO.Ports" Version="5.0.0-alpha.1.19563.3">
-      <Uri>https://github.com/dotnet/corefx</Uri>
+      <Uri>https://github.com/dotnet/runtime</Uri>
       <Sha>cf64918877d98577363bb40d5eafac52beb80a79</Sha>
     </Dependency>
     <Dependency Name="Microsoft.NETCore.ILAsm" Version="5.0.0-preview.4.20202.18">
index 2d0c300..6e1cc41 100644 (file)
     <UsingToolMicrosoftNetCompilers>true</UsingToolMicrosoftNetCompilers>
     <UsingToolIbcOptimization>true</UsingToolIbcOptimization>
     <UsingToolXliff>false</UsingToolXliff>
-    <!-- Paths used during restore -->
-    <EnableNgenOptimization Condition="'$(EnableNgenOptimization)' == '' and '$(Configuration)' == 'Release'">true</EnableNgenOptimization>
-    <IbcOptimizationDataDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsDir)', 'ibc'))</IbcOptimizationDataDir>
-    <XmlDocDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'docs'))</XmlDocDir>
+    <!-- Downgrade compiler version to fix nullability issues: https://github.com/dotnet/runtime/issues/34417. -->
+    <MicrosoftNetCompilersToolsetVersion>3.6.0-2.20166.2</MicrosoftNetCompilersToolsetVersion>
     <!-- Blob storage container that has the "Latest" channel to publish to. -->
     <ContainerName>dotnet</ContainerName>
     <ChecksumContainerName>$(ContainerName)</ChecksumContainerName>
@@ -61,6 +59,7 @@
     <!-- Arcade dependencies -->
     <MicrosoftDotNetApiCompatVersion>5.0.0-beta.20171.1</MicrosoftDotNetApiCompatVersion>
     <MicrosoftDotNetBuildTasksFeedVersion>5.0.0-beta.20171.1</MicrosoftDotNetBuildTasksFeedVersion>
+    <MicrosoftDotNetBuildTasksTargetFrameworkSdk>5.0.0-beta.20175.1</MicrosoftDotNetBuildTasksTargetFrameworkSdk>
     <MicrosoftDotNetCodeAnalysisVersion>5.0.0-beta.20171.1</MicrosoftDotNetCodeAnalysisVersion>
     <MicrosoftDotNetGenAPIVersion>5.0.0-beta.20171.1</MicrosoftDotNetGenAPIVersion>
     <MicrosoftDotNetGenFacadesVersion>5.0.0-beta.20171.1</MicrosoftDotNetGenFacadesVersion>
@@ -77,7 +76,7 @@
     <MicrosoftDotNetPlatformAbstractionsVersion>3.0.0</MicrosoftDotNetPlatformAbstractionsVersion>
     <!-- CoreClr dependencies -->
     <MicrosoftNETCoreILAsmVersion>5.0.0-preview.4.20202.18</MicrosoftNETCoreILAsmVersion>
-    <MicrosoftNETSdkILVersion>5.0.0-alpha.1.20076.2</MicrosoftNETSdkILVersion>
+    <MicrosoftNETSdkILVersion>5.0.0-preview.4.20202.18</MicrosoftNETSdkILVersion>
     <!-- Libraries dependencies -->
     <runtimenativeSystemIOPortsVersion>5.0.0-alpha.1.19563.3</runtimenativeSystemIOPortsVersion>
     <!-- Runtime-Assets dependencies -->
index 3e2f07a..17c61ae 100644 (file)
@@ -1,9 +1,7 @@
 [CmdletBinding(PositionalBinding=$false)]
 Param(
   [switch][Alias('h')]$help,
-  [switch][Alias('b')]$build,
   [switch][Alias('t')]$test,
-  [switch]$buildtests,
   [string[]][Alias('c')]$configuration = @("Debug"),
   [string][Alias('f')]$framework,
   [string]$vs,
@@ -11,10 +9,11 @@ Param(
   [switch]$allconfigurations,
   [switch]$coverage,
   [string]$testscope,
+  [switch]$testnobuild,
   [string[]][Alias('a')]$arch = @([System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture.ToString().ToLowerInvariant()),
   [string]$subsetCategory,
   [string]$subset,
-  [ValidateSet("Debug","Release","Checked")][string]$runtimeConfiguration = "Debug",
+  [ValidateSet("Debug","Release","Checked")][string]$runtimeConfiguration,
   [ValidateSet("Debug","Release")][string]$librariesConfiguration,
   [Parameter(ValueFromRemainingArguments=$true)][String[]]$properties
 )
@@ -37,7 +36,6 @@ function Get-Help() {
   Write-Host "Actions (defaults to -restore -build):"
   Write-Host "  -restore                Restore dependencies (short: -r)"
   Write-Host "  -build                  Build all source projects (short: -b)"
-  Write-Host "  -buildtests             Build all test projects"
   Write-Host "  -rebuild                Rebuild all source projects"
   Write-Host "  -test                   Build and run tests (short: -t)"
   Write-Host "  -pack                   Package build outputs into NuGet packages"
@@ -50,6 +48,7 @@ function Get-Help() {
   Write-Host "  -framework              Build framework: netcoreapp5.0 or net472 (short: -f)"
   Write-Host "  -coverage               Collect code coverage when testing"
   Write-Host "  -testscope              Scope tests, allowed values: innerloop, outerloop, all"
+  Write-Host "  -testnobuild            Skip building tests when invoking -test"
   Write-Host "  -allconfigurations      Build packages for all build configurations"
   Write-Host ""
 
@@ -102,8 +101,11 @@ if ($vs) {
   # Put our local dotnet.exe on PATH first so Visual Studio knows which one to use
   $env:PATH=($env:DOTNET_ROOT + ";" + $env:PATH);
 
-  # Respect the RuntimeConfiguration variable for building inside VS with different runtime configurations
-  $env:RUNTIMECONFIGURATION=$runtimeConfiguration
+  if ($runtimeConfiguration)
+  {
+    # Respect the RuntimeConfiguration variable for building inside VS with different runtime configurations
+    $env:RUNTIMECONFIGURATION=$runtimeConfiguration
+  }
 
   # Launch Visual Studio with the locally defined environment variables
   ."$vs"
@@ -112,7 +114,7 @@ if ($vs) {
 }
 
 # Check if an action is passed in
-$actions = "r","restore","b","build","buildtests","rebuild","t","test","pack","sign","publish","clean"
+$actions = "b","build","r","restore","rebuild","sign","testnobuild","publish","clean"
 $actionPassedIn = @(Compare-Object -ReferenceObject @($PSBoundParameters.Keys) -DifferenceObject $actions -ExcludeDifferent -IncludeEqual).Length -ne 0
 if ($null -ne $properties -and $actionPassedIn -ne $true) {
   $actionPassedIn = @(Compare-Object -ReferenceObject $properties -DifferenceObject $actions.ForEach({ "-" + $_ }) -ExcludeDifferent -IncludeEqual).Length -ne 0
@@ -122,17 +124,16 @@ if (!$actionPassedIn) {
   $arguments = "-restore -build"
 }
 
-$possibleDirToBuild = if($properties.Length -gt 0) { $properties[0]; } else { $null }
+$solutionLeaf = if($properties.Length -gt 0) { $properties[0]; } else { $null }
 
-if ($null -ne $possibleDirToBuild -and $subsetCategory -eq "libraries") {
-  $dtb = $possibleDirToBuild.TrimEnd('\')
-  if (Test-Path $dtb) {
-    $properties[0] = "/p:DirectoryToBuild=$(Resolve-Path $dtb)"
+if ($null -ne $solutionLeaf) {
+  if (Test-Path $solutionLeaf) {
+    $properties[0] = "-projects $(Resolve-Path $solutionLeaf)"
   }
   else {
-    $dtb = Join-Path "$PSSCriptRoot\..\src\libraries" $dtb
-    if (Test-Path $dtb) {
-      $properties[0] = "/p:DirectoryToBuild=$(Resolve-Path $dtb)"
+    $dtb = Join-Path "$PSSCriptRoot\..\src\libraries" $solutionLeaf | Join-Path -ChildPath "$solutionLeaf.sln"
+    if (Test-Path $dtb) { 
+      $properties[0] = "-projects $(Resolve-Path $dtb)"
     }
   }
 }
@@ -141,18 +142,16 @@ foreach ($argument in $PSBoundParameters.Keys)
 {
   switch($argument)
   {
-    "build"                { $arguments += " -build" }
-    "buildtests"           { if ($build -eq $true) { $arguments += " /p:BuildTests=true" } else { $arguments += " -build /p:BuildTests=only" } }
-    "test"                 { $arguments += " -test" }
-    "runtimeConfiguration" { $arguments += " /p:RuntimeConfiguration=$((Get-Culture).TextInfo.ToTitleCase($($PSBoundParameters[$argument])))" }
-    "framework"            { $arguments += " /p:BuildTargetFramework=$($PSBoundParameters[$argument].ToLowerInvariant())" }
-    "os"                   { $arguments += " /p:TargetOS=$($PSBoundParameters[$argument])" }
-    "allconfigurations"    { $arguments += " /p:BuildAllConfigurations=true" }
-    "properties"           { $arguments += " " + $properties }
+    "runtimeConfiguration"   { $arguments += " /p:RuntimeConfiguration=$((Get-Culture).TextInfo.ToTitleCase($($PSBoundParameters[$argument])))" }
+    "librariesConfiguration" { $arguments += " /p:LibrariesConfiguration=$((Get-Culture).TextInfo.ToTitleCase($($PSBoundParameters[$argument])))" }
+    "framework"              { $arguments += " /p:BuildTargetFramework=$($PSBoundParameters[$argument].ToLowerInvariant())" }
+    "os"                     { $arguments += " /p:TargetOS=$($PSBoundParameters[$argument])" }
+    "allconfigurations"      { $arguments += " /p:BuildAllConfigurations=true" }
+    "properties"             { $arguments += " " + $properties }
     # configuration and arch can be specified multiple times, so they should be no-ops here
-    "configuration"        {}
-    "arch"                 {}
-    default                { $arguments += " /p:$argument=$($PSBoundParameters[$argument])" }
+    "configuration"          {}
+    "arch"                   {}
+    default                  { $arguments += " /p:$argument=$($PSBoundParameters[$argument])" }
   }
 }
 
index 812b820..36970ae 100755 (executable)
@@ -33,7 +33,6 @@ usage()
   echo "Actions (defaults to --restore --build):"
   echo "  --restore                  Restore dependencies (short: -r)"
   echo "  --build                    Build all source projects (short: -b)"
-  echo "  --buildtests               Build all test projects"
   echo "  --rebuild                  Rebuild all source projects"
   echo "  --test                     Build and run tests (short: -t)"
   echo "  --pack                     Package build outputs into NuGet packages"
@@ -46,6 +45,7 @@ usage()
   echo "  --framework                Build framework: netcoreapp5.0 or net472 (short: -f)"
   echo "  --coverage                 Collect code coverage when testing"
   echo "  --testscope                Test scope, allowed values: innerloop, outerloop, all"
+  echo "  --testnobuild              Skip building tests when invoking -test"
   echo "  --allconfigurations        Build packages for all build configurations"
   echo ""
 
@@ -83,15 +83,14 @@ arguments=''
 cmakeargs=''
 extraargs=''
 build=false
-buildtests=false
 subsetCategory=''
-checkedPossibleDirectoryToBuild=false
+checkedSolutionBuild=false
 crossBuild=0
 
 source $scriptroot/native/init-os-and-arch.sh
 
 # Check if an action is passed in
-declare -a actions=("r" "restore" "b" "build" "buildtests" "rebuild" "t" "test" "pack" "sign" "publish" "clean")
+declare -a actions=("b" "build" "r" "restore" "rebuild" "testnobuild" "sign" "publish" "clean")
 actInt=($(comm -12 <(printf '%s\n' "${actions[@]/#/-}" | sort) <(printf '%s\n' "${@/#--/-}" | sort)))
 
 while [[ $# > 0 ]]; do
@@ -138,14 +137,14 @@ while [[ $# > 0 ]]; do
       arguments="$arguments -build"
       shift 1
       ;;
-     -buildtests)
-      buildtests=true
-      shift 1
-      ;;
      -testscope)
       arguments="$arguments /p:TestScope=$2"
       shift 2
       ;;
+     -testnobuild)
+      arguments="$arguments /p:TestNoBuild=$2"
+      shift 2
+      ;;
      -coverage)
       arguments="$arguments /p:Coverage=true"
       shift 1
@@ -179,13 +178,13 @@ while [[ $# > 0 ]]; do
       *)
       ea=$1
 
-      if [[ $checkedPossibleDirectoryToBuild == false ]] && [[ $subsetCategory == "libraries" ]]; then
-        checkedPossibleDirectoryToBuild=true
+      if [[ $checkedSolutionBuild == false ]]; then
+        checkedSolutionBuild=true
 
         if [[ -d "$1" ]]; then
-          ea="/p:DirectoryToBuild=$1"
-        elif [[ -d "$scriptroot/../src/libraries/$1" ]]; then
-          ea="/p:DirectoryToBuild=$scriptroot/../src/libraries/$1"
+          ea="-projects $1"
+        elif [[ -d "$scriptroot/../src/libraries/$1/$1.sln" ]]; then
+          ea="-projects $scriptroot/../src/libraries/$1/$1.sln"
         fi
       fi
 
@@ -195,14 +194,6 @@ while [[ $# > 0 ]]; do
   esac
 done
 
-if [[ "$buildtests" == true ]]; then
-  if [[ "$build" == true ]]; then
-    arguments="$arguments /p:BuildTests=true"
-  else
-    arguments="$arguments -build /p:BuildTests=only"
-  fi
-fi
-
 if [ ${#actInt[@]} -eq 0 ]; then
     arguments="-restore -build $arguments"
 fi
diff --git a/eng/codeAnalysis.targets b/eng/codeAnalysis.targets
deleted file mode 100644 (file)
index de4eb79..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-<Project>
-  <Import Condition="Exists($(AnalyzerPropsFile)) and '$(EnableAnalyzers)' == 'true'" Project="$(AnalyzerPropsFile)" />
-
-  <!-- This target is executed when building a project and EnableAnalyzers property is set to true. 
-  It will populate the Analyzer item that is passed to the compiler with the analyzers restored
-  as package references in Tools.props. Those analyzers will be saved in a props file -> artifacts\toolset\Common\Tools.Analyzers.props.
-  So in order to add a new analyzer just need to add a package reference in Tools.props to the package containing it.
-  *
-  This target also provides filtering for specific type of projects through to Items.
-  - <AnalyzersToInclude> will include only the specified analyzers and will ignore the others that where restored.
-  - <AnalyzersToExclude> will exclude the specified analyzers from the restored analyzers, but will preserve the others.
-  **The values in these Items are the name of the analyzers' dll.
-  **These to Items are mutually exclusive, so only 1 should be set at a time.
-  Example of usage:
-  <AnalyzersToInclude Condition="$(IsTestProject)" Include="Xunit.Analyzers" /> will only include Xunit analyzers.
-  <AnalyzersToExclude Condition="$(IsSourceProject)" Include="Xunit.Analyzers" /> will include all analyzers but Xunit analyzer. -->
-
-  <Target Name="CalculateAnalyzersForBuildTime">
-    <ItemGroup>
-      <Analyzer Include="@(ResolvedAnalyzer)" />
-    </ItemGroup>
-
-    <Warning Text="AnalyzersToExclude and AnalyzersToInclude shouldn't be set together, they are mutually exclusive." Condition="'@(AnalyzersToExclude)' != '' and '@(AnalyzersToInclude)' != ''" />
-
-    <ItemGroup Condition="'@(AnalyzersToExclude)' != '' or '@(AnalyzersToInclude)' != ''">
-      <_AnalyzersToFileName Include="@(Analyzer -> '%(FileName)')">
-        <OriginalIdentity>%(Identity)</OriginalIdentity>
-      </_AnalyzersToFileName>
-    </ItemGroup>
-
-    <ItemGroup Condition="'@(AnalyzersToExclude)' != ''">
-      <_AnalyzersToRemove Include="@(_AnalyzersToFileName)" Condition="'@(AnalyzersToExclude)' == '@(_AnalyzersToFileName)' and '%(Identity)' != ''" />
-      <Analyzer Remove="@(_AnalyzersToRemove -> '%(OriginalIdentity)')" />
-    </ItemGroup>
-
-    <ItemGroup Condition="'@(AnalyzersToInclude)' != ''">
-      <_AnalyzersToRemove Include="@(_AnalyzersToFileName)" Exclude="@(AnalyzersToInclude)" />
-      <_missingAnalyzersToInclude Include="@(AnalyzersToInclude)" Exclude="@(_AnalyzersToFileName)" />
-      <Analyzer Remove="@(_AnalyzersToRemove -> '%(OriginalIdentity)')" />
-    </ItemGroup>
-
-    <Error Text="Couldn't find analyzer to include with values: @(_missingAnalyzersToInclude)" Condition="'@(_missingAnalyzersToInclude)' != '' and '@(_missingAnalyzersToInclude)' != 'None'" />
-  </Target>
-
-  <PropertyGroup Condition="'$(EnableAnalyzers)' == 'true'">
-       <ResolveReferencesDependsOn>
-         $(ResolveReferencesDependsOn);
-         CalculateAnalyzersForBuildTime;
-       </ResolveReferencesDependsOn>
-  </PropertyGroup>
-</Project>
\ No newline at end of file
index a7c3094..c1669d6 100755 (executable)
@@ -19,8 +19,7 @@ if ($buildWindowsContainers)
   # Due to size concerns, we don't currently do docker builds on windows.
   # Build on the host machine, then simply copy artifacts to the target docker image.
   # This should result in significantly lower build times, for now.
-  & "$REPO_ROOT_DIR/coreclr.cmd" -c Release
-  & "$REPO_ROOT_DIR/libraries.cmd" -ci -c $configuration -runtimeConfiguration release
+  & "$REPO_ROOT_DIR/build.cmd" -ci -subsetcategory coreclr-libraries -runtimeconfiguration release -c $configuration
   
   # Dockerize the build artifacts
   if($privateAspNetCore)
index efba4fb..fce6381 100644 (file)
@@ -8,8 +8,7 @@ WORKDIR /repo
 COPY . .
 
 ARG CONFIGURATION=Release
-RUN ./src/coreclr/build.sh -release -skiptests -clang9 && \
-    ./libraries.sh -c $CONFIGURATION -runtimeconfiguration release
+RUN ./build.sh -ci -subsetcategory coreclr-libraries -runtimeconfiguration release -c $CONFIGURATION
 
 FROM $SDK_BASE_IMAGE as target
 
index d3525a1..cecc5c2 100644 (file)
@@ -7,6 +7,15 @@
     </TargetsTriggeredByCompilation>
   </PropertyGroup>
 
+  <ItemGroup>
+    <PackageReference Include="illink.tasks"
+                      Version="$(ILLinkTasksVersion)"
+                      PrivateAssets="all"
+                      IsImplicitlyDefined="true"
+                      ExcludeAssets="build"
+                      GeneratePathProperty="true" />
+  </ItemGroup>
+
   <!-- Inputs and outputs of ILLinkTrimAssembly -->
   <PropertyGroup>
     <ILLinkTasksDir>$([MSBuild]::NormalizeDirectory('$(PkgILLink_Tasks)', 'tools'))</ILLinkTasksDir>
index 1e7d8bd..eea246c 100644 (file)
@@ -1,5 +1,6 @@
 <Project>
   <PropertyGroup>
+    <PackageReportDir Condition="'$(PackageReportDir)' == ''">$([MSBuild]::NormalizeDirectory('$(ArtifactsPackagesDir)', 'reports'))</PackageReportDir>
     <PackageDescriptionFile>$(PkgDir)descriptions.json</PackageDescriptionFile>
     <PackageLicenseFile>$(RepoRoot)LICENSE.TXT</PackageLicenseFile>
     <PackageThirdPartyNoticesFile>$(RepoRoot)THIRD-PARTY-NOTICES.TXT</PackageThirdPartyNoticesFile>
index a1c9914..402b2ae 100644 (file)
@@ -59,15 +59,12 @@ jobs:
           - ${{ format('coreclr_corelib_build_{1}{2}_{3}_{4}', parameters.runtimeFlavor, 'linux', parameters.osSubgroup, 'x64', parameters.liveRuntimeBuildConfig) }}
 
       variables:
-        - _skipTestRestoreArg: /p:SkipTestRestore=true
-        - _buildAction: -build
+        - _addtionalBuildArguments: ''
         - ${{ parameters.variables }}
         - ${{ if eq(parameters.osGroup, 'WebAssembly') }}:
           - EMSDK_PATH: $(Build.BinariesDirectory)/emsdk
         - ${{ if eq(parameters.runTests, true) }}:
-          - _buildAction: -build -buildtests /p:ArchiveTests=true
-          - ${{ if ne(parameters.framework, 'allConfigurations') }}:
-            - _skipTestRestoreArg: /p:SkipTestRestore=false
+          - _addtionalBuildArguments: /p:IncludeLibrariesTestSubset=true /p:ArchiveTests=true
 
         - ${{ parameters.variables }}
 
@@ -95,13 +92,10 @@ jobs:
             parameters:
               installDotnet: true
 
-        - script: $(_buildScript) -restore $(_buildArguments) $(_skipTestRestoreArg) /bl:$(Build.SourcesDirectory)/artifacts/log/$(_BuildConfig)/Restore.binlog
-          displayName: Restore
-
         - script: $(_buildScript)
-                $(_buildAction)
                 $(_buildArguments)
-          displayName: Build
+                $(_addtionalBuildArguments)
+          displayName: Restore and Build Product
 
         - ${{ if eq(parameters.runTests, false) }}:
           - ${{ if ne(parameters.isOfficialBuild, true) }}:            
index 0a44ef8..b75fd1d 100644 (file)
@@ -43,7 +43,6 @@ jobs:
       variables:
         - librariesTestsArtifactName: ${{ format('libraries_test_assets_{0}_{1}_{2}', parameters.osGroup, parameters.archType, parameters.buildConfig) }}
         - _archiveTestsParameter: /p:ArchiveTests=true
-        - _skipTestRestoreArg: /p:SkipTestRestore=false
         
         - ${{ parameters.variables }}
 
@@ -55,15 +54,12 @@ jobs:
             artifactFileName: $(librariesBuildArtifactName)$(archiveExtension)
             unpackFolder: $(Build.SourcesDirectory)/artifacts
             cleanUnpackFolder: false
-        
-        - script: $(_buildScript) -restore $(_buildArguments) $(_skipTestRestoreArg)
-          displayName: Restore
 
         - script: $(_buildScript)
-                -buildtests
+                -subset pretest-libtests
                 $(_buildArguments)
                 $(_archiveTestsParameter)
-          displayName: Build
+          displayName: Restore and Build
 
         - template: /eng/pipelines/common/upload-artifact-step.yml
           parameters:
index 4cf1c7d..017ca39 100644 (file)
@@ -26,7 +26,7 @@ variables:
   - name: enterpriseTestsSetup
     value: $(sourcesRoot)/Common/tests/System/Net/EnterpriseTests/setup
   - name: containerRunTestsCommand
-    value: /repo/.dotnet/dotnet build /t:test --no-restore
+    value: /repo/.dotnet/dotnet build /t:test
   - name: containerLibrariesRoot
     value: /repo/src/libraries
 
@@ -50,7 +50,7 @@ steps:
   displayName: Test linuxclient connection to web server
 
 - bash: |
-    docker exec linuxclient bash -c '/repo/src/coreclr/build.sh -release -skipnuget -clang9 && /repo/libraries.sh /p:CoreCLRConfiguration=Release'
+    docker exec linuxclient bash -c '/repo/build.sh -subsetcategory coreclr-libraries -runtimeconfiguration release -ci'
   displayName: Build product sources
 
 - bash: |
index 6035ec9..951164f 100644 (file)
@@ -52,7 +52,6 @@ jobs:
       variables:
         - librariesTestsArtifactName: ${{ format('libraries_test_assets_{0}_{1}_{2}', parameters.osGroup, parameters.dependsOnTestArchitecture, parameters.dependsOnTestBuildConfiguration) }}
         - _archiveTestsParameter: /p:ArchiveTests=true
-        - _skipTestRestoreArg: /p:SkipTestRestore=false
         - ${{ parameters.variables }}
 
       steps:
@@ -73,24 +72,12 @@ jobs:
             artifactFileName: $(librariesTestsArtifactName)$(archiveExtension)
 
         - ${{ if ne(parameters.liveRuntimeBuildConfig, '') }}:
-          - script: $(_msbuildCommand) src/libraries/restore/runtime/runtime.depproj 
-                    $(_runtimeArtifactsPathArg)
-                    $(_runtimeOSArg)
+          - script: $(_buildScript)
+                    -subset pretest
+                    $(_buildArguments)
                     /p:RuntimeFlavor=${{ parameters.runtimeFlavor }}
-                    /p:TargetArchitecture=${{ parameters.archType }}
-                    /p:Configuration=${{ parameters.buildConfig }}
                     /bl:$(Build.SourcesDirectory)/artifacts/log/$(_BuildConfig)/overrideRuntimeFromLiveDrop.binlog
-            displayName: Override $(runtimeFlavorName) from live drop
-
-          - script: $(_buildScript) -projects $(Build.SourcesDirectory)/src/libraries/pretest.proj 
-                    $(_runtimeArtifactsPathArg)
-                    $(_runtimeOSArg)
-                    /p:RuntimeFlavor=${{ parameters.runtimeFlavor }}
-                    /p:TargetArchitecture=${{ parameters.archType }}
-                    /p:Configuration=${{ parameters.buildConfig }}
-                    /p:SkipBuildProjects=true
-                    /bl:$(Build.SourcesDirectory)/artifacts/log/$(_BuildConfig)/pretest.binlog
-            displayName: Build PreTest to Generate Deps Json File
+            displayName: Prepare TestHost with runtime $(runtimeFlavorName)
 
         - template: /eng/pipelines/libraries/helix.yml
           parameters:
index b5d9ce9..2437815 100644 (file)
@@ -1,7 +1,7 @@
 <Project>
 
   <ItemGroup>
-    <PackageReference Include="$(MicrosoftPrivateIntellisensePackage)" Version="$(MicrosoftPrivateIntellisenseVersion)" PrivateAssets="all" IsImplicitlyDefined="true" />
+    <PackageDownload Include="$(MicrosoftPrivateIntellisensePackage)" Version="[$(MicrosoftPrivateIntellisenseVersion)]" />
   </ItemGroup>
 
   <!-- the intellisense package doesn't use nuget conventions so we need to select manually -->
@@ -1,15 +1,12 @@
-<Project InitialTargets="AddPackageDownload" Sdk="Microsoft.NET.Sdk">
+<Project InitialTargets="AddPackageDownload">
   <PropertyGroup>
-    <TargetFrameworks>netstandard2.0</TargetFrameworks>
+    <PackagingTaskAssembly>$(NuGetPackageRoot)microsoft.dotnet.build.tasks.packaging\$(MicrosoftDotNetBuildTasksPackagingVersion)\tools\</PackagingTaskAssembly>
+    <PackagingTaskAssembly Condition="'$(MSBuildRuntimeType)' == 'core'">$(PackagingTaskAssembly)netcoreapp2.1\</PackagingTaskAssembly>
+    <PackagingTaskAssembly Condition="'$(MSBuildRuntimeType)' != 'core'">$(PackagingTaskAssembly)net472\</PackagingTaskAssembly>
+    <PackagingTaskAssembly>$(PackagingTaskAssembly)Microsoft.DotNet.Build.Tasks.Packaging.dll</PackagingTaskAssembly>
   </PropertyGroup>
 
-  <Import Project="$(PkgDir)baseline/baseline.props" />
-
-  <!-- only restore this project during the build, don't copy any of it's packages
-       The sole purpose of this project is to download packages that can be examined
-       for harvesting binaries & support. -->
-  <Target Name="Build" DependsOnTargets="RestorePackages" />
-
+  <UsingTask TaskName="GetLastStablePackage" AssemblyFile="$(PackagingTaskAssembly)"/>
   <Target Name="AddPackageDownload">
     <ItemGroup>
       <_AllPkgProjs Include="$(LibrariesProjectRoot)*\pkg\**\*.pkgproj" />
     </ItemGroup>
 
     <GetLastStablePackage
-        LatestPackages="@(_AllPkgProjsToPackageIdentity)"
-        PackageIndexes="$(PackageIndexFile)"
-        DoNotAllowVersionsFromSameRelease="true">
-        <Output TaskParameter="LastStablePackages" ItemName="_PackageDownload" />
+      LatestPackages="@(_AllPkgProjsToPackageIdentity)"
+      PackageIndexes="$(PackageIndexFile)"
+      DoNotAllowVersionsFromSameRelease="true">
+      <Output TaskParameter="LastStablePackages" ItemName="_PackageDownload" />
     </GetLastStablePackage>
 
     <!-- Allow to override package download and versions in case there is already a PackageDownload set -->
@@ -40,5 +37,4 @@
       </PackageDownload>
     </ItemGroup>
   </Target>
-
 </Project>
\ No newline at end of file
index 47c81d6..a4bbe96 100644 (file)
@@ -1,11 +1,11 @@
 ï»¿<Project>
 
   <ItemGroup>
-    <IBCPackage Include="$(WindowsCoreFxOptimizationDataPackage)" Version="$(optimizationwindows_ntx64IBCCoreFxVersion)" />
-    <IBCPackage Include="$(LinuxCoreFxOptimizationDataPackage)" Version="$(optimizationlinuxx64IBCCoreFxVersion)" />
-    <IBCPackage Include="$(WindowsOptimizationIBCCoreCLRPackage)" Version="$(optimizationwindows_ntx64IBCCoreCLRVersion)" />
-    <IBCPackage Include="$(LinuxOptimizationIBCCoreCLRPackage)" Version="$(optimizationlinuxx64IBCCoreCLRVersion)" />
-    <PackageReference Include="@(IBCPackage)" PrivateAssets="all" IsImplicitlyDefined="true" />
+    <IBCPackage Include="$(WindowsCoreFxOptimizationDataPackage)" Version="[$(optimizationwindows_ntx64IBCCoreFxVersion)]" />
+    <IBCPackage Include="$(LinuxCoreFxOptimizationDataPackage)" Version="[$(optimizationlinuxx64IBCCoreFxVersion)]" />
+    <IBCPackage Include="$(WindowsOptimizationIBCCoreCLRPackage)" Version="[$(optimizationwindows_ntx64IBCCoreCLRVersion)]" />
+    <IBCPackage Include="$(LinuxOptimizationIBCCoreCLRPackage)" Version="[$(optimizationlinuxx64IBCCoreCLRVersion)]" />
+    <PackageDownload Include="@(IBCPackage)" />
   </ItemGroup>
 
   <!-- IBC data packages don't follow NuGet conventions.  -->
@@ -24,6 +24,7 @@
       </IBCPackage>
       <_optimizationDataSourceFile Include="%(IBCPackage.PackagePath)\**\*.dll;%(IBCPackage.PackagePath)\**\*.ibc" SubdirectoryName="%(IBCPackage.SubdirectoryName)" />
     </ItemGroup>
+
     <Copy SourceFiles="@(_optimizationDataSourceFile)"
           DestinationFiles="@(_optimizationDataSourceFile->'$(IbcOptimizationDataDir)%(SubdirectoryName)\%(RecursiveDir)%(Filename)%(Extension)')"
           SkipUnchangedFiles="true"
index 204c23d..300c542 100644 (file)
@@ -1,6 +1,6 @@
 <Project TreatAsLocalProperty="ExcludeRestorePackageImports">
-
   <PropertyGroup>
+    <RestoreUseStaticGraphEvaluation>false</RestoreUseStaticGraphEvaluation>
     <!-- Need to set ProjectAssetsFile to something so it doesn't get set to the Tools.proj assets file when we import the generated props -->
     <ProjectAssetsFile Condition="'$(ProjectAssetsFile)' == ''">unused</ProjectAssetsFile>
     <!-- Nuget will normally disable all generated imports as part of a restore to avoid 
     <ProjectAssetsFile Condition="'$(ProjectAssetsFile)' == 'unused'" />
     <ExcludeRestorePackageImports>$(_excludeRestorePackageImports)</ExcludeRestorePackageImports>
   </PropertyGroup>
-
-  <!-- Enable the repo-restored analyzers -->
-  <PropertyGroup>
-    <AnalyzerPropsFile>$(ToolSetCommonDirectory)Tools.Analyzers.props</AnalyzerPropsFile>
-    <EnableAnalyzers Condition="'$(EnableAnalyzers)' == '' and '$(IsSourceProject)' == 'true'">true</EnableAnalyzers>
-  </PropertyGroup>
   
   <PropertyGroup>
     <!-- Disable code paths that require project.assets.json files to be present or to be computed. -->
@@ -28,4 +22,4 @@
     <ComputeNETCoreBuildOutputFiles>false</ComputeNETCoreBuildOutputFiles>
     <GenerateRuntimeConfigurationFiles>false</GenerateRuntimeConfigurationFiles>
   </PropertyGroup>
-</Project>
\ No newline at end of file
+</Project>
index d99f198..a430b67 100644 (file)
@@ -4,8 +4,6 @@
     <RestoreProjectStyle Condition="'$(MSBuildProjectExtension)' != '.depproj'">Unknown</RestoreProjectStyle>
   </PropertyGroup>
 
-  <Import Project="$(RepositoryEngineeringDir)codeAnalysis.targets" />
-
   <PropertyGroup>
     <!-- Nuget will normally disable all generated imports as part of a restore to avoid 
          non-determinism where first restore changes a subsequent restore,
diff --git a/eng/restore/runtimeprops.targets b/eng/restore/runtimeprops.targets
new file mode 100644 (file)
index 0000000..945d083
--- /dev/null
@@ -0,0 +1,7 @@
+<Project Sdk="Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk">
+
+  <Target Name="GenerateRuntimeOSPropsFileBeforeRestore"
+          DependsOnTargets="GenerateRuntimeOSPropsFile"
+          BeforeTargets="Restore" />
+
+</Project>
\ No newline at end of file
index c2d9059..3638e3e 100644 (file)
@@ -14,7 +14,7 @@
   </PropertyGroup>
 
   <!-- Skip generating individual reports if a full report is generated. -->
-  <ItemGroup Condition="'$(TestAllProjects)' != 'true' and '$(SkipCoverageReport)' != 'true'">
+  <ItemGroup Condition="'$(BuildAllProjects)' != 'true' and '$(SkipCoverageReport)' != 'true'">
     <PostRunScriptCommands Include="$(CoverageReportCommandLine)" />
   </ItemGroup>
 
index eaca9c6..dfaabfa 100644 (file)
@@ -2,8 +2,8 @@
   <PropertyGroup>
     <TestProjectName Condition="'$(TestProjectName)' == ''">$(MSBuildProjectName)</TestProjectName>
     <TestFramework Condition="'$(TestFramework)' == ''">xunit</TestFramework>
-    <!-- Implicit test build support. -->
-    <TestDependsOn Condition="'$(TestNoBuild)' != 'true'">Build</TestDependsOn>
+    <!-- Implicit test build support when invoking the Test target on the project directly. -->
+    <TestDependsOn Condition="'$(TestNoBuild)' != 'true' and '$(BuildAllProjects)' != 'true'">Build</TestDependsOn>
     <TestDependsOn>$(TestDependsOn);GenerateRunScript;RunTests</TestDependsOn>
   </PropertyGroup>
 
index a17cc45..76b4cde 100644 (file)
@@ -1,24 +1,24 @@
 {
   "sdk": {
-    "version": "3.1.101",
+    "version": "5.0.100-preview.2.20176.6",
     "allowPrerelease": true,
     "rollForward": "major"
   },
   "tools": {
-    "dotnet": "5.0.100-preview.3.20170.6"
+    "dotnet": "5.0.100-preview.4.20202.8"
   },
   "native-tools": {
     "cmake": "3.14.2",
     "python3": "3.7.1"
   },
   "msbuild-sdks": {
-    "Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk": "5.0.0-beta.20171.1",
-    "Microsoft.DotNet.Arcade.Sdk": "5.0.0-beta.20171.1",
+    "Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk": "5.0.0-beta.20175.1",
+    "Microsoft.DotNet.Arcade.Sdk": "5.0.0-beta.20175.1",
     "Microsoft.DotNet.Build.Tasks.SharedFramework.Sdk": "5.0.0-beta.20171.1",
     "Microsoft.DotNet.Helix.Sdk": "5.0.0-beta.20171.1",
     "FIX-85B6-MERGE-9C38-CONFLICT": "1.0.0",
     "Microsoft.NET.Sdk.IL": "5.0.0-preview.4.20202.18",
     "Microsoft.Build.NoTargets": "1.0.53",
-    "Microsoft.Build.Traversal": "2.0.2"
+    "Microsoft.Build.Traversal": "2.0.34"
   }
 }
index 1975761..a4955fb 100644 (file)
@@ -779,7 +779,7 @@ if %__BuildPackages% EQU 1 (
     REM The conditions as to what to build are captured in the builds file.
     REM Package build uses the Arcade system and scripts, relying on it to restore required toolsets as part of build
     powershell -NoProfile -ExecutionPolicy ByPass -NoLogo -File "%__RepoRootDir%\eng\common\build.ps1"^
-        -r -b -projects %__SourceDir%\.nuget\packages.builds^
+        -r -b -projects %__SourceDir%\.nuget\coreclr-packages.proj^
         -verbosity minimal /clp:nosummary /nodeReuse:false /bl:!__BuildLog!^
         /p:PortableBuild=true^
         /p:Platform=%__BuildArch% %__CommonMSBuildArgs% %__UnprocessedBuildArgs%
index edfe44a..634bcb7 100755 (executable)
@@ -299,7 +299,7 @@ generate_NugetPackages()
     echo "ROOTFS_DIR is $ROOTFS_DIR"
     # Build the packages
     # Package build uses the Arcade system and scripts, relying on it to restore required toolsets as part of build
-    "$__RepoRootDir"/eng/common/build.sh -r -b -projects "$__SourceDir"/.nuget/packages.builds \
+    "$__RepoRootDir"/eng/common/build.sh -r -b -projects "$__SourceDir"/.nuget/coreclr-packages.proj \
                                        -verbosity minimal -bl:"$__LogsDir/Nuget_$__TargetOS__$__BuildArch__$__BuildType.binlog" \
                                        /p:PortableBuild=true \
                                        /p:"__IntermediatesDir=$__IntermediatesDir" /p:"__RootBinDir=$__RootBinDir" /p:"__DoCrossArchBuild=$__CrossBuild" \
similarity index 80%
rename from src/coreclr/src/.nuget/packages.builds
rename to src/coreclr/src/.nuget/coreclr-packages.proj
index 7fcc996..ad5700b 100644 (file)
@@ -1,12 +1,14 @@
-<Project Sdk="Microsoft.Build.Traversal">
+<Project>
+  <Import Sdk="Microsoft.Build.Traversal" Project="Sdk.props" />
+
   <ItemGroup Condition="'$(TargetsWindows)'=='true' OR '$(DotNetBuildFromSource)'=='true'">
     <ProjectReference Include="Microsoft.NET.Sdk.IL\Microsoft.NET.Sdk.IL.pkgproj" />
   </ItemGroup>
 
   <ItemGroup>
-    <ProjectReference Include="Microsoft.NETCore.TestHost\Microsoft.NETCore.TestHost.builds" />
-    <ProjectReference Include="Microsoft.NETCore.ILAsm\Microsoft.NETCore.ILAsm.builds" />
-    <ProjectReference Include="Microsoft.NETCore.ILDAsm\Microsoft.NETCore.ILDAsm.builds" />
+    <ProjectReference Include="Microsoft.NETCore.TestHost\Microsoft.NETCore.TestHost.proj" />
+    <ProjectReference Include="Microsoft.NETCore.ILAsm\Microsoft.NETCore.ILAsm.proj" />
+    <ProjectReference Include="Microsoft.NETCore.ILDAsm\Microsoft.NETCore.ILDAsm.proj" />
   </ItemGroup>
 
   <!-- Generate a version.txt file we include in our packages
     <ItemGroup>
       <!-- Pass the FileVersion calculated by _InitializeAssemblyVersion to referenced projects -->
       <ProjectReference Update="@(ProjectReference)"
-                        AdditionalProperties="%(AdditionalProperties);FileVersion=$(FileVersion)" />
+                        AdditionalProperties="%(ProjectReference.AdditionalProperties);FileVersion=$(FileVersion)" />
     </ItemGroup>
   </Target>
+
+  <Import Sdk="Microsoft.Build.Traversal" Project="Sdk.targets" />
+
+  <!-- Ordering matters! Overwriting the Pack target which should just invoke Build. -->
+  <Target Name="Pack" DependsOnTargets="Build" />
 </Project>
index c8a6bff..e1d9a09 100644 (file)
     <Service Include="{508349b6-6b84-4df5-91f0-309beebad82d}" />
   </ItemGroup>
 
-  <!-- Setup ILLink.targets -->
-  <ItemGroup>
-    <PackageReference Include="ILLink.Tasks" Version="$(ILLinkTasksVersion)" ExcludeAssets="build" GeneratePathProperty="True" />
-  </ItemGroup>
-
   <Import Project="CreateRuntimeRootILLinkDescriptorFile.targets" />
 
   <Target Name="CreateRuntimeRootIlLinkDescFile" BeforeTargets="CoreCompile" DependsOnTargets="_CreateILLinkRuntimeRootDescriptorFile"/>
index 6e77e95..9f44424 100644 (file)
@@ -7,6 +7,11 @@
   </PropertyGroup>
 
   <PropertyGroup>
+    <!-- Disable NuGet static graph evaluation as pkgprojs do their own restore.  -->
+    <RestoreUseStaticGraphEvaluation>false</RestoreUseStaticGraphEvaluation>
+  </PropertyGroup>
+
+  <PropertyGroup>
     <PackageLicenseFile>$(RepoRoot)LICENSE.TXT</PackageLicenseFile>
     <PackageThirdPartyNoticesFile>$(RepoRoot)THIRD-PARTY-NOTICES.TXT</PackageThirdPartyNoticesFile>
     <PackageLicenseExpression>MIT</PackageLicenseExpression>
index ed3d50f..29abbe0 100644 (file)
 
   <Target Name="GenerateProjectInstallers" Condition="'$(GenerateProjectInstallers)' == 'true'">
     <ItemGroup>
-      <InstallerProject Include="$(InstallerProjectRoot)pkg\projects\**\*.pkgproj" />
-      <InstallerProject Include="$(InstallerProjectRoot)pkg\projects\**\*.sfxproj" />
+      <_InstallerProject Include="$(InstallerProjectRoot)pkg\projects\**\*.pkgproj" />
+      <_InstallerProject Include="$(InstallerProjectRoot)pkg\projects\**\*.sfxproj" />
     </ItemGroup>
 
-    <MSBuild Projects="@(InstallerProject)" Targets="GenerateInstallers" />
+    <MSBuild Projects="@(_InstallerProject)" Targets="GenerateInstallers" />
   </Target>
 
   <Target Name="InitPackage">
index d62f9f5..40403c6 100644 (file)
@@ -64,7 +64,7 @@
       Include="$(SigningToolsDir)\SignR2RBinaries.proj" />
   </ItemGroup>
 
-  <!-- In *.builds projects, the current phase's name is the same as the project name. -->
+  <!-- In *.proj projects, the current phase's name is the same as the project name. -->
   <PropertyGroup>
     <BuildPhase>$(MSBuildProjectName)</BuildPhase>
   </PropertyGroup>
index e808f91..c190217 100644 (file)
@@ -16,8 +16,7 @@
     <IsSourceProject>$([System.Text.RegularExpressions.Regex]::IsMatch($(MSBuildProjectDirectory), 'src%24'))</IsSourceProject>
     <IsReferenceAssembly Condition="'$(IsReferenceAssembly)' == '' and ($(MSBuildProjectFullPath.Contains('\ref\')) or $(MSBuildProjectFullPath.Contains('/ref/')))">true</IsReferenceAssembly> 
     <LanguageTargets Condition="'$(MSBuildProjectExtension)' == '.depproj'">$(RepositoryEngineeringDir)depProj.common.targets</LanguageTargets>
-    <RuntimePropsFile>$([MSBuild]::NormalizePath('$(ArtifactsDir)', 'tmp', '$(Configuration)', 'RuntimeOS.props'))</RuntimePropsFile>
-    <RuntimeGraph>$(LibrariesProjectRoot)\OSGroups.json</RuntimeGraph>
+    <RuntimeGraph>$(LibrariesProjectRoot)OSGroups.json</RuntimeGraph>
     <BuildTargetFramework>netcoreapp5.0</BuildTargetFramework>
     <ShouldUnsetParentConfigurationAndPlatform>false</ShouldUnsetParentConfigurationAndPlatform>
     <!-- TargetOS can be removed after renaming the property in arcade repo-->
@@ -29,7 +28,6 @@
 
   <Import Project="$(RuntimePropsFile)" Condition="Exists('$(RuntimePropsFile)')"/>
 
-
   <Import Sdk="Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk" Project="Sdk.props" />
   
   <PropertyGroup>
     <IsShipping Condition="'$(IsTestProject)' == 'true'">false</IsShipping>
   </PropertyGroup>
 
-  <PropertyGroup>
-    <EnableProjectRestore Condition="'$(IsTestProject)' == 'true'">true</EnableProjectRestore>
-  </PropertyGroup>
-
-  <Import Condition="'$(EnableProjectRestore)' != 'true'" Project="$(RepositoryEngineeringDir)restore\repoRestore.props" />
-
   <!-- Common repo directories -->
   <PropertyGroup>
     <!-- Need to try and keep the same logic as the native builds as we need this for packaging -->
-    <NativeBinDir>$([MSBuild]::NormalizePath('$(ArtifactsBinDir)', 'native', '$(BuildTargetFramework)-$(TargetOS)-$(Configuration)-$(TargetArchitecture)'))</NativeBinDir>
-
+    <NativeBinDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'native', '$(BuildTargetFramework)-$(TargetOS)-$(Configuration)-$(TargetArchitecture)'))</NativeBinDir>
     <PkgDir>$([MSBuild]::NormalizeDirectory('$(LibrariesProjectRoot)', 'pkg'))</PkgDir>
   </PropertyGroup>
 
     <ApiCompatExcludeAttributeList>$(RepositoryEngineeringDir)DefaultGenApiDocIds.txt,$(RepositoryEngineeringDir)ApiCompatExcludeAttributes.txt</ApiCompatExcludeAttributeList>
   </PropertyGroup>
 
+  <ItemGroup>
+    <!-- Projects which are manually built. -->
+    <ProjectExclusions Include="$(CommonTestPath)System\Net\Prerequisites\**\*.csproj" />
+    <!-- TODO: Reenable when mono supports utf8string. -->
+    <ProjectExclusions Include="$(MSBuildThisFileDirectory)\System.Utf8String.Experimental\**\*.csproj" Condition="'$(RuntimeFlavor)' == 'Mono'" />
+  </ItemGroup>
+
   <PropertyGroup>
     <_runtimeOSVersionIndex>$(RuntimeOS.IndexOfAny(".-0123456789"))</_runtimeOSVersionIndex>
     <_runtimeOSFamily Condition="'$(_runtimeOSVersionIndex)' != '-1'">$(RuntimeOS.SubString(0, $(_runtimeOSVersionIndex)))</_runtimeOSFamily>
 
     <!-- There are no iOS tools and it can be built on OSX only, so use that -->
     <ToolRuntimeRID Condition="'$(RuntimeOS)' == 'ios'">osx-x64</ToolRuntimeRID>
+    <MicrosoftNetCoreIlasmPackageRuntimeId>$(ToolRuntimeRID)</MicrosoftNetCoreIlasmPackageRuntimeId>
 
     <!-- support cross-targeting by choosing a RID to restore when running on a different machine that what we're build for -->
     <_portableOS Condition="'$(TargetOS)' == 'Unix' and '$(_runtimeOSFamily)' != 'osx' and '$(_runtimeOSFamily)' != 'FreeBSD' and '$(_runtimeOS)' != 'linux-musl'">linux</_portableOS>
     <Features>strict;nullablePublicOnly</Features>
     <WarningLevel>4</WarningLevel>
     <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
-    <!-- We decided to keep this disabled by default to see some history of way have a look at https://github.com/dotnet/corefx/issues/3140 -->
+    <!-- We decided to keep this disabled by default: https://github.com/dotnet/runtime/issues/15152 -->
     <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
     <GenFacadesIgnoreBuildAndRevisionMismatch>true</GenFacadesIgnoreBuildAndRevisionMismatch>
-    <EnableAnalyzers Condition="'$(EnableProjectRestore)' == 'true' and '$(IsSourceProject)' == 'true' and '$(MSBuildProjectExtension)' != '.ilproj'">true</EnableAnalyzers>
+    <EnableAnalyzers Condition="'$(EnableAnalyzers)' == '' and '$(IsSourceProject)' == 'true' and '$(MSBuildProjectExtension)' != '.ilproj'">true</EnableAnalyzers>
   </PropertyGroup>
 
   <!-- Set up some common paths -->
     <NetStandard20RefPath>$([MSBuild]::NormalizeDirectory('$(RefRootPath)', 'netstandard2.0'))</NetStandard20RefPath>
     <NetStandard21RefPath>$([MSBuild]::NormalizeDirectory('$(RefRootPath)', 'netstandard2.1'))</NetStandard21RefPath>
     <NetFxRefPath>$([MSBuild]::NormalizeDirectory('$(RefRootPath)', '$(NetFrameworkCurrent)'))</NetFxRefPath>
-    <ILAsmToolPath>$([MSBuild]::NormalizeDirectory('$(ArtifactsToolsetDir)', 'ilasm'))</ILAsmToolPath>
 
     <!-- Helix properties -->
     <OSPlatformConfig>$(TargetOS).$(Platform).$(Configuration)</OSPlatformConfig>
   <Import Project="$(RepositoryEngineeringDir)referenceAssemblies.props" Condition="'$(IsReferenceAssembly)' == 'true'" />
 
   <PropertyGroup>
+    <DisableProjectRestore Condition="'$(MSBuildProjectExtension)' == '.depproj' or '$(MSBuildProjectExtension)' == '.pkgproj'">true</DisableProjectRestore>
+  </PropertyGroup>
+
+  <Import Project="$(RepositoryEngineeringDir)restore\repoRestore.props" Condition="'$(DisableProjectRestore)' == 'true'" />
+
+  <PropertyGroup>
     <EnableDefaultItems>false</EnableDefaultItems>
 
     <!-- Workaround for https://github.com/microsoft/msbuild/issues/4474 -->
   <PropertyGroup Condition="'$(IsTestProject)' == 'true' and '$(IsTestSupportProject)' != 'true'">
     <EnableTestSupport>true</EnableTestSupport>
     <EnableCoverageSupport Condition="'$(Coverage)' == 'true' and '$(CoverageSupported)' != 'false'">true</EnableCoverageSupport>
-    <EnableLaunchSettings Condition="'$(DotNetBuildFromSource)' != 'true'">true</EnableLaunchSettings>
+    <EnableLaunchSettings Condition="'$(DotNetBuildFromSource)' != 'true' and '$(BuildAllConfigurations)' != 'true'">true</EnableLaunchSettings>
   </PropertyGroup>
 
   <Import Project="$(RepositoryEngineeringDir)testing\tests.props" Condition="'$(EnableTestSupport)' == 'true'" />
index 02fd8c7..896ee32 100644 (file)
   <Import Project="$(RepositoryEngineeringDir)testing\coverage.targets" Condition="'$(EnableCoverageSupport)' == 'true'" />
 
   <Import Sdk="Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk" Project="Sdk.targets" />
-  <Import Condition="'$(EnableProjectRestore)' != 'true'" Project="$(RepositoryEngineeringDir)restore\repoRestore.targets" />
-
+  <Import Project="$(RepositoryEngineeringDir)restore\repoRestore.targets" Condition="'$(DisableProjectRestore)' == 'true'" />
   <Import Project="$(RepositoryEngineeringDir)referenceFromRuntime.targets" />
-  <Import Project="$(RepositoryEngineeringDir)illink.targets" />
+  <Import Project="$(RepositoryEngineeringDir)illink.targets" Condition="'$(IsSourceProject)' == 'true'" />
   <Import Project="$(RepositoryEngineeringDir)notSupported.SourceBuild.targets" Condition="'$(DotNetBuildFromSource)' == 'true'" />
 
+  <ItemGroup Condition="'$(IsSourceProject)' == 'true' or '$(IsReferenceAssembly)' == 'true' or '$(IsPartialFacadeAssembly)' == 'true'">
+    <PackageReference Include="Microsoft.DotNet.Build.Tasks.Packaging" Version="$(MicrosoftDotNetBuildTasksPackagingVersion)" PrivateAssets="all" IsImplicitlyDefined="true" />
+    <PackageReference Include="Microsoft.DotNet.ApiCompat" Condition="'$(DotNetBuildFromSource)' != 'true'" Version="$(MicrosoftDotNetApiCompatVersion)" PrivateAssets="all" IsImplicitlyDefined="true" />
+    <PackageReference Include="Microsoft.DotNet.GenAPI" Condition="'$(DotNetBuildOffline)' != 'true'" Version="$(MicrosoftDotNetGenApiVersion)" PrivateAssets="all" IsImplicitlyDefined="true" />
+    <PackageReference Include="Microsoft.DotNet.GenFacades" Version="$(MicrosoftDotNetGenFacadesVersion)" PrivateAssets="all" IsImplicitlyDefined="true" />
+  </ItemGroup>
+
   <Target Name="GenerateReferenceSource">
     <PropertyGroup>
       <_RefSourceFileOutputPath>$([MSBuild]::NormalizePath('$(MSBuildProjectDirectory)', '..', 'ref', '$(AssemblyName).cs'))</_RefSourceFileOutputPath>
index b5c7dd0..6f5aa31 100644 (file)
@@ -7,7 +7,7 @@
 
   <ItemGroup>
     <ReferenceFromRuntime Include="Microsoft.Extensions.Configuration.UserSecrets" />
-    <Reference Include="Newtonsoft.Json" Condition="'$(TargetFramework)' == 'net472'"/>
+    <PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonVersion)" />
   </ItemGroup>
 
   <ItemGroup>
index 064b1a4..2ce3453 100644 (file)
   <ItemGroup>
     <ReferenceFromRuntime Include="Microsoft.Extensions.DependencyInjection" />
     <ReferenceFromRuntime Include="Microsoft.Extensions.DependencyInjection.Abstractions" Aliases="DIAbstractions" />
-    <None Update="xunit.runner.json" CopyToOutputDirectory="PreserveNewest" />
+  </ItemGroup>
+
+  <ItemGroup>
+    <PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonVersion)" />
   </ItemGroup>
 
 </Project>
diff --git a/src/libraries/Microsoft.Extensions.DependencyInjection/tests/xunit.runner.json b/src/libraries/Microsoft.Extensions.DependencyInjection/tests/xunit.runner.json
deleted file mode 100644 (file)
index eff47a2..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-{\r
-  "methodDisplay": "method",\r
-  "appDomain": "denied"\r
-}\r
index e7463cc..d5c329e 100644 (file)
@@ -3,6 +3,7 @@
   <PropertyGroup>
     <TargetFrameworks>$(NetCoreAppCurrent);$(NetFrameworkCurrent)</TargetFrameworks>
     <EnableDefaultItems>true</EnableDefaultItems>
+    <!-- Needed for .NET Framework. -->
     <GenerateDependencyFile>true</GenerateDependencyFile>
   </PropertyGroup>
 
@@ -13,6 +14,8 @@
     <PackageReference Include="FluentAssertions" Version="4.19.4" />
     <PackageReference Include="Moq" Version="$(MoqVersion)" />
     <PackageReference Include="Microsoft.DotNet.ProjectModel" Version="1.0.0-rc2-002702" />
+    <!-- Upgrade the transitive dependency's version to avoid PackageTargetFallback on .NETCoreApp. -->
+    <PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonVersion)" />
   </ItemGroup>
 
 </Project>
index 436ecca..e877434 100644 (file)
@@ -18,6 +18,8 @@
     <RootNamespace />
     <!-- Disable this as it seems to break windows builds for now. -->
     <DocumentationFile />
+    <!-- No plans to fix the analyzer issues. -->
+    <EnableAnalyzers>false</EnableAnalyzers>
     <TargetFrameworks>$(NetCoreAppCurrent);$(NetCoreAppCurrent)-Windows_NT</TargetFrameworks>
   </PropertyGroup>
   <ItemGroup Condition="'$(TargetsWindows)' == 'true'">
index 99e71eb..2631ea7 100644 (file)
@@ -1,29 +1,29 @@
-<Project DefaultTargets="Build">
-
-  <Import Project="..\Directory.Build.props" />
-  <Target Name="Build" DependsOnTargets="BinPlace" />
-  <Target Name="Clean" />
-  <Target Name="Rebuild" DependsOnTargets="Clean;Build" />
-
-  <Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.targets))" />
+<Project>
+  <Import Sdk="Microsoft.NET.Sdk" Project="Sdk.props" />
 
   <PropertyGroup>
     <TargetFrameworks>$(NetCoreAppCurrent);netstandard2.0;$(NetFrameworkCurrent)</TargetFrameworks>
     <TargetFramework>$(BuildTargetFramework)</TargetFramework>
   </PropertyGroup>
 
+  <Import Sdk="Microsoft.NET.Sdk" Project="Sdk.targets" />
+
+  <!-- Ordering matters! Overriding GetBinPlaceItems and Build targets after the Sdk import. -->
   <Target Name="GetBinPlaceItems">
     <ItemGroup>
-      <BinPlaceItem Include="$(NativeBinDir)/*.dll" />
-      <BinPlaceItem Include="$(NativeBinDir)/*.pdb" />
-      <BinPlaceItem Include="$(NativeBinDir)/*.lib" />
-      <BinPlaceItem Include="$(NativeBinDir)/*.a" />
-      <BinPlaceItem Include="$(NativeBinDir)/*.bc" />
-      <BinPlaceItem Include="$(NativeBinDir)/*.so" />
-      <BinPlaceItem Include="$(NativeBinDir)/*.dbg" />
-      <BinPlaceItem Include="$(NativeBinDir)/*.dylib" />
-      <BinPlaceItem Include="$(NativeBinDir)/*.dwarf" />
+      <BinPlaceItem Include="$(NativeBinDir)*.dll" />
+      <BinPlaceItem Include="$(NativeBinDir)*.pdb" />
+      <BinPlaceItem Include="$(NativeBinDir)*.lib" />
+      <BinPlaceItem Include="$(NativeBinDir)*.a" />
+      <BinPlaceItem Include="$(NativeBinDir)*.bc" />
+      <BinPlaceItem Include="$(NativeBinDir)*.so" />
+      <BinPlaceItem Include="$(NativeBinDir)*.dbg" />
+      <BinPlaceItem Include="$(NativeBinDir)*.dylib" />
+      <BinPlaceItem Include="$(NativeBinDir)*.dwarf" />
       <FileWrites Include="@(BinPlaceItem)" />
     </ItemGroup>
   </Target>
+
+  <Target Name="Build" DependsOnTargets="BinPlace" />
+  <Target Name="CreateManifestResourceNames" />
 </Project>
\ No newline at end of file
index fc0e6b2..d9aba2e 100644 (file)
@@ -1,4 +1,5 @@
 kernel32.dll!CreateFile
+kernel32.dll!FormatMessage
 advapi32.dll!ClearEventLog
 advapi32.dll!CloseEventLog
 advapi32.dll!GetNumberOfEventLogRecords
@@ -6,6 +7,8 @@ advapi32.dll!GetOldestEventLogRecord
 advapi32.dll!NotifyChangeEventLog
 advapi32.dll!OpenEventLog
 advapi32.dll!ReadEventLog
+advapi32.dll!ReportEvent
+advapi32.dll!RegisterEventSource
 wevtapi.dll!EvtQuery
 wevtapi.dll!EvtSeek
 wevtapi.dll!EvtSubscribe
@@ -40,4 +43,3 @@ wevtapi.dll!EvtFormatMessage
 wevtapi.dll!EvtOpenSession
 wevtapi.dll!EvtUpdateBookmark
 wevtapi.dll!EvtCreateBookmark
-
diff --git a/src/libraries/System.Management/src/PinvokeAnalyzerExceptionList.analyzerdata.netcoreapp b/src/libraries/System.Management/src/PinvokeAnalyzerExceptionList.analyzerdata.netcoreapp
new file mode 100644 (file)
index 0000000..a6ed64c
--- /dev/null
@@ -0,0 +1 @@
+kernel32.dll!LoadLibrary
\ No newline at end of file
index 599da9a..d43fb98 100644 (file)
     <Compile Include="ClientCertificateTest.cs" />
   </ItemGroup>
   <ItemGroup>
+    <PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonVersion)" />
     <PackageReference Include="System.Net.TestData" Version="$(SystemNetTestDataVersion)" />
   </ItemGroup>
 </Project>
\ No newline at end of file
diff --git a/src/libraries/System.Net.Sockets/src/PinvokeAnalyzerExceptionList.analyzerdata b/src/libraries/System.Net.Sockets/src/PinvokeAnalyzerExceptionList.analyzerdata
new file mode 100644 (file)
index 0000000..e41642f
--- /dev/null
@@ -0,0 +1 @@
+ws2_32.dll!WSADuplicateSocket
\ No newline at end of file
index 3885371..a04068f 100644 (file)
     <Compile Include="System.Runtime.WindowsRuntime.Manual.cs" />
   </ItemGroup>
   <ItemGroup Condition="'$(TargetsNetCoreApp)' == 'true'">
-    <ProjectReference Include="$(LibrariesProjectRoot)restore\winrt\winrt.depproj" />
+    <PackageReference Include="Microsoft.TargetingPack.Private.WinRT" Version="$(MicrosoftTargetingPackPrivateWinRTVersion)" PrivateAssets="all" />
     <ProjectReference Include="..\..\mscorlib.WinRT-Facade\ref\mscorlib.WinRT-Facade.csproj" />
     <ProjectReference Include="..\..\System.Runtime\ref\System.Runtime.csproj" />
     <ProjectReference Include="..\..\System.Runtime.Extensions\ref\System.Runtime.Extensions.csproj" />
   </ItemGroup>
   <ItemGroup Condition="'$(TargetsNetStandard)' == 'true'">
-    <ProjectReference Include="$(LibrariesProjectRoot)restore\winrt\winrt.depproj" />
+    <PackageReference Include="Microsoft.TargetingPack.Private.WinRT" Version="$(MicrosoftTargetingPackPrivateWinRTVersion)" PrivateAssets="all" />
     <ProjectReference Include="..\..\mscorlib.WinRT-Facade\ref\mscorlib.WinRT-Facade.csproj" />
   </ItemGroup>
 </Project>
index b8714d9..5b03245 100644 (file)
     <GeneratePlatformNotSupportedAssemblyWithGlobalPrefix>true</GeneratePlatformNotSupportedAssemblyWithGlobalPrefix>
   </PropertyGroup>
   <ItemGroup Condition="'$(TargetsNetCoreApp)' == 'true'">
-    <ReferenceFromRuntime Include="System.Private.CoreLib" />
-    <Reference Include="mscorlib" />
-    <Reference Include="Windows" />
-    <ProjectReference Include="$(LibrariesProjectRoot)restore\winrt\winrt.depproj" />
-  </ItemGroup>
-  <ItemGroup Condition="'$(TargetFramework)' == '$(NetCoreAppCurrent)'">
-    <ProjectReference Include="..\..\System.Runtime\src\System.Runtime.csproj" />
-    <ProjectReference Include="..\..\System.Runtime.Extensions\src\System.Runtime.Extensions.csproj" />
-    <ProjectReference Include="..\..\System.Runtime.InteropServices.WindowsRuntime\src\System.Runtime.InteropServices.WindowsRuntime.csproj" />
-    <ProjectReference Include="..\..\System.ObjectModel\src\System.ObjectModel.csproj" />
-  </ItemGroup>
-  <ItemGroup Condition="'$(TargetsNetCoreApp)' == 'true'">
     <Compile Include="System\IO\StreamOperationAsyncResult.cs" />
     <Compile Include="System\Runtime\InteropServices\WindowsRuntime\MarshalingHelpers.cs" />
     <Compile Include="System\Threading\Tasks\AsyncInfoToTaskBridge.cs" />
       <Link>Common\System\HexConverter.cs</Link>
     </Compile>
   </ItemGroup>
+  <ItemGroup Condition="'$(TargetsNetCoreApp)' == 'true'">
+    <ReferenceFromRuntime Include="System.Private.CoreLib" />
+    <Reference Include="mscorlib" />
+    <Reference Include="Windows" />
+    <PackageReference Include="Microsoft.TargetingPack.Private.WinRT" Version="$(MicrosoftTargetingPackPrivateWinRTVersion)" PrivateAssets="all" />
+  </ItemGroup>
+  <ItemGroup Condition="'$(TargetFramework)' == '$(NetCoreAppCurrent)'">
+    <ProjectReference Include="..\..\System.Runtime\src\System.Runtime.csproj" />
+    <ProjectReference Include="..\..\System.Runtime.Extensions\src\System.Runtime.Extensions.csproj" />
+    <ProjectReference Include="..\..\System.Runtime.InteropServices.WindowsRuntime\src\System.Runtime.InteropServices.WindowsRuntime.csproj" />
+    <ProjectReference Include="..\..\System.ObjectModel\src\System.ObjectModel.csproj" />
+  </ItemGroup>
   <ItemGroup Condition="'$(TargetsNetStandard)' == 'true'">
     <Reference Include="System.Runtime" />
     <Reference Include="System.IO" />
     <Reference Include="System.Threading.Tasks" />
     <Reference Include="System.Resources.ResourceManager" />
-    <ProjectReference Include="$(LibrariesProjectRoot)restore\winrt\winrt.depproj" />
+    <PackageReference Include="Microsoft.TargetingPack.Private.WinRT" Version="$(MicrosoftTargetingPackPrivateWinRTVersion)" PrivateAssets="all" />
     <ProjectReference Include="..\..\mscorlib.WinRT-Facade\ref\mscorlib.WinRT-Facade.csproj" />
   </ItemGroup>
 </Project>
index dab72ed..8633fff 100644 (file)
@@ -18,6 +18,6 @@
     <Compile Include="Windows\UI\ColorTests.cs" />
   </ItemGroup>
   <ItemGroup>
-    <Reference Include="Windows" />
+    <PackageReference Include="Microsoft.TargetingPack.Private.WinRT" Version="$(MicrosoftTargetingPackPrivateWinRTVersion)" PrivateAssets="all" />
   </ItemGroup>
 </Project>
\ No newline at end of file
diff --git a/src/libraries/System.ServiceProcess.ServiceController/src/PinvokeAnalyzerExceptionList.analyzerdata b/src/libraries/System.ServiceProcess.ServiceController/src/PinvokeAnalyzerExceptionList.analyzerdata
new file mode 100644 (file)
index 0000000..f4f4192
--- /dev/null
@@ -0,0 +1,2 @@
+advapi32.dll!RegisterServiceCtrlHandlerEx
+advapi32.dll!StartServiceCtrlDispatcher
\ No newline at end of file
diff --git a/src/libraries/build.proj b/src/libraries/build.proj
deleted file mode 100644 (file)
index 8da5cf9..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-<Project DefaultTargets="Build">
-
-  <Import Project="Directory.Build.props" />
-
-  <PropertyGroup>
-    <BuildNative Condition="'$(BuildNative)' == '' and '$(DirectoryToBuild)' == ''">true</BuildNative>
-    <BuildManaged Condition="'$(BuildManaged)' == ''">true</BuildManaged>
-    <BuildPackages Condition="'$(BuildPackages)' == '' and '$(DirectoryToBuild)' == ''">true</BuildPackages>
-
-    <BuildDependsOn Condition="'$(BuildNative)' == 'true' and '$(BuildTests)' != 'only'">$(BuildDependsOn);BuildNative</BuildDependsOn>
-    <BuildDependsOn Condition="'$(BuildManaged)' == 'true' and '$(BuildTests)' != 'only'">$(BuildDependsOn);BuildManaged</BuildDependsOn>
-    <BuildDependsOn Condition="'$(BuildPackages)' == 'true' and '$(BuildTests)' != 'only'">$(BuildDependsOn);Pack</BuildDependsOn>
-    <BuildDependsOn Condition="'$(BuildTests)' != ''">$(BuildDependsOn);BuildTests</BuildDependsOn>
-  </PropertyGroup>
-
-  <Import Project="Directory.Build.targets" />
-
-  <Target Name="Restore" DependsOnTargets="GenerateRuntimeOSPropsFile">
-    <ItemGroup Condition="'$(DirectoryToBuild)' == ''">
-      <_RestoreProjects Include="$(MSBuildThisFileDirectory)restore\dirs.proj" Build="true" />
-    </ItemGroup>
-    
-    <ItemGroup Condition="'$(DotNetBuildFromSource)' != 'true'">
-      <_RestoreProjects Include="$(MSBuildThisFileDirectory)tests.proj" Build="false" />
-    </ItemGroup>
-
-    <MSBuild Projects="@(_RestoreProjects)" Targets="Restore" Properties="$(ProjectProperties)" />
-    <MSBuild Projects="@(_RestoreProjects)" Condition="'%(Build)' != 'false'" Properties="$(ProjectProperties)" />
-  </Target>
-
-  <Target Name="BuildNative">
-    <ItemGroup>
-      <_BuildNativeProjects Include="$(MSBuildThisFileDirectory)Native\build-native.proj" />
-    </ItemGroup>
-
-    <MSBuild Projects="@(_BuildNativeProjects)" Properties="$(ProjectProperties)" />
-  </Target>
-
-  <Target Name="BuildManaged">
-    <ItemGroup>
-      <_BuildMangedProjects Include="$(MSBuildThisFileDirectory)dirs.proj" />
-    </ItemGroup>
-
-    <MSBuild Projects="@(_BuildMangedProjects)" Properties="$(ProjectProperties)" />
-  </Target>
-
-  <Target Name="BuildTests">
-    <ItemGroup>
-      <_TestProjects Include="$(MSBuildThisFileDirectory)tests.proj" />
-    </ItemGroup>
-
-    <MSBuild Projects="@(_TestProjects)"
-             Targets="Build"
-             Properties="$(ProjectProperties)" />
-  </Target>
-
-  <Target Name="Test">
-    <ItemGroup>
-      <_TestProjects Include="$(MSBuildThisFileDirectory)tests.proj" />
-    </ItemGroup>
-
-    <MSBuild Projects="@(_TestProjects)"
-             Targets="Test"
-             Properties="$(ProjectProperties)" />
-  </Target>
-
-  <Target Name="Pack">
-    <ItemGroup>
-      <_PackProjects Include="$(MSBuildThisFileDirectory)packages.builds" />
-    </ItemGroup>
-
-    <MSBuild Projects="@(_PackProjects)" Properties="$(ProjectProperties)" />
-  </Target>
-
-  <Target Name="Build" DependsOnTargets="$(BuildDependsOn)" />
-
-  <Target Name="Rebuild" DependsOnTargets="Clean;Build" />
-
-</Project>
diff --git a/src/libraries/dir.traversal.targets b/src/libraries/dir.traversal.targets
deleted file mode 100644 (file)
index 3596af3..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-<Project DefaultTargets="Build">
-  <Import Project="$(MSBuildThisFileDirectory)Directory.Build.targets" />
-
-  <Target Name="BuildAllProjects">
-    <PropertyGroup>
-      <DefaultBuildAllTarget Condition="'$(DefaultBuildAllTarget)'==''">$(MSBuildProjectDefaultTargets)</DefaultBuildAllTarget>
-    </PropertyGroup>
-
-    <!-- To Serialize we use msbuild's batching functionality '%' to force it to batch all similar projects with the same identity
-         however since the project names are unique it will essentially force each to run in its own batch -->
-    <MSBuild Targets="$(DefaultBuildAllTarget)"
-             Projects="@(Project)"
-             Condition="'$(SerializeProjects)'=='true' and '%(Identity)' != ''"
-             Properties="DefaultBuildAllTarget=$(DefaultBuildAllTarget);BuildAllProjects=true"
-             ContinueOnError="ErrorAndStop" />
-
-    <MSBuild Targets="$(DefaultBuildAllTarget)"
-             Projects="@(Project)"
-             Condition="'$(SerializeProjects)'!='true'"
-             Properties="DefaultBuildAllTarget=$(DefaultBuildAllTarget);BuildAllProjects=true;%(Project.AdditionalProperties)"
-             BuildInParallel="true"
-             ContinueOnError="ErrorAndStop" />
-
-    <!-- Given we ErrorAndContinue we need to propagate the error if the overall task failed -->
-    <Error Condition="'$(MSBuildLastTaskResult)'=='false'" />
-  </Target>
-
-  <Target Name="GetFilesToPackage"
-          DependsOnTargets="FilterProjects"
-          Returns="@(FilesToPackage)">
-    <MSBuild Targets="GetFilesToPackage"
-             Projects="@(Project)"
-             BuildInParallel="true"
-             Properties="$(ProjectProperties)"
-             ContinueOnError="ErrorAndContinue" >
-      <Output TaskParameter="TargetOutputs"
-              ItemName="FilesToPackage" />
-    </MSBuild>
-
-    <!-- Given we ErrorAndContinue we need to propagate the error if the overall task failed -->
-    <Error Condition="'$(MSBuildLastTaskResult)'=='false'" />
-  </Target>
-
-  <PropertyGroup>
-    <TraversalBuildDependsOn>BuildAllProjects;$(TraversalBuildDependsOn);</TraversalBuildDependsOn>
-  </PropertyGroup>
-
-  <Target Name="Build" DependsOnTargets="$(TraversalBuildDependsOn)" />
-  <Target Name="Clean" DependsOnTargets="$(TraversalCleanDependsOn)" />
-  <Target Name="Rebuild" DependsOnTargets="Clean;Build" />
-  <Target Name="Restore" />
-
-</Project>
diff --git a/src/libraries/dirs.proj b/src/libraries/dirs.proj
deleted file mode 100644 (file)
index 2b9534d..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-<Project>
-  <Import Project="$(MSBuildThisFileDirectory)Directory.Build.props" />
-
-  <!-- required to build the projects in their specified order -->
-  <PropertyGroup>
-    <SerializeProjects>true</SerializeProjects>
-  </PropertyGroup>
-
-  <ItemGroup Condition="'$(DirectoryToBuild)' == ''">
-    <Project Include="ref.builds" />
-    <Project Include="shims\generated\*.csproj" />
-    <Project Include="Native\native-binplace.proj" />
-    <Project Include="src.builds" />
-    <Project Include="shims\manual\*.csproj" />
-    <Project Include="shims\ApiCompat.proj" Condition="'$(DotNetBuildFromSource)' != 'true' and '$(BuildTargetFramework)' == '$(NetCoreAppCurrent)'" />
-    <Project Include="pretest.proj" Condition="'$(DotNetBuildFromSource)' != 'true' and '$(BuildAllConfigurations)' != 'true'" />
-  </ItemGroup>
-
-  <ItemGroup Condition="'$(DirectoryToBuild)' != ''">
-    <Project Include="ref.builds" />
-    <Project Include="src.builds" />
-  </ItemGroup>
-
-  <Import Project="$(MSBuildThisFileDirectory)dir.traversal.targets" />
-  
-</Project>
\ No newline at end of file
similarity index 62%
rename from src/libraries/packages.builds
rename to src/libraries/libraries-packages.proj
index ab33fce..f1ed352 100644 (file)
@@ -1,23 +1,21 @@
 <Project>
-  <Import Project="$(MSBuildThisFileDirectory)Directory.Build.props" />
+  <Import Sdk="Microsoft.Build.Traversal" Project="Sdk.props" />
 
-  <PropertyGroup Condition="'$(DotNetBuildFromSource)' == 'true'">
-    <AdditionalBuildTargetFrameworks>$(AdditionalBuildTargetFrameworks);package-$(Configuration)</AdditionalBuildTargetFrameworks>
+  <PropertyGroup>
+    <TraversalGlobalProperties>BuildAllProjects=true</TraversalGlobalProperties>
+    <AdditionalBuildTargetFrameworks Condition="'$(DotNetBuildFromSource)' == 'true'">$(AdditionalBuildTargetFrameworks);package-$(Configuration)</AdditionalBuildTargetFrameworks>
   </PropertyGroup>
 
-  <ItemGroup Condition="'$(SkipManagedPackageBuild)' != 'true'">
-    <Project Include="$(PkgDir)*\*.builds" >
-      <AdditionalProperties>$(AdditionalProperties)</AdditionalProperties>
-    </Project>
-    <Project Include="*\pkg\**\*.pkgproj" Condition="'$(BuildAllConfigurations)' == 'true' OR '$(DotNetBuildFromSource)' == 'true'">
-      <AdditionalProperties>$(AdditionalProperties)</AdditionalProperties>
-    </Project>
+  <ItemGroup>
+    <ProjectReference Include="$(PkgDir)*\*.proj" Exclude="$(PkgDir)test\*" />
+    <ProjectReference Include="$(MSBuildThisFileDirectory)*\pkg\**\*.pkgproj" Condition="'$(BuildAllConfigurations)' == 'true' or '$(DotNetBuildFromSource)' == 'true'" />
   </ItemGroup>
 
   <!-- Need the PackageIndexFile file property from baseline.props -->
   <Import Project="$(PkgDir)baseline\baseline.props" />
 
-  <UsingTask TaskName="UpdatePackageIndex" AssemblyFile="$(PackagingTaskDir)Microsoft.DotNet.Build.Tasks.Packaging.dll"/>
+  <!-- Calculate PackageDownload items for restore. -->
+  <Import Project="$(RepositoryEngineeringDir)restore\harvestPackages.targets" Condition="'$(MSBuildRestoreSessionId)' != ''" />
 
   <!--
     Updates the package index to mark all packages we are building that can go stable as stable.
@@ -26,8 +24,9 @@
     ones that might do this. After we ship a stable set of packages this target should be ran and the
     changes to the package index should be commited to the repo.
   -->
+  <UsingTask TaskName="UpdatePackageIndex" AssemblyFile="$(PackagingTaskDir)Microsoft.DotNet.Build.Tasks.Packaging.dll"/>
   <Target Name="UpdatePackageIndexWithStableVersions"
-          BeforeTargets="BuildAllProjects"
+          BeforeTargets="Build"
           Condition="'$(DotNetFinalVersionKind)' == 'release'">
     <ItemGroup>
       <!--
@@ -42,8 +41,7 @@
              BuildInParallel="$(BuildInParallel)"
              Projects="@(PkgProjects)"
              RemoveProperties="Configuration">
-      <Output TaskParameter="TargetOutputs"
-              ItemName="_StablePackages" />
+      <Output TaskParameter="TargetOutputs" ItemName="_StablePackages" />
     </MSBuild>
 
     <Message Text="Marking package '%(_StablePackages.Identity)' stable with version '%(_StablePackages.Version)'" />
 
   <!-- Generate a version text file we include in our packages -->
   <Target Name="GenerateVersionFileForPackages"
-          BeforeTargets="BuildAllProjects"
+          BeforeTargets="Build"
           DependsOnTargets="InitializeSourceControlInformationFromSourceControlManager">
-
     <Error Condition="'$(SourceRevisionId)' == ''" Text="SourceRevisionId is not set, which means the SourceLink targets are not included in the build. Those are needed to produce a correct sha for our build outputs." />
 
     <MakeDir Directories="$([System.IO.Path]::GetDirectoryName($(VersionFileForPackages)))" />
-
-    <WriteLinesToFile
-      File="$(VersionFileForPackages)"
-      Lines="$(SourceRevisionId)"
-      Overwrite="true" />
+    <WriteLinesToFile File="$(VersionFileForPackages)"
+                      Lines="$(SourceRevisionId)"
+                      Overwrite="true" />
   </Target>
 
-  <Import Project="$(MSBuildThisFileDirectory)dir.traversal.targets" />
-
   <Target Name="SetAzureDevOpsVariableForBuiltPackages"
           Condition="'$(ContinuousIntegrationBuild)' == 'true'"
-          AfterTargets="BuildAllProjects">
+          AfterTargets="Build">
     <ItemGroup>
       <_PackageReports Include="$(PackageReportDir)*.json" />
     </ItemGroup>
 
-    <Message Condition="'@(_PackageReports)' != ''" Importance="High" Text="##vso[task.setvariable variable=_librariesBuildProducedPackages]true" />
+    <Message Condition="'@(_PackageReports)' != '' and Exists('$(ArtifactsDir)packages')" Importance="High" Text="##vso[task.setvariable variable=_librariesBuildProducedPackages]true" />
   </Target>
+
+  <Import Sdk="Microsoft.Build.Traversal" Project="Sdk.targets" />
+
+  <!-- Pack is a no-op and should just invoke build. -->
+  <Target Name="Pack" DependsOnTargets="Build" />
 </Project>
index 3092ef9..832d9ef 100644 (file)
@@ -1,4 +1,8 @@
 <Project>
+  <PropertyGroup>
+    <DisableProjectRestore>true</DisableProjectRestore>
+  </PropertyGroup>
+
   <Import Project="..\Directory.Build.props" />
 
   <PropertyGroup>
index 2e66296..c0494a5 100644 (file)
@@ -1,5 +1,38 @@
 <Project>
-  <Import Project="..\dir.traversal.targets" />
+  <Import Project="$(MSBuildThisFileDirectory)..\Directory.Build.targets" />
+
+  <Target Name="BuildAllProjects">
+    <MSBuild Targets="$(MSBuildProjectDefaultTargets)"
+             Projects="@(Project)"
+             Properties="BuildAllProjects=true;%(Project.AdditionalProperties)"
+             BuildInParallel="true"
+             ContinueOnError="ErrorAndStop" />
+  </Target>
+
+  <Target Name="GetFilesToPackage"
+          DependsOnTargets="FilterProjects"
+          Returns="@(FilesToPackage)">
+    <MSBuild Targets="GetFilesToPackage"
+             Projects="@(Project)"
+             BuildInParallel="true"
+             Properties="$(ProjectProperties)"
+             ContinueOnError="ErrorAndContinue" >
+      <Output TaskParameter="TargetOutputs"
+              ItemName="FilesToPackage" />
+    </MSBuild>
+
+    <!-- Given we ErrorAndContinue we need to propagate the error if the overall task failed -->
+    <Error Condition="'$(MSBuildLastTaskResult)'=='false'" />
+  </Target>
+
+  <PropertyGroup>
+    <TraversalBuildDependsOn>BuildAllProjects;$(TraversalBuildDependsOn);</TraversalBuildDependsOn>
+  </PropertyGroup>
+
+  <Target Name="Build" DependsOnTargets="$(TraversalBuildDependsOn)" />
+  <Target Name="Clean" DependsOnTargets="$(TraversalCleanDependsOn)" />
+  <Target Name="Rebuild" DependsOnTargets="Clean;Build" />
+  <Target Name="Restore" />
 
   <PropertyGroup Condition="'$(BuildingAnOfficialBuildLeg)' == 'true'">
     <!-- During an official build, only build identity packages in the AllConfigurations build -->
index d899043..211e423 100644 (file)
@@ -5,7 +5,7 @@
     <SkipValidatePackage>true</SkipValidatePackage>
   </PropertyGroup>
   <ItemGroup Condition="'$(PackageTargetRuntime)' == 'linux-arm' or '$(PackageTargetRuntime)' == 'linux-arm64' or '$(PackageTargetRuntime)' == 'linux-x64' or '$(PackageTargetRuntime)' == 'osx-x64' or '$(PackageTargetRuntime)' == 'freebsd-x64'">
-    <File Include="$(NativeBinDir)\$(LibraryFilePrefix)System.IO.Ports.Native$(LibraryFileExtension)" >
+    <File Include="$(NativeBinDir)$(LibraryFilePrefix)System.IO.Ports.Native$(LibraryFileExtension)" >
       <TargetPath>runtimes/$(PackageRID)/native</TargetPath>
     </File>
   </ItemGroup>
index 10cd240..988be57 100644 (file)
@@ -1,24 +1,31 @@
-<Project>
-  <Import Sdk="Microsoft.NET.Sdk" Project="Sdk.props" />
+<Project Sdk="Microsoft.Build.Traversal">
 
   <PropertyGroup>
-    <BuildDependsOnTargets>GenerateLaunchSettingsFiles</BuildDependsOnTargets>
-    <BuildDependsOnTargets Condition="'$(BinplaceTestSharedFramework)' == 'true'">$(BuildDependsOnTargets);GenerateTestSharedFrameworkDepsFile</BuildDependsOnTargets>
-    <BuildDependsOnTargets Condition="'$(PlatformManifestFile)' != ''">$(BuildDependsOnTargets);GenerateFileVersionProps</BuildDependsOnTargets>
-    <TargetFrameworkIdentifier>netcoreapp</TargetFrameworkIdentifier>
-    <TargetFrameworkVersion>5.0</TargetFrameworkVersion>
+    <TraversalGlobalProperties>BuildAllProjects=true</TraversalGlobalProperties>
   </PropertyGroup>
 
+  <!-- Explicitly build the runtime.depproj project first to correctly set up the testhost. -->
   <ItemGroup>
+    <RuntimeProject Include="restore\runtime\runtime.depproj" />
+    <ProjectReference Include="@(RuntimeProject)" Condition="'$(MSBuildRestoreSessionId)' != ''" />
+  </ItemGroup>
+
+  <ItemGroup Condition="'$(DotNetBuildFromSource)' != 'true' and '$(BuildAllConfigurations)' != 'true'">
     <!-- This is necessary as inside VS project references that aren't part of the sln aren't built. -->
-    <Project Include="$(CommonTestPath)\CoreFx.Private.TestUtilities\CoreFx.Private.TestUtilities.csproj" />
+    <ProjectReference Include="$(CommonTestPath)CoreFx.Private.TestUtilities\CoreFx.Private.TestUtilities.csproj" />
   </ItemGroup>
 
+  <Target Name="RestoreTestHost"
+          BeforeTargets="Build">
+    <MSBuild Targets="Build"
+             Projects="@(RuntimeProject)"
+             Properties="$(TraversalGlobalProperties)" />
+  </Target>
+
   <!-- Microsoft.XmlSerializer.Generator should not be marked as a platform item and be copy-local instead. -->
   <Target Name="CollectSharedFrameworkRuntimeFiles"
-          Condition="'$(PlatformManifestFile)' != ''"
-          BeforeTargets="GenerateFileVersionProps">
-    <ItemGroup Condition="'$(BuildingNETCoreAppVertical)' == 'true'">
+          Condition="'$(PlatformManifestFile)' != '' and '$(BuildingNETCoreAppVertical)' == 'true'">
+    <ItemGroup>
       <_manualSharedFrameworkRuntimeFiles Include="System.Security.Cryptography.Native.OpenSsl.so" />
       <_manualSharedFrameworkRuntimeFiles Include="System.Security.Cryptography.Native.Apple.dylib" />
       <_manualSharedFrameworkRuntimeFiles Include="System.Security.Cryptography.Native.OpenSsl.dylib" />
   </Target>
 
   <UsingTask TaskName="GenerateFileVersionProps" AssemblyFile="$(InstallerTasksAssemblyPath)"/>
-  <Target Name="GenerateFileVersionProps" Condition="'$(BuildTargetFramework)' == '$(NetCoreAppCurrent)'">
+  <Target Name="GenerateFileVersionProps"
+          DependsOnTargets="CollectSharedFrameworkRuntimeFiles"
+          Condition="'$(PlatformManifestFile)' != '' and '$(BuildTargetFramework)' == '$(NetCoreAppCurrent)'"
+          AfterTargets="RestoreTestHost">
     <GenerateFileVersionProps Files="@(SharedFrameworkRuntimeFiles)"
                               PackageId="Microsoft.NETCore.App"
                               PackageVersion="$(ProductVersion)"
     To use invoke target directly specifying NETCoreAppTestSharedFrameworkPath property.
   -->
   <UsingTask TaskName="GenerateTestSharedFrameworkDepsFile" AssemblyFile="$(InstallerTasksAssemblyPath)"/>
-  <Target Name="GenerateTestSharedFrameworkDepsFile" Condition="'$(BuildTargetFramework)' == '$(NetCoreAppCurrent)'">
+  <Target Name="GenerateTestSharedFrameworkDepsFile"
+          Condition="'$(BinplaceTestSharedFramework)' == 'true' and '$(BuildTargetFramework)' == '$(NetCoreAppCurrent)'"
+          AfterTargets="RestoreTestHost">
     <GenerateTestSharedFrameworkDepsFile SharedFrameworkDirectory="$(NETCoreAppTestSharedFrameworkPath)"
                                          RuntimeGraphFiles="$(RuntimeIdGraphDefinitionFile)"
                                          TargetRuntimeIdentifier="$(PackageRID)" />
   </Target>
-
-  <!-- Generate launch settings support files to enable VS debugging. -->
-  <Target Name="GenerateLaunchSettingsFiles" Condition="'$(EnableLaunchSettings)' == 'true'">
-    <PropertyGroup>
-      <_TestProjectRootDir>$(LibrariesProjectRoot)</_TestProjectRootDir>
-      <_TestProjectRootDir Condition="'$(DirectoryToBuild)'!=''">$(DirectoryToBuild)</_TestProjectRootDir>
-    </PropertyGroup>
-    <ItemGroup>
-      <!-- Keep in sync with pattern for test projects in tests.proj -->
-      <TestProjects Include="$(_TestProjectRootDir)*\tests\**\*.Tests.csproj" />
-    </ItemGroup>
-
-    <MSBuild Projects="@(TestProjects)"
-             Targets="GenerateLaunchSettingsFile"
-             ContinueOnError="ErrorAndContinue" />
-  </Target>
-
-  <Import Sdk="Microsoft.NET.Sdk" Project="Sdk.targets" />
-
-  <Target Name="Build"
-          Condition="'$(SkipPrepareTest)' != 'true'"
-          DependsOnTargets="GenerateLaunchSettingsFiles;GenerateTestSharedFrameworkDepsFile;GenerateFileVersionProps">
-
-    <MSBuild Targets="Build"
-             Projects="@(Project)"
-             Properties="TargetFramework=$(BuildTargetFramework);%(Project.AdditionalProperties)"
-             BuildInParallel="true"
-             ContinueOnError="ErrorAndStop" 
-             Condition="'$(SkipBuildProjects)' != 'true'"/>
-
-    <!-- Given we ErrorAndContinue we need to propagate the error if the overall task failed -->
-    <Error Condition="'$(MSBuildLastTaskResult)' == 'false'" />
-
-  </Target>
 </Project>
diff --git a/src/libraries/ref.builds b/src/libraries/ref.builds
deleted file mode 100644 (file)
index 9bef0a6..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-<Project DefaultTargets="Build" >
-  <Import Project="$(MSBuildThisFileDirectory)Directory.Build.props" />
-
-  <ItemGroup Condition="'$(RuntimeFlavor)' == 'Mono'"> 
-    <ProjectExclusions Include="$(MSBuildThisFileDirectory)\System.Utf8String.Experimental\ref\System.Utf8String.Experimental.csproj" />
-  </ItemGroup>
-
-  <ItemGroup>
-    <Project Condition="'$(DirectoryToBuild)' == ''" Include="$(MSBuildThisFileDirectory)*\ref\*.*proj" Exclude="@(ProjectExclusions)" />
-    <Project Condition="'$(DirectoryToBuild)' != ''" Include="$(DirectoryToBuild)\ref\*.*proj" />
-  </ItemGroup>
-
-  <Import Project="$(MSBuildThisFileDirectory)dir.traversal.targets" />
-</Project>
diff --git a/src/libraries/ref.proj b/src/libraries/ref.proj
new file mode 100644 (file)
index 0000000..c13c100
--- /dev/null
@@ -0,0 +1,24 @@
+<Project Sdk="Microsoft.Build.Traversal">
+
+  <PropertyGroup>
+    <TraversalGlobalProperties>BuildAllProjects=true</TraversalGlobalProperties>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <GeneratedShimProject Include="shims\generated\*.csproj" />
+  </ItemGroup>
+
+  <ItemGroup>
+    <ProjectReference Include="$(MSBuildThisFileDirectory)*\ref\*.*proj" Exclude="@(ProjectExclusions)" />
+    <!-- Restore only and build later. -->
+    <ProjectReference Include="@(GeneratedShimProject)" Condition="'$(MSBuildRestoreSessionId)' != ''" />
+  </ItemGroup>
+
+  <Target Name="BuildGeneratedShims"
+          AfterTargets="Build">
+    <MSBuild Targets="Build"
+             Projects="@(GeneratedShimProject)"
+             Properties="$(TraversalGlobalProperties)" />
+  </Target>
+
+</Project>
diff --git a/src/libraries/restore/analyzers/analyzers.depproj b/src/libraries/restore/analyzers/analyzers.depproj
deleted file mode 100644 (file)
index 27fad4d..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-<Project Sdk="Microsoft.NET.Sdk">
-  <PropertyGroup>
-    <EnableBinPlacing>false</EnableBinPlacing>
-    <EnableAnalyzers>true</EnableAnalyzers>
-    <Language>C#</Language>
-    <TargetFrameworks>netstandard2.0</TargetFrameworks>
-  </PropertyGroup>
-
-  <ItemGroup>
-    <!-- 
-      Microsoft.CodeAnalysis.Common shouldn't be referenced directly but is needed by the analyzer depproj restore.
-      TODO: Remove when project restore is enabled for non test projects: https://github.com/dotnet/corefx/issues/41512.
-    -->
-    <PackageReference Include="Microsoft.CodeAnalysis.Common" Version="3.4.0-beta2-final" PrivateAssets="all" />
-  </ItemGroup>
-
-  <UsingTask TaskName="Microsoft.DotNet.Arcade.Sdk.SaveItems" AssemblyFile="$(ArcadeSdkBuildTasksAssembly)" />
-
-  <Target Name="GenerateAnalyzersPropsFile"
-          AfterTargets="ResolveLockFileAnalyzers">
-
-    <SaveItems Condition="'@(Analyzer)' != ''"
-               ItemName="ResolvedAnalyzer"
-               Items="@(Analyzer)"
-               File="$(AnalyzerPropsFile)" />
-  </Target>
-</Project>
diff --git a/src/libraries/restore/depproj.proj b/src/libraries/restore/depproj.proj
new file mode 100644 (file)
index 0000000..7825325
--- /dev/null
@@ -0,0 +1,28 @@
+<Project>
+  <Import Project="Directory.Build.props" />
+
+  <ItemGroup>
+    <ProjectReference Include="netcoreapp/external.netcoreapp.depproj" Condition="'$(DotNetBuildFromSource)' != 'true'" />
+    <ProjectReference Include="netstandard/external.netstandard.depproj" />
+    <ProjectReference Include="netfx/netfx.depproj" />
+    <ProjectReference Include="binplacePackages/binplacePackages.depproj" />
+  </ItemGroup>
+
+  <Target Name="Restore">
+    <MSBuild Projects="@(ProjectReference)"
+             Properties="BuildAllProjects=true;MSBuildRestoreSessionId=$([System.Guid]::NewGuid())"
+             BuildInParallel="true"
+             Targets="Restore" />
+
+    <MSBuild Projects="@(ProjectReference)"
+             Properties="BuildAllProjects=true"
+             BuildInParallel="true"
+             Targets="Build" />
+  </Target>
+
+  <Import Project="Directory.Build.targets" />
+
+  <!-- Ordering matters! Overwriting the Build target after the Sdk.targets import. -->
+  <!-- Don't do anything during build. -->
+  <Target Name="Build" />
+</Project>
diff --git a/src/libraries/restore/dirs.proj b/src/libraries/restore/dirs.proj
deleted file mode 100644 (file)
index d006b65..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-<Project>
-  <Import Project="Directory.Build.props" />
-
-  <ItemGroup>
-    <Project Condition="'$(DotNetBuildFromSource)' != 'true'" Include="analyzers/analyzers.depproj" />
-
-    <Project Condition="'$(DotNetBuildFromSource)' != 'true'" Include="netcoreapp/netcoreapp.depproj" />
-    <Project Include="netstandard/netstandard.depproj" />
-    <Project Include="netfx/netfx.depproj" />
-    <Project Include="tools/tools.depproj" />
-    <Project Include="harvestPackages/harvestPackages.depproj" />
-    <Project Include="binplacePackages/binplacePackages.depproj" />
-  </ItemGroup>
-
-  <Import Project="..\dir.traversal.targets" />
-</Project>
index a86068c..dacf9d9 100644 (file)
@@ -2,6 +2,6 @@
   <PropertyGroup>
     <OutDirName>external.$(MSBuildProjectName)</OutDirName>
   </PropertyGroup>
-  
+
   <Import Project="..\Directory.Build.props" />
 </Project>
\ No newline at end of file
index 18a776f..0546f2f 100644 (file)
         <ReferenceCopyLocalPaths Include="@(CoreCLRILFiles)" />
       </ItemGroup>
   </Target>
+
+  <!-- Strip away placeholder tfms and TargetFrameworkSuffix. -->
+  <Target Name="StripTargetFrameworkSuffixFromTargetFrameworks"
+          Condition="'$(TargetFrameworks)' != ''"
+          BeforeTargets="_GetRestoreTargetFrameworksOutput;_GetRestoreTargetFrameworksAsItems">
+    <PropertyGroup>
+      <TargetFrameworks Condition="'$(TargetFrameworks)' != ''">$([System.Text.RegularExpressions.Regex]::Replace('$(TargetFrameworks)', '_[^;]+;?', ''))</TargetFrameworks>
+      <TargetFrameworks Condition="'$(TargetFrameworks)' != ''">$([System.Text.RegularExpressions.Regex]::Replace('$(TargetFrameworks)', '-[^;]+', ''))</TargetFrameworks>
+    </PropertyGroup>
+  </Target>
 </Project>
diff --git a/src/libraries/restore/tools/tools.depproj b/src/libraries/restore/tools/tools.depproj
deleted file mode 100644 (file)
index f2e32a3..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-<Project Sdk="Microsoft.NET.Sdk">
-  <PropertyGroup>
-    <OutputPath>$(ILAsmToolPath)</OutputPath>
-    <EnableBinPlacing>false</EnableBinPlacing>
-    <RuntimeIdentifier>$(ToolRuntimeRID)</RuntimeIdentifier>
-    <NoWarn>$(NoWarn);NU1603;NU1605</NoWarn>
-    <TargetFrameworks>netstandard2.0</TargetFrameworks>
-  </PropertyGroup>
-
-  <ItemGroup>
-    <PackageReference Include="Microsoft.NETCore.ILAsm">
-      <Version>$(MicrosoftNETCoreILAsmVersion)</Version>
-    </PackageReference>
-    <PackageReference Include="Microsoft.NETCore.ILDAsm">
-      <Version>$(MicrosoftNETCoreILAsmVersion)</Version>
-    </PackageReference>
-  </ItemGroup>
-</Project>
\ No newline at end of file
diff --git a/src/libraries/restore/winrt/winrt.depproj b/src/libraries/restore/winrt/winrt.depproj
deleted file mode 100644 (file)
index fb99977..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-<Project Sdk="Microsoft.NET.Sdk">
-  <PropertyGroup>
-    <AssemblyName>Windows</AssemblyName>
-    <TargetExt>.winmd</TargetExt>
-    <!-- don't binplace for netstandard since the netstandard ref path is used for API compat and assumed to be 
-         implemented by all frameworks that support it.  Instead require projectreference to this project -->
-    <BinPlaceRef Condition="'$(TargetsNetStandard)' != 'true'">true</BinPlaceRef>
-    <NuGetDeploySourceItem>Reference</NuGetDeploySourceItem>
-    <TargetFrameworks>netcoreapp3.0;$(netcoreappCurrent);netstandard1.0</TargetFrameworks>
-  </PropertyGroup>
-  <ItemGroup>
-    <PackageReference Include="Microsoft.TargetingPack.Private.WinRT">
-      <Version>1.0.5</Version>
-    </PackageReference>
-  </ItemGroup>
-</Project>
\ No newline at end of file
index a261947..fa8fb19 100644 (file)
@@ -1,9 +1,12 @@
-<Project DefaultTargets="Build">
+<Project>
+  <Import Sdk="Microsoft.NET.Sdk" Project="Sdk.props" />
 
-  <Import Project="Directory.Build.props" />
+  <PropertyGroup>
+    <TargetFramework>$(BuildTargetFramework)</TargetFramework>
+  </PropertyGroup>
 
   <PropertyGroup>
-    <ApiCompatTarget>$(BuildTargetFramework)</ApiCompatTarget>
+    <ApiCompatTarget>$(TargetFramework)</ApiCompatTarget>
     <ApiCompatTarget Condition="$(BuildTargetFramework.Contains('netcoreapp'))">netcoreapp</ApiCompatTarget>
     <ApiCompatResponseFile>$(IntermediateOutputPath)/apicompat.rsp</ApiCompatResponseFile>
     <ApiCompatBaselineFile>$(MSBuildThisFileDirectory)ApiCompatBaseline.$(ApiCompatTarget).netfx461.txt</ApiCompatBaselineFile>
     <Error Condition="'$(ApiCompatExitCode)' != '0'" Text="ApiCompat failed comparing $(PreviousNetCoreApp) to $(ApiCompatTarget)" />
   </Target>
 
-  <Target Name="Build" DependsOnTargets="RunApiCompat" />
-  <Target Name="Clean">
+  <Target Name="CleanAdditionalFiles" AfterTargets="Clean">
     <RemoveDir Directories="$(BaseIntermediateOutputPath)" />
   </Target>
-  <Target Name="Rebuild" DependsOnTargets="Clean;Build" />
 
-  <Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.targets))" />
+  <Import Sdk="Microsoft.NET.Sdk" Project="Sdk.targets" />
+
+  <!-- Ordering matters! Overwriting the Build target after the Sdk.targets import. -->
+  <Target Name="Build" DependsOnTargets="RunApiCompat" />
 </Project>
index 790b612..d0835fd 100644 (file)
@@ -18,8 +18,6 @@
     <GenFacadesForceZeroVersionSeeds Condition="'$(MSBuildProjectName)' != 'netstandard'">true</GenFacadesForceZeroVersionSeeds>
     <IncludeDefaultReferences>false</IncludeDefaultReferences>
     <HasMatchingContract>true</HasMatchingContract>
-    <!-- Shims have no code in them. No point in running IL linker over them -->
-    <ILLinkTrimAssembly>false</ILLinkTrimAssembly>
   </PropertyGroup>
 
   <ItemGroup Condition="'$(MSBuildProjectName)' == 'System.Runtime' or '$(MSBuildProjectName)' == 'mscorlib' or '$(MSBuildProjectName)' == 'netstandard'">
diff --git a/src/libraries/src.builds b/src/libraries/src.builds
deleted file mode 100644 (file)
index 5903b7f..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-<Project DefaultTargets="Build" TreatAsLocalProperty="AdditionalBuildTargetFrameworks">
-  <Import Project="$(MSBuildThisFileDirectory)Directory.Build.props" />
-
-  <ItemGroup Condition="'$(RuntimeFlavor)' == 'Mono'"> 
-    <ProjectExclusions Include="$(MSBuildThisFileDirectory)\System.Utf8String.Experimental\src\System.Utf8String.Experimental.csproj" />
-  </ItemGroup>
-
-  <ItemGroup Condition="'$(DirectoryToBuild)' == ''">
-    <Project Include="$(MSBuildThisFileDirectory)*\src\*.csproj" Exclude="@(ProjectExclusions)" />
-    <Project Include="$(MSBuildThisFileDirectory)*\src\*.ilproj" Exclude="@(ProjectExclusions)" />
-    <Project Include="$(MSBuildThisFileDirectory)*\src\*.vbproj" Exclude="@(ProjectExclusions)" />
-    <!-- Explicitly include the runtime.depproj project here to correctly set up the test host. -->
-    <Project Include="$(MSBuildThisFileDirectory)restore\runtime\runtime.depproj" />
-  </ItemGroup>
-
-  <ItemGroup Condition="'$(DirectoryToBuild)' != ''">
-    <Project Include="$(DirectoryToBuild)\src\*.*proj" />
-  </ItemGroup>
-
-  <Import Project="$(MSBuildThisFileDirectory)dir.traversal.targets" />
-</Project>
diff --git a/src/libraries/src.proj b/src/libraries/src.proj
new file mode 100644 (file)
index 0000000..b3b5f85
--- /dev/null
@@ -0,0 +1,49 @@
+<Project Sdk="Microsoft.Build.Traversal">
+
+  <PropertyGroup>
+    <TraversalGlobalProperties>BuildAllProjects=true</TraversalGlobalProperties>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <NativeBinPlaceProject Include="Native\native-binplace.proj" />
+    <ManualShimProject Include="shims\manual\*.csproj" />
+    <ApiCompatProject Include="shims\ApiCompat.proj"
+                      Condition="'$(DotNetBuildFromSource)' != 'true' and '$(BuildTargetFramework)' == '$(NetCoreAppCurrent)'" />
+  </ItemGroup>
+
+  <!-- Restore only and build before/after. -->
+  <ItemGroup Condition="'$(MSBuildRestoreSessionId)' != ''">
+    <ProjectReference Include="@(NativeBinPlaceProject)" />
+    <ProjectReference Include="@(ManualShimProject)" />
+    <ProjectReference Include="@(ApiCompatProject)" />
+  </ItemGroup>
+
+  <ItemGroup>
+    <ProjectReference Include="$(MSBuildThisFileDirectory)*\src\*.csproj" Exclude="@(ProjectExclusions)" />
+    <ProjectReference Include="$(MSBuildThisFileDirectory)*\src\*.ilproj" Exclude="@(ProjectExclusions)" />
+    <ProjectReference Include="$(MSBuildThisFileDirectory)*\src\*.vbproj" Exclude="@(ProjectExclusions)" />
+  </ItemGroup>
+
+  <Target Name="NativeBinPlace"
+          BeforeTargets="Build">
+    <MSBuild Targets="Build"
+             Projects="@(NativeBinPlaceProject)"
+             Properties="$(TraversalGlobalProperties)" />
+  </Target>
+
+  <Target Name="BuildManualShims"
+          AfterTargets="Build">
+    <MSBuild Targets="Build"
+             Projects="@(ManualShimProject)"
+             Properties="$(TraversalGlobalProperties)" />
+  </Target>
+
+  <Target Name="RunApiCompat"
+          Condition="'@(ApiCompatProject)' != ''"
+          AfterTargets="BuildManualShims">
+    <MSBuild Targets="Build"
+             Projects="@(ApiCompatProject)"
+             Properties="$(TraversalGlobalProperties)" />
+  </Target>
+
+</Project>
index 34b7228..27a11e9 100644 (file)
@@ -1,92 +1,33 @@
-<Project InitialTargets="IncludeProjectReferences">
-  <Import Sdk="Microsoft.NET.Sdk" Project="Sdk.props" />
-  <Import Project="$(RepositoryEngineeringDir)coverage.props" Condition="'$(EnableCoverageSupport)' == 'true'" />
+<Project Sdk="Microsoft.Build.Traversal">
 
-  <PropertyGroup>
-    <TargetFramework>$(NetCoreAppCurrent)</TargetFramework>
-  </PropertyGroup>
+  <Import Project="$(RepositoryEngineeringDir)testing\coverage.props" Condition="'$(Coverage)' == 'true'" />
 
-  <ItemGroup Condition="'$(RuntimeFlavor)' == 'Mono'"> 
-    <ProjectExclusions Include="$(MSBuildThisFileDirectory)\System.Utf8String.Experimental\tests\System.Utf8String.Experimental.Tests.csproj" />
-  </ItemGroup>
-
-  <PropertyGroup Condition="'$(EnableCoverageSupport)' == 'true'">
+  <PropertyGroup>
+    <TestInParallel Condition="'$(Coverage)' != 'true'">true</TestInParallel>
+    <!-- For tests we want to continue running if a test run failed. -->
+    <TestContinueOnError>ErrorAndContinue</TestContinueOnError>
+    <TraversalGlobalProperties>BuildAllProjects=true</TraversalGlobalProperties>
     <CoverageReportInputPath>$(ArtifactsBinDir)*.Tests/**/coverage.xml</CoverageReportInputPath>
     <CoverageReportDir>$(ArtifactsDir)coverage</CoverageReportDir>
-    <SerializeProjects>true</SerializeProjects> 
   </PropertyGroup>
 
-  <ItemGroup Condition="'$(BuildAllConfigurations)' != 'true'">
+  <ItemGroup>
     <!-- We currently only test with C# projects. -->
-    <Project Condition="'$(DirectoryToBuild)' != ''" Include="$(DirectoryToBuild)\**\*.Tests.csproj" />
-    <Project Condition="'$(SkipTestRestore)' != 'true' and '$(DirectoryToBuild)' == ''" Include="$(MSBuildThisFileDirectory)*\tests\**\*.Tests.csproj" Exclude="@(ProjectExclusions)" />
-    <Project Condition="'$(SkipTestRestore)' == 'true' and '$(DirectoryToBuild)' == ''" Include="$(CommonTestPath)CoreFx.Private.TestUtilities\CoreFx.Private.TestUtilities.csproj" />
-    <Project Remove="$(CommonTestPath)System\Net\Prerequisites\**\*.csproj" />
-  </ItemGroup>
-
-  <ItemGroup Condition="'$(BuildAllConfigurations)' == 'true'">
-    <Project Include="$(MSBuildThisFileDirectory)pkg\test\testPackages.proj" />
+    <ProjectReference Include="$(MSBuildThisFileDirectory)*\tests\**\*.Tests.csproj"
+                      Exclude="@(ProjectExclusions)"
+                      Condition="'$(BuildAllConfigurations)' != 'true'" />
+    <ProjectReference Include="$(MSBuildThisFileDirectory)pkg\test\testPackages.proj"
+                      Condition="'$(BuildAllConfigurations)' == 'true'" />
   </ItemGroup>
 
-  <Target Name="IncludeProjectReferences">
-    <ItemGroup>
-      <ProjectReference Include="@(Project)" />
-    </ItemGroup>
-  </Target>
-
   <Target Name="GenerateCoverageReport"
-          Condition="'$(EnableCoverageSupport)' == 'true' and '$(SkipCoverageReport)' != 'true'"
-          AfterTargets="TestAllProjects"
+          Condition="'$(Coverage)' == 'true' == 'true' and '$(SkipCoverageReport)' != 'true'"
+          AfterTargets="Test"
           Inputs="$(CoverageReportInputPath)"
           Outputs="$(CoverageReportResultsPath)">
     <Exec Command="$(CoverageReportCommandLine)" />
   </Target>
 
-  <Import Project="$(RepositoryEngineeringDir)coverage.targets" Condition="'$(EnableCoverageSupport)' == 'true'" />
-  <Import Sdk="Microsoft.NET.Sdk" Project="Sdk.targets" />
-  
-  <ItemGroup>
-    <SetupProjects Include="$(MSBuildThisFileDirectory)restore\runtime\runtime.depproj" />
-    <SetupProjects Include="$(MSBuildThisFileDirectory)\pretest.proj" />
-  </ItemGroup>
-
-  <Target Name="Build" DependsOnTargets="BuildAllProjects" />
-  <Target Name="BuildAllProjects">
-    <!-- These projects are required to restore the runtime and setup testhost -->
-    <MSBuild Targets="Build"
-             Projects="@(SetupProjects)"
-             Condition="'$(DotNetBuildFromSource)' != 'true' and '$(BuildAllConfigurations)' != 'true' and '$(ContinuousIntegrationBuild)' == 'true'" 
-             BuildInParallel="false"
-             ContinueOnError="ErrorAndStop" />
-    <MSBuild Targets="Build"
-             Projects="@(Project)"
-             Properties="BuildAllProjects=true;%(Project.AdditionalProperties)"
-             BuildInParallel="true"
-             ContinueOnError="ErrorAndStop" />
-
-    <!-- Given we ErrorAndContinue we need to propagate the error if the overall task failed -->
-    <Error Condition="'$(MSBuildLastTaskResult)' == 'false'" />
-  </Target>
-
-  <Target Name="Test" DependsOnTargets="TestAllProjects" />
-  <Target Name="TestAllProjects">
-    <!-- To Serialize we use msbuild's batching functionality '%' to force it to batch all similar projects with the same identity
-         however since the project names are unique it will essentially force each to run in its own batch -->
-    <MSBuild Targets="Test"
-             Projects="@(Project)"
-             Condition="'$(SerializeProjects)' == 'true' and '%(Identity)' != ''"
-             Properties="TestAllProjects=true"
-             ContinueOnError="ErrorAndContinue" />
-
-    <MSBuild Targets="Test"
-             Projects="@(Project)"
-             Condition="'$(SerializeProjects)' != 'true'"
-             Properties="TestAllProjects=true"
-             BuildInParallel="true"
-             ContinueOnError="ErrorAndContinue" />
-
-    <!-- Given we ErrorAndContinue we need to propagate the error if the overall task failed -->
-    <Error Condition="'$(MSBuildLastTaskResult)' == 'false'" />
-  </Target>
+  <Import Project="$(RepositoryEngineeringDir)testing\coverage.targets" Condition="'$(Coverage)' == 'true'" />
 
 </Project>
index f77c6f8..6cf4495 100644 (file)
@@ -93,4 +93,9 @@
     <!-- Enables Strict mode for Roslyn compiler -->
     <Features>strict;nullablePublicOnly</Features>
   </PropertyGroup>
+
+  <PropertyGroup>
+    <MonoObjDir>$(ArtifactsObjDir)mono/$(PlatformConfigPathPart)/</MonoObjDir>
+    <MonoLLVMDir Condition="'$(MonoEnableLLVM)' == 'true' and '$(MonoLLVMDir)' == ''">$(MonoObjDir)llvm</MonoLLVMDir>  
+  </PropertyGroup>
 </Project>
index 62b0c0d..a43b35b 100644 (file)
@@ -13,7 +13,7 @@
     <PackageReference Condition="'$(TargetOS)' == 'OSX'" Include="runtime.osx.10.12-$(HostArch).Microsoft.NETCore.Runtime.Mono.LLVM.Tools" Version="$(runtimeosx1012x64MicrosoftNETCoreRuntimeMonoLLVMToolsVersion)" />
   </ItemGroup>
 
-  <Target Name="CopyLLVMToTree" AfterTargets="Restore">
+  <Target Name="CopyLLVMToTree" AfterTargets="Build">
     <ItemGroup>
       <LLVMFiles Condition="'$(TargetOS)' == 'Linux'" Include="$(NuGetPackageRoot)\runtime.linux-$(HostArch).microsoft.netcore.runtime.mono.llvm.sdk\$(runtimelinuxx64MicrosoftNETCoreRuntimeMonoLLVMSdkVersion)\tools\linux-$(HostArch)\**" />
       <LLVMFiles Condition="'$(TargetOS)' == 'Linux'" Include="$(NuGetPackageRoot)\runtime.linux-$(HostArch).microsoft.netcore.runtime.mono.llvm.tools\$(runtimelinuxx64MicrosoftNETCoreRuntimeMonoLLVMToolsVersion)\tools\linux-$(HostArch)\**" />
index 3f3f04d..55c4e17 100644 (file)
@@ -1,11 +1,7 @@
-<Project>
+<Project DefaultTargets="Build">
   <Import Project="Directory.Build.props" />
-  <Import Project="Directory.Build.targets" />
+
   <PropertyGroup>
-    <MonoObjDir>$(ArtifactsObjDir)mono/$(PlatformConfigPathPart)/</MonoObjDir>
-    <MonoEnableLLVM Condition="'$(MonoEnableLLVM)' == ''">false</MonoEnableLLVM>
-    <MonoEnableCXX Condition="'$(MonoEnableCXX)' == ''">false</MonoEnableCXX>
-    <MonoLLVMDir Condition="'$(MonoEnableLLVM)' == 'true' and '$(MonoLLVMDir)' == ''">$(MonoObjDir)llvm</MonoLLVMDir>
     <MonoCrossDir Condition="'$(MonoCrossDir)' == '' and '$(ROOTFS_DIR)' != ''">$(ROOTFS_DIR)</MonoCrossDir>
     <DotNetExec Condition="'$(OS)' == 'Windows_NT'">dotnet.exe</DotNetExec>
     <DotNetExec Condition="'$(DotNetExec)' == ''">dotnet</DotNetExec>
     <Exec Command="$(_MonoBuildCommand)" IgnoreStandardErrorWarningFormat="true" />
   </Target>
 
-  <Target Name="BuildCoreLib">
-    <MSBuild Projects="$(MonoProjectRoot)netcore\System.Private.CoreLib\System.Private.CoreLib.csproj"
-             Properties="Configuration=$(Configuration)"
-             Targets="Build" />
-  </Target>
-
-  <!-- General targets -->
-  <Target Name="Build" DependsOnTargets="BuildMonoRuntimeUnix;BuildMonoRuntimeWindows">
-    <PropertyGroup>
-      <_MonoRuntimeFilePath Condition="'$(TargetsWindows)' == 'true' and '$(Platform)' == 'x64'">$(MonoObjDir)x64\Bin\$(Configuration)\mono-2.0-sgen.dll</_MonoRuntimeFilePath>
-      <_MonoRuntimeFilePath Condition="'$(TargetsWindows)' == 'true' and '$(Platform)' == 'x86'">$(MonoObjDir)Win32\Bin\$(Configuration)\mono-2.0-sgen.dll</_MonoRuntimeFilePath>
-      <_MonoRuntimeFilePath Condition="'$(TargetsOSX)' == 'true'">$(MonoObjDir)mono\mini\.libs\libmonosgen-2.0.dylib</_MonoRuntimeFilePath>
-      <_MonoRuntimeFilePath Condition="'$(TargetsiOS)' == 'true'">$(MonoObjDir)out\lib\libmonosgen-2.0.dylib</_MonoRuntimeFilePath>
-      <_MonoRuntimeFilePath Condition="'$(TargetsAndroid)' == 'true'">$(MonoObjDir)out\lib\libmonosgen-2.0.so</_MonoRuntimeFilePath>
-      <_MonoRuntimeFilePath Condition="'$(_MonoRuntimeFilePath)' == ''">$(MonoObjDir)mono\mini\.libs\libmonosgen-2.0.so</_MonoRuntimeFilePath>
-      <_MonoRuntimeStaticFilePath Condition="'$(TargetsiOS)' == 'true' or '$(TargetsAndroid)' == 'true'">$(MonoObjDir)out\lib\libmonosgen-2.0.a</_MonoRuntimeStaticFilePath>
-      <_MonoAotCrossFilePath Condition="'$(TargetsiOS)' == 'true' and '$(Platform)' == 'arm64'">$(MonoObjDir)cross\out\bin\aarch64-darwin-mono-sgen</_MonoAotCrossFilePath>
-      <_MonoAotCrossFilePath Condition="'$(TargetsiOS)' == 'true' and '$(Platform)' == 'arm'">$(MonoObjDir)cross\out\bin\arm-darwin-mono-sgen</_MonoAotCrossFilePath>
-    </PropertyGroup>
-
-    <!-- Copy Mono runtime files to artifacts directory -->
-    <ItemGroup>
-      <_MonoRuntimeArtifacts Include="$(_MonoRuntimeFilePath)">
-        <Destination>$(BinDir)$(MonoFileName)</Destination>
-      </_MonoRuntimeArtifacts>
-      <_MonoRuntimeArtifacts Include="$(_MonoRuntimeStaticFilePath)">
-        <Destination>$(BinDir)$(MonoStaticFileName)</Destination>
-      </_MonoRuntimeArtifacts>
-      <_MonoRuntimeArtifacts Include="$(_MonoAotCrossFilePath)">
-        <Destination>$(BinDir)cross\mono-aot-cross</Destination>
-      </_MonoRuntimeArtifacts>
-      <_MonoIncludeArtifacts Include="$(MonoObjDir)out\include\**" />
-    </ItemGroup>
-
-    <Copy SourceFiles="@(_MonoRuntimeArtifacts)"
-          DestinationFiles="%(_MonoRuntimeArtifacts.Destination)"
-          SkipUnchangedFiles="true" />
-
-    <Copy SourceFiles="@(_MonoIncludeArtifacts)"
-          DestinationFiles="@(_MonoIncludeArtifacts->'$(BinDir)include\%(RecursiveDir)%(Filename)%(Extension)')"
-          SkipUnchangedFiles="true"
-          Condition="'$(TargetsiOS)' == 'true' or '$(TargetsAndroid)' == 'true'"/>
-
-    <Exec Condition="'$(TargetsOSX)' == 'true' or '$(TargetsiOS)' == 'true'" Command="install_name_tool -id @rpath/$(MonoFileName) $(BinDir)$(MonoFileName)" />
-  </Target>
-
-  <Target Name="Restore">
-    <MSBuild Projects="$(MonoProjectRoot)netcore\nuget\packages.builds" Targets="Restore" />
-    <MSBuild Condition="'$(MonoEnableLLVM)' == 'true' and '$(MonoLLVMDir)' == '$(MonoObjDir)llvm'" Projects="$(MonoProjectRoot)llvm\llvm-init.proj" Targets="Restore" Properties="MonoObjDir=$(MonoObjDir);MonoLLVMDir=$(MonoLLVMDir)" />
-  </Target>
-
-  <Target Name="Pack">
-    <MSBuild Projects="$(MonoProjectRoot)netcore\nuget\packages.builds" Targets="Build" />
-  </Target>
-
-  <Target Name="Test" />
-
   <!-- Precompile (AssembliesToPrecompile) using (MonoExec) -->
   <Target Name="PrecompileAssembly">
    <PropertyGroup>
     <Error Condition="!Exists('$(LocalDotnet)')" Text="'$(LocalDotnet)' doesn't exist." />
   </Target>
 
+  <Import Project="Directory.Build.targets" />
+
+  <!-- Ordering matters! Overwriting the Build target. -->
+  <!-- General targets -->
+  <Target Name="Build" DependsOnTargets="BuildMonoRuntimeUnix;BuildMonoRuntimeWindows">
+    <PropertyGroup>
+      <_MonoRuntimeFilePath Condition="'$(TargetsWindows)' == 'true' and '$(Platform)' == 'x64'">$(MonoObjDir)x64\Bin\$(Configuration)\mono-2.0-sgen.dll</_MonoRuntimeFilePath>
+      <_MonoRuntimeFilePath Condition="'$(TargetsWindows)' == 'true' and '$(Platform)' == 'x86'">$(MonoObjDir)Win32\Bin\$(Configuration)\mono-2.0-sgen.dll</_MonoRuntimeFilePath>
+      <_MonoRuntimeFilePath Condition="'$(TargetsOSX)' == 'true'">$(MonoObjDir)mono\mini\.libs\libmonosgen-2.0.dylib</_MonoRuntimeFilePath>
+      <_MonoRuntimeFilePath Condition="'$(TargetsiOS)' == 'true'">$(MonoObjDir)out\lib\libmonosgen-2.0.dylib</_MonoRuntimeFilePath>
+      <_MonoRuntimeFilePath Condition="'$(TargetsAndroid)' == 'true'">$(MonoObjDir)out\lib\libmonosgen-2.0.so</_MonoRuntimeFilePath>
+      <_MonoRuntimeFilePath Condition="'$(_MonoRuntimeFilePath)' == ''">$(MonoObjDir)mono\mini\.libs\libmonosgen-2.0.so</_MonoRuntimeFilePath>
+      <_MonoRuntimeStaticFilePath Condition="'$(TargetsiOS)' == 'true' or '$(TargetsAndroid)' == 'true'">$(MonoObjDir)out\lib\libmonosgen-2.0.a</_MonoRuntimeStaticFilePath>
+      <_MonoAotCrossFilePath Condition="'$(TargetsiOS)' == 'true' and '$(Platform)' == 'arm64'">$(MonoObjDir)cross\out\bin\aarch64-darwin-mono-sgen</_MonoAotCrossFilePath>
+      <_MonoAotCrossFilePath Condition="'$(TargetsiOS)' == 'true' and '$(Platform)' == 'arm'">$(MonoObjDir)cross\out\bin\arm-darwin-mono-sgen</_MonoAotCrossFilePath>
+    </PropertyGroup>
+
+    <!-- Copy Mono runtime files to artifacts directory -->
+    <ItemGroup>
+      <_MonoRuntimeArtifacts Include="$(_MonoRuntimeFilePath)">
+        <Destination>$(BinDir)$(MonoFileName)</Destination>
+      </_MonoRuntimeArtifacts>
+      <_MonoRuntimeArtifacts Include="$(_MonoRuntimeStaticFilePath)">
+        <Destination>$(BinDir)$(MonoStaticFileName)</Destination>
+      </_MonoRuntimeArtifacts>
+      <_MonoRuntimeArtifacts Include="$(_MonoAotCrossFilePath)">
+        <Destination>$(BinDir)cross\mono-aot-cross</Destination>
+      </_MonoRuntimeArtifacts>
+      <_MonoIncludeArtifacts Include="$(MonoObjDir)out\include\**" />
+    </ItemGroup>
+
+    <Copy SourceFiles="@(_MonoRuntimeArtifacts)"
+          DestinationFiles="%(_MonoRuntimeArtifacts.Destination)"
+          SkipUnchangedFiles="true" />
+
+    <Copy SourceFiles="@(_MonoIncludeArtifacts)"
+          DestinationFiles="@(_MonoIncludeArtifacts->'$(BinDir)include\%(RecursiveDir)%(Filename)%(Extension)')"
+          SkipUnchangedFiles="true"
+          Condition="'$(TargetsiOS)' == 'true' or '$(TargetsAndroid)' == 'true'"/>
+
+    <Exec Condition="'$(TargetsOSX)' == 'true' or '$(TargetsiOS)' == 'true'" Command="install_name_tool -id @rpath/$(MonoFileName) $(BinDir)$(MonoFileName)" />
+  </Target>
+
 </Project>
index e562f9f..cd45f2d 100644 (file)
   </ItemGroup>
 
   <Import Project="$(LibrariesProjectRoot)\System.Private.CoreLib\src\System.Private.CoreLib.Shared.projitems" Label="Shared" />
-  <!-- Setup ILLink.targets -->
-  <ItemGroup>
-    <PackageReference Include="ILLink.Tasks" Version="$(ILLinkTasksVersion)" ExcludeAssets="build" GeneratePathProperty="True" />
-  </ItemGroup>
 
   <Target Name="CopyCoreLibToBinDir" AfterTargets="Build">
     <Copy SourceFiles="$(BinDir)/IL/System.Private.CoreLib.dll;$(BinDir)/IL/System.Private.CoreLib.pdb"
similarity index 75%
rename from src/mono/netcore/nuget/packages.builds
rename to src/mono/netcore/nuget/mono-packages.proj
index 99c6d0a..3beffcf 100644 (file)
@@ -1,7 +1,9 @@
-<Project Sdk="Microsoft.Build.Traversal">
+<Project>
+  <Import Sdk="Microsoft.Build.Traversal" Project="Sdk.props" />
+
   <ItemGroup>
-    <ProjectReference Include="Microsoft.NETCore.Tool.MonoAOT\Microsoft.NETCore.Tool.MonoAOT.builds" Condition="'$(TargetsiOS)' == 'true' and '$(TargetsiOSSimulator)' != 'true'" />
-    <ProjectReference Include="Microsoft.NETCore.Runtime.Mono\Microsoft.NETCore.Runtime.Mono.builds" />
+    <ProjectReference Include="Microsoft.NETCore.Tool.MonoAOT\Microsoft.NETCore.Tool.MonoAOT.proj" Condition="'$(TargetsiOS)' == 'true' and '$(TargetsiOSSimulator)' != 'true'" />
+    <ProjectReference Include="Microsoft.NETCore.Runtime.Mono\Microsoft.NETCore.Runtime.Mono.proj" />
   </ItemGroup>
 
   <!-- Generate a version.txt file we include in our packages
     <ItemGroup>
       <!-- Pass the FileVersion calculated by _InitializeAssemblyVersion to referenced projects -->
       <ProjectReference Update="@(ProjectReference)"
-                        AdditionalProperties="%(AdditionalProperties);FileVersion=$(FileVersion)" />
+                        AdditionalProperties="%(ProjectReference.AdditionalProperties);FileVersion=$(FileVersion)" />
     </ItemGroup>
   </Target>
+
+  <Import Sdk="Microsoft.Build.Traversal" Project="Sdk.targets" />
+
+  <!-- Ordering matters! Overwriting the Pack target which should just invoke Build. -->
+  <Target Name="Pack" DependsOnTargets="Build" />
 </Project>