Skip to content

Commit 42183b1

Browse files
authored
Enable restore for ref and src projects in libs (#33553)
- Use RestoreUseStaticGraphEvaluation which improves no-op restore by 10-15x down to 10-20 seconds. - .builds msbuild files renamed to .proj as RestoreUseStaticGraphEvaluation throws for non .proj files without an env var set. - Introducing subsets for libraries and mono and replacing -buildtests switch which was only working for libraries in favor of the subset switch -subset tests which works consistently. - Fixing the Microsoft.DotNet.CodeAnalysis analyzer which wasn't running and adding missing exclusions. - Separating restore and build phases in different parts in the repo (ie for installer.tasks) as generated props and targets need to be imported which requires a reevaluation in the build phase. - Fix eng/docker/build-docker-sdk.ps1 by using the official build entrypoints (cc @alnikola) - Remove a few depprojs in favor of project restore (faster restore :)) - Fix root code coverage measurement not working correctly - Traversal support instead of dir.traversal.targets or manual build target defines. - Introduce a root Build.proj entrypoint which is responsible for building and restoring the repository. This is necessary to enable the new NuGet fast restore which works best and fastest with a single entrypoint. - Avoid binclashes in libraries and between libraries and installer (netstandard.depproj vs netstandard.csproj) - Upgrading the SDK to 5.0 latest - Code cleanup
1 parent 59ca590 commit 42183b1

File tree

105 files changed

+798
-1161
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+798
-1161
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ bld/
2727
msbuild.log
2828
msbuild.err
2929
msbuild.wrn
30-
msbuild.binlog
30+
*.binlog
3131
.deps/
3232
.dirstamp
3333
.libs/

Build.proj

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
<Project Sdk="Microsoft.Build.Traversal">
2+
3+
<!--
4+
Subsets are already imported by Directory.Build.props.
5+
Reference the projects for traversal build. Ordering matters here.
6+
-->
7+
<ItemGroup>
8+
<ProjectReference Include="@(CoreClrProject)" />
9+
<ProjectReference Include="@(MonoProject)" />
10+
<ProjectReference Include="@(LibrariesProject)" />
11+
<ProjectReference Include="@(InstallerProject)" />
12+
</ItemGroup>
13+
14+
<!--
15+
Exclude installer depproj and pkgproj from static graph restore. We restore them below.
16+
Remove when https://github.com/NuGet/Home/issues/9398 is fixed.
17+
-->
18+
<ItemGroup Condition="'$(MSBuildRestoreSessionId)' != ''">
19+
<ProjectReference Remove="@(DepprojProjectToBuild)" />
20+
<ProjectReference Remove="@(PkgprojProjectToBuild)" />
21+
<ProjectReference Remove="@(BundleProjectToBuild)" />
22+
</ItemGroup>
23+
24+
<!-- Custom arcade target which isn't available in Microsoft.Build.Traversal. -->
25+
<Target Name="Rebuild" DependsOnTargets="Clean;Build" />
26+
27+
<Import Project="$(RepositoryEngineeringDir)SubsetValidation.targets" />
28+
29+
<!-- Upfront restore hooks -->
30+
<Import Project="$(RepositoryEngineeringDir)restore\docs.targets" Condition="'$(DotNetBuildFromSource)' != 'true'" />
31+
<Import Project="$(RepositoryEngineeringDir)restore\optimizationData.targets" Condition="'$(DotNetBuildFromSource)' != 'true' and '$(EnableNgenOptimization)' == 'true'" />
32+
<Import Project="$(RepositoryEngineeringDir)restore\runtimeprops.targets" />
33+
34+
<!--
35+
Use synthetic inputs/outputs to avoid building it all the time. This should let devs build with
36+
MSBuild node reuse enabled (the Arcade default). If it were built every time, it would hit file
37+
locking issues vs. the persistent nodes that loaded the task DLL for the previous build. It
38+
isn't particularly accurate, but better than nothing.
39+
-->
40+
<Target Name="BuildRepoTasks"
41+
DependsOnTargets="GetRepoTasksSrc"
42+
BeforeTargets="Restore"
43+
Inputs="@(RepoTasksSrc)"
44+
Outputs="$(RepoTasksOutputFile)">
45+
<ItemGroup>
46+
<RepoTaskProjects Include="$(RepoTasksDir)**\*.csproj" />
47+
</ItemGroup>
48+
49+
<MSBuild Projects="@(RepoTaskProjects)"
50+
Properties="MSBuildRestoreSessionId=$([System.Guid]::NewGuid());Configuration=Debug;Platform=AnyCPU"
51+
Targets="Restore"/>
52+
53+
<MSBuild Projects="@(RepoTaskProjects)"
54+
Properties="Configuration=Debug;Platform=AnyCPU"
55+
Targets="Build"/>
56+
57+
<WriteLinesToFile File="$(RepoTasksOutputFile)"
58+
Lines="$(RepoTasksOutputFile)"
59+
Overwrite="true" />
60+
</Target>
61+
62+
<Target Name="GetRepoTasksSrc">
63+
<PropertyGroup>
64+
<RepoTasksDir>$(RepoTasksDir)</RepoTasksDir>
65+
<RepoTasksOutputFile>$(ArtifactsObjDir)runtime.tasks\Debug\build-semaphore.txt</RepoTasksOutputFile>
66+
</PropertyGroup>
67+
68+
<ItemGroup>
69+
<RepoTasksSrc Include="$(RepoTasksDir)**\*.cs*" />
70+
</ItemGroup>
71+
</Target>
72+
73+
<Target Name="RestoreWithoutStaticGraph"
74+
BeforeTargets="Restore">
75+
<MSBuild Projects="@(LibrariesRestoreProject);@(DepprojProjectToBuild);@(PkgprojProjectToBuild);@(BundleProjectToBuild)"
76+
Properties="MSBuildRestoreSessionId=$([System.Guid]::NewGuid());RestoreUseStaticGraphEvaluation=false"
77+
Targets="Restore" />
78+
</Target>
79+
80+
</Project>

Directory.Build.props

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,7 @@
2727
<ArtifactsObjDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsDir)', 'obj'))</ArtifactsObjDir>
2828
</PropertyGroup>
2929

30-
<!-- The TFMs to build and test against. -->
31-
<PropertyGroup>
32-
<NETCoreAppCurrentVersion>5.0</NETCoreAppCurrentVersion>
33-
<NetCoreAppCurrentTargetFrameworkMoniker>.NETCoreApp,Version=v$(NETCoreAppCurrentVersion)</NetCoreAppCurrentTargetFrameworkMoniker>
34-
<NetCoreAppCurrent>netcoreapp$(NETCoreAppCurrentVersion)</NetCoreAppCurrent>
35-
<NetFrameworkCurrent>net472</NetFrameworkCurrent>
36-
</PropertyGroup>
37-
30+
<!-- Configuration properties which are needed in both the (isolated) restore and build phases. -->
3831
<Import Project="$(RepositoryEngineeringDir)Configurations.props" />
3932

4033
<!--

docs/coding-guidelines/package-projects.md

Lines changed: 2 additions & 160 deletions
Original file line numberDiff line numberDiff line change
@@ -55,164 +55,6 @@ Sample `System.Collections.Concurrent.pkgproj`
5555
</Project>
5656
```
5757

58-
### Framework-specific library
59-
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.
60-
61-
Sample System.Net.Security.pkgproj
62-
```
63-
<Project DefaultTargets="Build">
64-
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))" />
65-
<ItemGroup>
66-
<ProjectReference Include="..\ref\System.Net.Security.builds">
67-
<SupportedFramework>net463;netcoreapp1.1;$(AllXamarinFrameworks)</SupportedFramework>
68-
</ProjectReference>
69-
<ProjectReference Include="..\src\System.Net.Security.builds" />
70-
</ItemGroup>
71-
<ItemGroup>
72-
<InboxOnTargetFramework Include="MonoAndroid10" />
73-
<InboxOnTargetFramework Include="MonoTouch10" />
74-
<InboxOnTargetFramework Include="xamarinios10" />
75-
<InboxOnTargetFramework Include="xamarinmac20" />
76-
<InboxOnTargetFramework Include="xamarintvos10" />
77-
<InboxOnTargetFramework Include="xamarinwatchos10" />
78-
79-
<NotSupportedOnTargetFramework Include="netcore50">
80-
<PackageTargetRuntime>win7</PackageTargetRuntime>
81-
</NotSupportedOnTargetFramework>
82-
</ItemGroup>
83-
<ItemGroup>
84-
</ItemGroup>
85-
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.targets))" />
86-
</Project>
87-
```
88-
89-
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:
90-
91-
```
92-
<Project DefaultTargets="Build">
93-
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))" />
94-
<PropertyGroup>
95-
<OutputType>Library</OutputType>
96-
<NuGetTargetMoniker>.NETStandard,Version=v1.7</NuGetTargetMoniker>
97-
<DefineConstants Condition="'$(TargetFramework)' == 'netcoreapp1.1'">$(DefineConstants);netcoreapp11</DefineConstants>
98-
</PropertyGroup>
99-
<ItemGroup>
100-
<Compile Include="System.Net.Security.cs" />
101-
<Compile Include="System.Net.Security.Manual.cs" />
102-
</ItemGroup>
103-
<ItemGroup>
104-
<None Include="project.json" />
105-
</ItemGroup>
106-
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.targets))" />
107-
</Project>
108-
```
109-
110-
Conditional compilation using the above-mentioned constant (from `ref\System.Net.Security.cs`):
111-
112-
```
113-
#if NETCOREAPP
114-
public virtual void AuthenticateAsClient(string targetHost, System.Security.Cryptography.X509Certificates.X509CertificateCollection clientCertificates, bool checkCertificateRevocation) { }
115-
#endif
116-
```
117-
118-
Sample \src .builds file (in this case the implementation is the same in both netcoreapp1.1 and netstandard1.7):
119-
120-
```
121-
<Project DefaultTargets="Build">
122-
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))" />
123-
<ItemGroup>
124-
<Project Include="System.Net.Security.csproj">
125-
<OSGroup>Unix</OSGroup>
126-
</Project>
127-
<Project Include="System.Net.Security.csproj">
128-
<OSGroup>Windows_NT</OSGroup>
129-
</Project>
130-
<Project Include="System.Net.Security.csproj">
131-
<TargetFramework>net463</TargetFramework>
132-
</Project>
133-
</ItemGroup>
134-
<Import Project="$(RepositoryEngineeringDir)dir.traversal.targets" />
135-
</Project>
136-
```
137-
138-
Tests can be similarly filtered grouping the compilation directives under:
139-
```
140-
<ItemGroup Condition="'$(TargetFramework)'=='netcoreapp1.1'">
141-
```
142-
(from `\tests\FunctionalTests\System.Net.Security.Tests.csproj`)
143-
144-
### Platform-specific library
145-
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.
146-
147-
Sample `System.IO.FileSystem.pkgproj`
148-
```
149-
<Project DefaultTargets="Build">
150-
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))" />
151-
<ItemGroup>
152-
<ProjectReference Include="..\ref\System.IO.FileSystem.csproj">
153-
<SupportedFramework>net46;netcore50;netcoreapp1.0</SupportedFramework>
154-
</ProjectReference>
155-
<ProjectReference Include="..\src\Facade\System.IO.FileSystem.csproj" />
156-
<ProjectReference Include="win\System.IO.FileSystem.pkgproj" />
157-
<ProjectReference Include="unix\System.IO.FileSystem.pkgproj" />
158-
159-
<InboxOnTargetFramework Include="MonoAndroid10" />
160-
<InboxOnTargetFramework Include="MonoTouch10" />
161-
<InboxOnTargetFramework Include="xamarinios10" />
162-
<InboxOnTargetFramework Include="xamarinmac20" />
163-
</ItemGroup>
164-
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.targets))" />
165-
</Project>
166-
```
167-
168-
`win/System.IO.FileSystem.pkgproj`
169-
```
170-
<Project DefaultTargets="Build">
171-
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))" />
172-
173-
<PropertyGroup>
174-
<PackageTargetRuntime>win7</PackageTargetRuntime>
175-
<PreventImplementationReference>true</PreventImplementationReference>
176-
</PropertyGroup>
177-
178-
<ItemGroup>
179-
<ProjectReference Include="..\..\src\System.IO.FileSystem.builds">
180-
<AdditionalProperties>OSGroup=Windows_NT</AdditionalProperties>
181-
</ProjectReference>
182-
183-
<!-- No implementation on platforms where our P-Invokes are not allowed -->
184-
<NotSupportedOnTargetFramework Include="win8" />
185-
<NotSupportedOnTargetFramework Include="wp8" />
186-
<NotSupportedOnTargetFramework Include="wpa81" />
187-
188-
<!-- don't use the dotnet implementation for any version of desktop, it's implementation comes from the reference package -->
189-
<ExternalOnTargetFramework Include="net" />
190-
</ItemGroup>
191-
192-
193-
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.targets))" />
194-
</Project>
195-
```
196-
`unix/System.IO.FileSystem.pkgproj`
197-
```
198-
<Project DefaultTargets="Build">
199-
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))" />
200-
201-
<PropertyGroup>
202-
<PackageTargetRuntime>unix</PackageTargetRuntime>
203-
<PreventImplementationReference>true</PreventImplementationReference>
204-
</PropertyGroup>
205-
206-
<ItemGroup>
207-
<ProjectReference Include="..\..\src\System.IO.FileSystem.builds">
208-
<AdditionalProperties>OSGroup=Linux</AdditionalProperties>
209-
</ProjectReference>
210-
</ItemGroup>
211-
212-
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.targets))" />
213-
</Project>
214-
```
215-
21658
## Asset selection
21759

21860
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
22163

22264
The primary thing that the library author needs to do in order to ensure the correct asset selection is:
22365

224-
1. Configure the correct projects in your library's `.builds` file.
225-
2. Reference the `.builds` file from the package project.
66+
1. Configure the correct projects in your library's `.proj` file.
67+
2. Reference the `.proj` file from the package project.
22668
3. Provide a default PackageTargetFramework for empty-BuildTargetFramework builds in the library's `.csproj` or `.vbproj`.
22769
```
22870
<PackageTargetFramework Condition="'$(PackageTargetFramework)' == ''">dotnet5.4</PackageTargetFramework>

docs/coding-guidelines/project-guidelines.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ once before you can iterate and work on a given library project.
1010
- Netstandard Library - Copy to `bin\ref\netstandard2.0`
1111
- NetFx targeting pack - Copy to `bin\ref\net472`
1212
- Build targeting pack
13-
- Build src\ref.builds which builds all references assembly projects. For reference assembly project information see [ref](#ref)
13+
- Build src\libraries\ref.proj which builds all references assembly projects. For reference assembly project information see [ref](#ref)
1414
- Build product
15-
- Build src\src.builds which builds all the source library projects. For source library project information see [src](#src).
15+
- Build src\libraries\src.proj which builds all the source library projects. For source library project information see [src](#src).
1616
- Sign product
1717
- Build src\sign.proj
1818

docs/project/library-servicing.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ Where the `AssemblyVersion` is set to the old version before updating. To determ
3333

3434
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"`.
3535

36-
## Add your package to packages.builds
36+
## Add your package to libraries-packages.proj
3737

38-
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.
38+
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.
3939

4040
## Test your changes
4141

docs/workflow/building/libraries/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,9 @@ The build settings (BuildTargetFramework, TargetOS, Configuration, Architecture)
8181

8282
For more details on the build settings see [project-guidelines](../../../coding-guidelines/project-guidelines.md#build-pivots).
8383

84-
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.
84+
If you invoke the `build` script without any actions, the default action chain `-restore -build` is executed.
8585

86-
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`.
86+
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`.
8787

8888
**Examples**
8989
- 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
9393

9494
- Building the src assemblies and build and run tests (running all tests takes a considerable amount of time!)
9595
```bash
96-
./build.sh -subsetCategory libraries -restore -build -buildtests -test
96+
./build.sh -subsetCategory libraries -restore -build -test
9797
```
9898

9999
- Building for different target frameworks (restore and build are implicit again as no action is passed in)

docs/workflow/debugging/libraries/debugging-packages.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Assuming the current directory is `\src\contractname\`:
2525

2626
Check the logs for output such as:
2727
```
28-
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
28+
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
2929
(Build target(s)).
3030
3131
[...]
@@ -37,7 +37,7 @@ CopyFilesToOutputDirectory:
3737
3838
[...]
3939
40-
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
40+
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
4141
(Build target(s)).
4242
4343
[...]
@@ -86,7 +86,7 @@ Ensure that the right `BuildTargetFramework` (what we're testing) is set.
8686
To identify which of the combinations failed, search for the following pattern in the output:
8787

8888
```
89-
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"
89+
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"
9090
(2:5) on node 1 (Build target(s)).
9191
ResolvePkgProjReferences:
9292
Resolved compile assets from .NETStandard,Version=v2.0: S:\c1\bin\ref\System.Net.ServicePoint\4.0.0.0\System.Net.ServicePoint.dll

docs/workflow/testing/libraries/testing.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ To build the tests and run them you can call the libraries build script.
77
**Examples**
88
- The following shows how to build only the tests but not run them:
99
```
10-
libraries -buildtests
10+
libraries -subset libtests
1111
```
1212

1313
- The following builds and runs all tests in release configuration:
@@ -20,17 +20,15 @@ libraries -test -c Release
2020
libraries -test /p:WithoutCategories=IgnoreForCI
2121
```
2222

23-
Unless you specifiy `/p:TestNoBuild=true`, test assemblies are implicitly built when invoking the `Test` target.
23+
Unless you specifiy `-testnobuild`, test assemblies are implicitly built when invoking the `Test` action.
2424
- The following shows how to only test the libraries without building them
2525
```
26-
libraries -test /p:TestNoBuild=true
26+
libraries -test -testnobuild
2727
```
2828

2929
## Running tests on the command line
3030

31-
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).
32-
33-
If you are interested in building and running the tests only for a specific library, then there are two different ways to do it:
31+
To build tests you need to specify the `test` subset when invoking build.cmd/sh: `libraries -subset libtests`.
3432

3533
The easiest (and recommended) way to build and run the tests for a specific library, is to invoke the `Test` target on that library:
3634
```cmd

0 commit comments

Comments
 (0)