1
0
Fork 0
mirror of https://github.com/VSadov/Satori.git synced 2025-06-08 11:37:04 +09:00

Clean-up pkgproj leftovers in libs and apply fixes (#56899)

* Clean-up pkgproj leftovers in libs and apply fixes

Remove any pkgproj infrastructure that was only used by src/libraries
(which is the majority). Delete the packageindex *YAY*.
Update the documentation that covered the packageindex and the pkgprojs.

Avoid any incremental builds during packaging by removing
libraries-packages.proj and use src.proj for packaging instead. Make use
of the `GeneratePackageOnBuild` property to build package during the
allconfigurations without requiring a different entry target.

Fix the addition of the DocumentationFile during packaging when
`GeneratePackageOnBuid` is used by hooking onto the
`DocumentationProjectOutputGroup` that NuGet uses and replacing the
generated documentation file with the one that comes via the
intellisense package.
Also introduce a property to choose the generated documentation file
over the one from the intellisense package:
<UseIntellisenseDocumentationFile>false</UseIntellisenseDocumentationFile>

Removing a few leftover PackageDescription properties from the projects'
Directory.Build.props file.

Cleaning up properties in Directory.Build.props & Directory.Build.targets
files.

* Actually run packaging during the allconfigurations build

* Update docs

* make runtime specific pkgs non packable

* io.ports native pkg fixes
This commit is contained in:
Viktor Hofer 2021-08-06 12:01:36 +02:00 committed by GitHub
parent 3602be5ae2
commit 22cee85aa0
Signed by: github
GPG key ID: 4AEE18F83AFDEB23
33 changed files with 118 additions and 8640 deletions

View file

@ -54,8 +54,6 @@
<PackageDescription Condition="'$(PackageDescription)' == '' and '$(UseRuntimePackageDisclaimer)' == 'true'">$(RuntimePackageDisclaimer)</PackageDescription> <PackageDescription Condition="'$(PackageDescription)' == '' and '$(UseRuntimePackageDisclaimer)' == 'true'">$(RuntimePackageDisclaimer)</PackageDescription>
<!-- Keep in sync as required by the Packaging SDK in Arcade. --> <!-- Keep in sync as required by the Packaging SDK in Arcade. -->
<Description>$(PackageDescription)</Description> <Description>$(PackageDescription)</Description>
<!-- BeforePack hook should be removed after porting all the projects to dotnet pack. -->
<BeforePack>$(BeforePack);AddNETStandardCompatErrorFileForPackaging</BeforePack>
<GenerateNuspecDependsOn>AddNETStandardCompatErrorFileForPackaging;$(GenerateNuspecDependsOn)</GenerateNuspecDependsOn> <GenerateNuspecDependsOn>AddNETStandardCompatErrorFileForPackaging;$(GenerateNuspecDependsOn)</GenerateNuspecDependsOn>
</PropertyGroup> </PropertyGroup>

View file

@ -29,12 +29,6 @@ should be added to `net5.0`. [More Information on TargetFrameworks](https://docs
## Making the changes in repo ## Making the changes in repo
**Update pkg**
- If changing the target framework
- Update `SupportedFramework` metadata on the ref ProjectReference to declare the set of concrete platforms you expect your library to support. (see [Specific platform mappings][net-standard table]). Generally will be a combination of netcoreapp2.x, netfx46x, and/or `$(AllXamarinFrameworks)`.
- If assembly or package version is updated the package index needs to be updated by running
`dotnet build <Library>/pkg/<Library>.pkgproj /t:UpdatePackageIndex`
**Update tests** **Update tests**
- Add new `TargetFramework` to the ```TargetFrameworks```. - Add new `TargetFramework` to the ```TargetFrameworks```.
- Add new test code following [conventions](project-guidelines.md#code-file-naming-conventions) for new files to that are specific to the new target framework. - Add new test code following [conventions](project-guidelines.md#code-file-naming-conventions) for new files to that are specific to the new target framework.
@ -52,10 +46,6 @@ Once the dotnet-api-docs change is merged, your comments will start showing up i
Once the documentation is official, any subsequent updates to it must be made directly in https://github.com/dotnet/dotnet-api-docs/. It's fine to make updates to the triple slash comments later, they just won't automatically flow into the official docs. Once the documentation is official, any subsequent updates to it must be made directly in https://github.com/dotnet/dotnet-api-docs/. It's fine to make updates to the triple slash comments later, they just won't automatically flow into the official docs.
## FAQ ## FAQ
_**How do I consume APIs from another package that aren't yet published?**_
If you are adding APIs across multiple packages at the same time. You can temporarily add a direct
ProjectReference from the ref\csproj to the ref\csproj, src\csproj to the ref\csproj, and/or tests\csproj to pkg\pkgproj. Once a new set of packages have been published these ProjectReferences should be removed.
_**What to do if you are moving types down into a lower contract?**_ _**What to do if you are moving types down into a lower contract?**_

View file

@ -2,11 +2,11 @@
Libraries can be packaged in one or more of the following ways: as part of the .NETCore shared framework, part of a transport package, or as a NuGet package. Libraries can be packaged in one or more of the following ways: as part of the .NETCore shared framework, part of a transport package, or as a NuGet package.
## .NETCore Shared framework ## .NETCoreApp shared framework
To add a library to the .NETCore shared framework, that library's `AssemblyName` should be added to [NetCoreAppLibrary.props](../../src/libraries/NetCoreAppLibrary.props) To add a library to the .NETCoreApp shared framework, that library's `AssemblyName` should be added to [NetCoreAppLibrary.props](../../src/libraries/NetCoreAppLibrary.props)
The library should have both a `ref` and `src` project. Its reference assembly will be included in the ref-pack for the Microsoft.NETCore.App shared framework, and its implementation assembly will be included in the runtime pack. The library should have both a `ref` and `src` project. Its reference assembly will be included in the targeting pack (also called ref pack) for the Microsoft.NETCore.App shared framework, and its implementation assembly will be included in the runtime pack.
Including a library in the shared framework only includes the best applicable TargetFramework build of that library: `$(NetCoreAppCurrent)` if it exists, but possibly `netstandard2.1` or another if that is best. If a library has builds for other frameworks those will only be shipped if the library also produces a [Nuget package](#nuget-package). Including a library in the shared framework only includes the best applicable TargetFramework build of that library: `$(NetCoreAppCurrent)` if it exists, but possibly `netstandard2.1` or another if that is best. If a library has builds for other frameworks those will only be shipped if the library also produces a [Nuget package](#nuget-package).
@ -36,7 +36,7 @@ Removing a library from this transport package is a breaking change and should b
## NuGet package ## NuGet package
Libraries to be packaged must be referenced by the [traversal packaging project](../../src/libraries/libraries-packages.proj) and set `IsPackable` to true. By default, all `Libraries/*/src` projects are considered for packaging. Libraries to be packaged must set `IsPackable` to true. By default, all `libraries/*/src` projects are considered for packaging.
Package versions and shipping state should be controlled using the properties defined by the [Arcade SDK](https://github.com/dotnet/arcade/blob/master/Documentation/ArcadeSdk.md#project-properties-defined-by-the-sdk). Typically libraries should not need to explicitly set any of these properties. Package versions and shipping state should be controlled using the properties defined by the [Arcade SDK](https://github.com/dotnet/arcade/blob/master/Documentation/ArcadeSdk.md#project-properties-defined-by-the-sdk). Typically libraries should not need to explicitly set any of these properties.

View file

@ -1,163 +0,0 @@
# Package projects
** IMPORTANT ** Package projects are in the process of being deprecated, please do not create new package projects. Instead use normal projects (csproj) following the guidelines here: [libraries-packaging](libraries-packaging.md)
Package projects bring together all the assemblies that make up a library on different platforms into a set of NuGet packages.
## Package hierarchy
All libraries should have at least one package if they represent public surface area. This is called the *reference package* and is named the same as the library's assembly, EG: System.Collections.Immutable.
Packages may have platform specific implementation packages. These are referred to as *runtime packages* and follow the naming convention of runtime.{rid}.{assemblyName}, EG: runtime.unix.System.IO.FileSystem.
In either case the file name of the `.pkgproj` is just {assemblyName}.pkgproj and package names are derived from the contents of the project.
## Package samples
### Simple portable library
This is the simplest case. The package project need only reference the single project that implements the portable library.
Sample `System.Text.Encodings.Web.pkgproj`
```
<Project DefaultTargets="Build">
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))" />
<ItemGroup>
<ProjectReference Include="..\src\System.Text.Encodings.Web.csproj">
<SupportedFramework>net45;netcore45;wp8;wpa81;netcoreapp1.0</SupportedFramework>
</ProjectReference>
</ItemGroup>
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.targets))" />
</Project>
```
### Portable library, inbox on some platforms
These packages need to include placeholders for inbox platforms. They should also include reference assemblies for representing the fixed API that is inbox in old platforms.
Sample `System.Collections.Concurrent.pkgproj`
```
<Project DefaultTargets="Build">
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))" />
<ItemGroup>
<ProjectReference Include="..\ref\4.0.0\System.Collections.Concurrent.depproj">
<SupportedFramework>net45;netcore45;wpa81</SupportedFramework>
</ProjectReference>
<ProjectReference Include="..\ref\System.Collections.Concurrent.csproj">
<SupportedFramework>net46;netcore50;netcoreapp1.0</SupportedFramework>
</ProjectReference>
<ProjectReference Include="..\src\System.Collections.Concurrent.csproj"/>
<InboxOnTargetFramework Include="MonoAndroid10" />
<InboxOnTargetFramework Include="MonoTouch10" />
<InboxOnTargetFramework Include="net45" />
<InboxOnTargetFramework Include="win8" />
<InboxOnTargetFramework Include="wpa81" />
<InboxOnTargetFramework Include="xamarinios10" />
<InboxOnTargetFramework Include="xamarinmac20" />
</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/.
Asset projects (`.csproj`, `.vbproj`, or `.depproj`) can control their `{targetMoniker}` using the `PackageTargetFramework` property in the project file. Similarly `{rid}` is controlled using the `PackageTargetRuntime` property. For the libraries we automatically select default values for these properties based on the build pivots. These can be overridden in the project reference using metadata of the same name, but this is rarely needed.
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 `.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>
```
### Which version of dotnet/netstandard should I select?
TL;DR - choose the lowest version that doesn't result in build errors for both the library projects and package project.
NETStandard/DotNet are *open* ended portable identifiers. They allow a package to place an asset in a folder and that asset can be reused on any framework that supports that version of NETStandard/DotNet. This is in contrast to the previous *closed* set portable-a+b+c identifiers which only applied to the frameworks listed in the set. For more information see [.NET Standard](https://github.com/dotnet/standard/blob/master/docs/faq.md).
Libraries should select a version of DotNet/NETStandard that supports the most frameworks. This means the library should choose the lowest version that provides all the API needed to implement their functionality. Eventually this will be the same moniker used for package resolution in the library project, AKA in `frameworks` section for the libraries project.json.
In dotnet/runtime we don't always use the package resolution for dependencies, sometimes we must use project references. Additionally we aren't building all projects with the NETStandard/DotNet identifier. This issue is tracked with https://github.com/dotnet/runtime/issues/14876. As a result we calculate the version as an added safeguard based on seeds. These seeds are listed in [Generations.json](https://github.com/dotnet/buildtools/blob/master/src/Microsoft.DotNet.Build.Tasks.Packaging/src/PackageFiles/Generations.json) and rarely change. They are a record of what libraries shipped in-box and are unchangeable for a particular framework supporting a generation. Occasionally an API change can be made even to these in-box libraries and shipped out-of-band, for example by adding a new type and putting that type in a hybrid facade. This is the only case when it is permitted to update Generations.json.
In addition to the minimum API version required by implementation, reference assemblies should only claim the NETStandard/DotNet version of the minimum implementation assembly. Just because a reference assembly only depends on API in NETStandard1.0, if its implementations only apply to frameworks supporting NETStandard1.4, it should use NETStandard1.4.
### .NET Framework facades
.NET Framework facades must be part of the reference package. This is because if we were to use the reference assembly on desktop it would have type collisions with whatever types already exist in the desktop reference assemblies. Since we include the desktop reference facade in the reference package we also include the runtime facade in the same package for compression savings.
## Applicability validation
Part of package build is to ensure that a package is applicable on all platforms it supports and not applicable on platforms it does not support. We do this validation for a set of targets established in the packaging tools (see [DefaultValidateFramework](https://github.com/dotnet/buildtools/blob/9f4ddda1cb021c9bd25f606bc4e74b92e4b82869/src/Microsoft.DotNet.Build.Tasks.Packaging/src/PackageFiles/Packaging.targets#L709)). Package projects identify the targets supported in one of two ways.
1. **Preferred:** Through `SupportedFramework` metadata on the project reference. The metadata will associate the API version of that project reference with the frameworks listed.
```
<ProjectReference Include="..\ref\4.0.0\System.Collections.Concurrent.depproj">
<SupportedFramework>net45;netcore45;wpa81</SupportedFramework>
</ProjectReference>
<ProjectReference Include="..\ref\System.Collections.Concurrent.csproj">
<SupportedFramework>net46;netcore50;netcoreapp1.0</SupportedFramework>
</ProjectReference>
```
2. Through SupportedFramework items with Version metadata.
```
<!-- no version indicates latest is supported -->
<SupportedFramework Include="net46;netcore50;netcoreapp1.0" />
<!-- specific version indicates that version is supported -->
<SupportedFramework Include="net45;netcore45;wpa81">
<Version>4.0.0.0</Version>
</SupportedFramework>
```
### Inbox assets
Some libraries are supported inbox on particular frameworks. For these frameworks the package should not present any assets for (ref or lib) for that framework, but instead permit installation and provide no assets. We do this in the package by using placeholders ref and lib folders for that framework. In the package project one can use `InboxOnTargetFramework` items. The following is an example from the System.Linq.Expressions package.
```
<InboxOnTargetFramework Include="net45" />
<InboxOnTargetFramework Include="win8" />
<InboxOnTargetFramework Include="wp80" />
<InboxOnTargetFramework Include="wpa81" />
```
If the library is also a "classic" reference assembly, not referenced by default, then adding the `AsFrameworkReference` metadata will instruct that the package include a `frameworkReference` element in the nuspec. The following is the an example from the Microsoft.CSharp package.
```
<InboxOnTargetFramework Include="net45">
<AsFrameworkReference>true</AsFrameworkReference>
</InboxOnTargetFramework>
<InboxOnTargetFramework Include="win8" />
<InboxOnTargetFramework Include="wp80" />
<InboxOnTargetFramework Include="wpa81" />
```
Package validation will catch a case where we know a library is supported inbox but a package is using an asset from the package. This data is driven by framework lists from previously-shipped targeting packs. The error will appear as: *Framework net45 should support Microsoft.CSharp inbox but {explanation of problem}. You may need to add <InboxOnTargetFramework Include="net45" /> to your project.*
### External assets
Runtime specific packages are used to break apart implementations into separate packages and enable "pay-for-play". For example: don't download the Windows implementation if we're only building/deploying for linux. In most cases we can completely separate implementations into separate packages such that they easily translate. For example:
```
runtimes/win/lib/dotnet5.4/System.Banana.dll
runtimes/unix/lib/dotnet5.4/System.Banana.dll
```
This can easily be split into a `win` and `unix` package. If someone happens to install both packages into a project they'll still get a single implementation.
Consider the following:
```
runtimes/win/lib/dotnet5.4/System.Banana.dll
runtimes/win/lib/net46/System.Banana.dll
```
Suppose we wanted to split the desktop (`net46`) implementation into a separate package than the portable implementation. Doing so would cause both the `dotnet5.4` asset and the `net46` asset to be applicable and result in a bin-clash. This is because in a single package the `net46` asset is preferred over the `dotnet5.4` asset, but in separate packages both are in view. The packaging validation will catch this problem and display an error such as
*System.Banana includes both package1/runtimes/win/lib/net46/System.Banana.dll and package2/runtimes/win/lib/dotnet5.4/System.Banana.dll an on net46 which have the same name and will clash when both packages are used.*
The fix for the error is to put a placeholder in the package that contains the asset we want to prevent applying. This can be done with the following syntax.
```
<ExternalOnTargetFramework Include="net46" />
```
### Not supported
In rare cases a particular library might represent itself as targeting a specific portable moniker (eg: `dotnet5.4`) but it cannot be supported on a particular target framework that is included in that portable moniker for other reasons. One example of this is System.Diagnostics.Process. The surface area of this API is portable to dotnet5.4 and could technically run in UWP based on its managed dependencies. The native API, however, is not supported in app container. To prevent this package and packages which depend on from installing in UWP projects, only to fail at runtime, we can block the package from being installed.
To do this we create a placeholder in the lib folder with the following syntax. The resulting combination will be an applicable ref asset with no applicable lib and NuGet's compat check will fail.
```
<NotSupportedOnTargetFramework Include="net46" />
```
The packaging validation will catch this problem and display an error such as
*System.Diagnostics.Process should not be supported on netcore50 but has both compile and runtime assets.*

View file

@ -151,9 +151,6 @@ All src outputs are under
`bin\$(MSBuildProjectName)\$(TargetFramework)` `bin\$(MSBuildProjectName)\$(TargetFramework)`
## pkg
In the pkg directory for the library there should be only **one** `.pkgproj` for the primary package for the library. If the library has platform-specific implementations those should be split into platform specific projects in a subfolder for each platform. (see [Package projects](./package-projects.md))
## tests ## tests
Similar to the src projects tests projects will define a `TargetFrameworks` property so they can list out the set of target frameworks they support. Similar to the src projects tests projects will define a `TargetFrameworks` property so they can list out the set of target frameworks they support.

View file

@ -2,21 +2,19 @@
This document provides the steps necessary after modifying a library in a servicing branch (where "servicing branch" refers to any branch whose name begins with `release/`). This document provides the steps necessary after modifying a library in a servicing branch (where "servicing branch" refers to any branch whose name begins with `release/`).
## Check for existence of a .pkgproj ## Check if a package is generated
Your first step is to determine whether or not your library has its own package. To do this, go into the root folder for the library you've made changes to. If there is a `pkg` folder there (which should have a `.pkgproj` file inside of it), your library does have its own package. If there is no `pkg` folder there, the library is the part of the shared framework. If it is, then there is nothing that needs to be done. If a library's source project sets `<IsPackable>true</IsPackable>` a package is generated. If the library's source project doesn't set `<IsPackable>true</IsPackable>`, the library likely is part of the shared framework (to check for that, look into the `NetCoreAppLibrary.props` file). If it is, then there is nothing that needs to be done here.
For example, if you made changes to [Microsoft.Win32.Primitives](https://github.com/dotnet/runtime/tree/main/src/libraries/Microsoft.Win32.Primitives), then you have a `.pkgproj`, and will have to follow the steps in this document. However, if you made changes to [System.Collections](https://github.com/dotnet/runtime/tree/main/src/libraries/System.Collections), then you don't have a `.pkgproj`, and you do not need to do any further work for servicing.
## Determine PackageVersion ## Determine PackageVersion
Each package has a property called `PackageVersion`. When you make a change to a library & ship it, the `PackageVersion` must be bumped. This property could either be in one of two places inside your library's source folder: `Directory.Build.Props` (or dir.props), or the `.pkgproj`. It's also possible that the property is in neither of those files, in which case we're using the default version from [Packaging.props](https://github.com/dotnet/runtime/blob/main/eng/packaging.props#L25) (IMPORTANT - make sure to check the default version from the branch that you're making changes to, not from main). You'll need to increment this package version. If the property is already present in your library's source folder, just increment the patch version by 1 (e.g. `4.6.0` -> `4.6.1`). If it's not present, add it to the library's `Directory.Build.props`, where it is equal to the version in `Packaging.props`, with the patch version incremented by 1. Each package has a property called `PackageVersion`. When you make a change to a library & ship it, the `PackageVersion` must be bumped. This property could either be in one of two places inside your library's source folder: `Directory.Build.Props`, or in the the source project (under src/). It's also possible that the property is in neither of those files, in which case we're using the default version which is calculated based on the version properties in the [Versions.props](https://github.com/dotnet/runtime/blob/95147163dac477da5177f5c5402ae9b93feb5c89/eng/Versions.props#L6-L8) file. (IMPORTANT - make sure to check the default version from the branch that you're making changes to, not from main). You'll need to increment this package version. If the property is already present in your library's source folder, just increment the patch version by 1 (e.g. `4.6.0` -> `4.6.1`). If it's not present, add it to the library's `Directory.Build.props`, where it is equal to the patch version in `Version.props`, but with the patch version incremented by one.
Note that it's possible that somebody else has already incremented the package version since our last release. If this is the case, you don't need to increment it yourself. To confirm, check [Nuget.org](https://www.nuget.org/) to see if there is already a published version of your package with the same package version. If so, the `PackageVersion` must be incremented. If not, there's still a possibility that the version should be bumped, in the event that we've already built the package with its current version in an official build, but haven't released it publicly yet. If you see that the `PackageVersion` has been changed in the last 1-2 months, but don't see a matching package in Nuget.org, contact somebody on the servicing team for guidance. Note that it's possible that somebody else has already incremented the package version since our last release. If this is the case, you don't need to increment it yourself. To confirm, check [Nuget.org](https://www.nuget.org/) to see if there is already a published version of your package with the same package version. If so, the `PackageVersion` must be incremented. If not, there's still a possibility that the version should be bumped, in the event that we've already built the package with its current version in an official build, but haven't released it publicly yet. If you see that the `PackageVersion` has been changed in the last 1-2 months, but don't see a matching package in Nuget.org, contact somebody on the servicing team for guidance.
## Determine AssemblyVersion ## Determine AssemblyVersion
Each library has a property called `AssemblyVersion` which will be in either the library `.csproj` or in `Directory.Build.Props`. For servicing events you will want to increment the revision by 1 (e.g `4.0.0.0` -> `4.0.0.1`) in the library's `Directory.Build.Props` if the library ships in its own package and has an asset that is applicable to .NET Framework. To determine if it applies to .NET Framework you should check to see if there are any `netstandard` or `net4x` configurations in the ref and/or src project, if there are then it has assets that apply. A library's assembly version is controlled by the property `AssemblyVersion`. If the property exists, it's either located in the library's source project or in its `Directory.Build.props` file. If it doesn't exist, it uses the [centrally defined version](https://github.com/dotnet/runtime/blob/1fb151f63dca644347a5c608d7ab17f7cb8e1ccb/eng/Versions.props#L14) and you want to add the property to the library's `Directory.Build.props` file. For servicing events you will want to increment the revision by 1 (e.g `4.0.0.0` -> `4.0.0.1`) if the library ships in its own package and has an asset that is applicable to .NET Framework. To determine if it applies to .NET Framework you should check to see if there are any `netstandard` or `net4x` target frameworks in the source project and if there are, it has assets that apply.
The reason we need to increment the assembly version for things running on .NET Framework is because of the way binding works there. If there are two assemblies with the same assembly version the loader will essentially pick the first one it finds and use that version so applications don't have full control over using the later build with a particular fix included. This is worse if someone puts the older assembly in the GAC as the GAC will always win for matching assembly versions so an application couldn't load the newer one because it has the same assembly version. The reason we need to increment the assembly version for things running on .NET Framework is because of the way binding works there. If there are two assemblies with the same assembly version the loader will essentially pick the first one it finds and use that version so applications don't have full control over using the later build with a particular fix included. This is worse if someone puts the older assembly in the GAC as the GAC will always win for matching assembly versions so an application couldn't load the newer one because it has the same assembly version.
@ -27,32 +25,22 @@ If this library ships both inbox on a platform and in its own library package th
Can be removed when API is added and this assembly is versioned to 4.1.* --> Can be removed when API is added and this assembly is versioned to 4.1.* -->
<AssemblyVersion Condition="!$(TargetFramework.StartsWith('net4'))' != 'true'">4.0.3.0</AssemblyVersion> <AssemblyVersion Condition="!$(TargetFramework.StartsWith('net4'))' != 'true'">4.0.3.0</AssemblyVersion>
``` ```
Where the `AssemblyVersion` is set to the old version before updating. To determine if the library ships inbox you can look at for `InboxOnTargetFramework` item groups or `TreatAsOutOfBox` suppressions in the pkgproj for the library. Where the `AssemblyVersion` is set to the old version before updating. To determine if the library ships inbox you can look at the list in [NetCoreAppLibrary.props](https://github.com/dotnet/runtime/blob/95147163dac477da5177f5c5402ae9b93feb5c89/src/libraries/NetCoreAppLibrary.props#L1).
If the library is part of a Aspnetcore or .NET targeting pack then we cannot increment the assembly version. For Aspnetcore, You can examine the ```<IsAspNetCoreApp>true</IsAspNetCoreApp>``` property in the library`s ```Directory.Build.Props``` If the library is part of a Aspnetcore or .NET targeting pack then we cannot increment the assembly version. For Aspnetcore, You can examine the ```<IsAspNetCoreApp>true</IsAspNetCoreApp>``` property in the library`s ```Directory.Build.props```
For .Net you can examine the list in ```NetCoreAppLibrary.Props``` For .Net you can examine the list in ```NetCoreAppLibrary.props```
If the library is part of a targeting pack and also contains an asset applicable to the .NET Framework then we will increment the assembly version for that asset. If the library is part of a targeting pack and also contains an asset applicable to the .NET Framework then we will increment the assembly version for that asset.
eg. eg.
``` ```
<AssemblyVersion Condition="$(TargetFramework.StartsWith('net4'))">5.0.0.1</AssemblyVersion> <AssemblyVersion Condition="$(TargetFramework.StartsWith('net4'))">6.0.0.1</AssemblyVersion>
<SkipValidatePackage>true</SkipValidatePackage>
``` ```
## Update the package index
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/main/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"`.
The baseline version for the assembly in the package index should also be incremented so that all the other packages can use this servicing version for package dependencies.
## Add your package to libraries-packages.proj
In order to ensure that your package gets built, you need to add it to [libraries-packages.proj](https://github.com/dotnet/runtime/blob/main/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 ## Test your changes
All that's left is to ensure that your changes have worked as expected. To do so, execute the following steps: All that's left is to ensure that your changes have worked as expected. To do so, execute the following steps:
1. From a clean copy of your branch, run `build.cmd -allconfigurations` 1. From a clean copy of your branch, run `build.cmd/sh libs -allconfigurations`
2. Check in `bin\packages\Debug` for the existence of your package, with the appropriate package version. 2. Check in `bin\packages\Debug` for the existence of your package, with the appropriate package version.

View file

@ -1,105 +0,0 @@
Debugging CoreFX build issues
========================================
## MSBuild debug options
* Enable MSBuild diagnostics log (msbuild.log):
`dotnet build my.csproj /flp:v=diag`
* Generate a flat project file (out.pp):
`dotnet build my.csproj /pp:out.pp`
* Generate a binary log usable by the [MSBuild Binary and Structured Log Viewer](http://msbuildlog.com/):
`dotnet build my.csproj /bl`
## Steps to debug packaging build issues
(This documentation is work in progress.)
I found the following process to help when investigating some of the build issues caused by incorrect packaging.
To quickly validate if a given project compiles on all supported configurations use `dotnet build /t:RebuildAll`. This applies for running tests as well. For more information, see [Building individual libraries](../../building/libraries/README.md#building-individual-libraries)
Assuming the current directory is `\src\contractname\`:
1. Build the `\ref` folder: `dotnet build`
Check the logs for output such as:
```
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)).
[...]
CopyFilesToOutputDirectory:
Copying file from "S:\c1\bin/obj/ref/System.Net.ServicePoint/4.0.0.0/System.Net.ServicePoint.dll" to "S:\c1\bin/ref/System.Net.ServicePoint/4.0.0.0/System.Net.ServicePoint.dll".
System.Net.ServicePoint -> S:\c1\bin\ref\System.Net.ServicePoint\4.0.0.0\System.Net.ServicePoint.dll
Copying file from "S:\c1\bin/obj/ref/System.Net.ServicePoint/4.0.0.0/System.Net.ServicePoint.pdb" to "S:\c1\bin/ref/System.Net.ServicePoint/4.0.0.0/System.Net.ServicePoint.pdb".
[...]
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)).
[...]
CopyFilesToOutputDirectory:
Copying file from "S:\c1\bin/obj/ref/System.Net.ServicePoint/4.0.0.0/netcoreapp1.1/System.Net.ServicePoint.dll" to "S:\c1\bin/ref/System.Net.ServicePoint/4.0.0.0/netcoreapp1.1/System.Net.ServicePoint.dll".
System.Net.ServicePoint -> S:\c1\bin\ref\System.Net.ServicePoint\4.0.0.0\netcoreapp1.1\System.Net.ServicePoint.dll
Copying file from "S:\c1\bin/obj/ref/System.Net.ServicePoint/4.0.0.0/netcoreapp1.1/System.Net.ServicePoint.pdb" to "S:\c1\bin/ref/System.Net.ServicePoint/4.0.0.0/netcoreapp1.1/System.Net.ServicePoint.pdb".
```
Using your favourite IL disassembler, ensure that each platform contains the correct APIs. Missing APIs from the contracts is likely caused by not having the right `DefineConstants` tags in the csproj files.
2. Build the `\src` folder: `dotnet build`
Use the same technique above to ensure that the binaries include the correct implementations.
3. Build the `\pkg` folder: `dotnet build`
Ensure that all Build Pivots are actually being built. This should build all .\ref and .\src variations as well as actually creating the NuGet packages.
Verify that the contents of the nuspec as well as the actual package is correct. You can find the packages by searching for the following pattern in the msbuild output:
```
GetPkgProjPackageDependencies:
Skipping target "GetPkgProjPackageDependencies" because it has no inputs.
CreatePackage:
Created 'S:\c1\bin/packages/Debug/System.Net.Security.4.4.0-beta-24625-0.nupkg'
Created 'S:\c1\bin/packages/Debug/symbols/System.Net.Security.4.4.0-beta-24625-0.symbols.nupkg'
Build:
System.Net.Security -> S:\c1\bin/packages/Debug/specs/System.Net.Security.nuspec
```
To validate the content of the nupkg, change the extension to .zip. As before, use an IL disassembler to verify that the right APIs are present within `ref\<platform>\contractname.dll` and the right implementations within the `lib\<platform>\contractname.dll`.
4. Run the tests from `\tests`: `dotnet build /t:test`
Ensure that the test is referencing the correct pkg. For example:
```
<ItemGroup>
<ProjectReference Include="..\pkg\System.Net.ServicePoint.pkgproj" />
</ItemGroup>
```
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.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
Resolved runtime assets from .NETCoreApp,Version=v2.0: S:\c1\bin\AnyOS.AnyCPU.Debug\System.Net.ServicePoint\System.Net.ServicePoint.dll
```
To run a test from a single Build Pivot combination, specify all properties and build the `csproj`:
```
dotnet build System.Net.ServicePoint.Tests.csproj -f netcoreapp2.0 /t:test /p:OuterLoop=true /p:xunitoptions=-showprogress
```
Will run the test using the following pivot values:
* Architecture: AnyCPU
* Flavor: Debug
* OS: windows
* Target: netstandard2.0

View file

@ -63,7 +63,7 @@
<DefaultLibrariesSubsets Condition="'$(BuildTargetFramework)' == '$(NetCoreAppCurrent)' or <DefaultLibrariesSubsets Condition="'$(BuildTargetFramework)' == '$(NetCoreAppCurrent)' or
'$(BuildTargetFramework)' == '' or '$(BuildTargetFramework)' == '' or
'$(BuildAllConfigurations)' == 'true'">libs.native+</DefaultLibrariesSubsets> '$(BuildAllConfigurations)' == 'true'">libs.native+</DefaultLibrariesSubsets>
<DefaultLibrariesSubsets>$(DefaultLibrariesSubsets)libs.ref+libs.src+libs.packages</DefaultLibrariesSubsets> <DefaultLibrariesSubsets>$(DefaultLibrariesSubsets)libs.ref+libs.src</DefaultLibrariesSubsets>
<DefaultLibrariesSubsets Condition="'$(DotNetBuildFromSource)' != 'true'">$(DefaultLibrariesSubsets)+libs.pretest</DefaultLibrariesSubsets> <DefaultLibrariesSubsets Condition="'$(DotNetBuildFromSource)' != 'true'">$(DefaultLibrariesSubsets)+libs.pretest</DefaultLibrariesSubsets>
<DefaultHostSubsets>host.native+host.tools</DefaultHostSubsets> <DefaultHostSubsets>host.native+host.tools</DefaultHostSubsets>
@ -284,10 +284,6 @@
<ProjectToBuild Include="$(LibrariesProjectRoot)pretest.proj" Category="libs" /> <ProjectToBuild Include="$(LibrariesProjectRoot)pretest.proj" Category="libs" />
</ItemGroup> </ItemGroup>
<ItemGroup Condition="$(_subset.Contains('+libs.packages+')) and '$(PgoInstrument)' != 'true'">
<ProjectToBuild Include="$(LibrariesProjectRoot)libraries-packages.proj" Category="libs" Pack="true" />
</ItemGroup>
<ItemGroup Condition="$(_subset.Contains('+libs.tests+'))"> <ItemGroup Condition="$(_subset.Contains('+libs.tests+'))">
<ProjectToBuild Include="$(LibrariesProjectRoot)tests.proj" Category="libs" Test="true" /> <ProjectToBuild Include="$(LibrariesProjectRoot)tests.proj" Category="libs" Test="true" />
</ItemGroup> </ItemGroup>

View file

@ -1,55 +1,20 @@
<Project> <Project>
<PropertyGroup> <PropertyGroup>
<!-- defined in buildtools packaging.targets, but we need this before targets are imported -->
<PackagePlatform Condition="'$(PackagePlatform)' == ''">$(Platform)</PackagePlatform>
<PackagePlatform Condition="'$(PackagePlatform)' == 'amd64'">x64</PackagePlatform>
<!-- By default the packaging targets will package desktop facades as ref,
but we don't use this as we now build partial-reference-facades. -->
<PackageDesktopAsRef>false</PackageDesktopAsRef>
<!-- We're currently not building a "live" baseline, instead we're using .NETCore 1.0 RTM stable versions as the baseline -->
<SkipBaseLineCheck>true</SkipBaseLineCheck>
<PackageVersion Condition="'$(PackageVersion)' == '' and '$(MSBuildProjectExtension)' == '.pkgproj'">6.0.0</PackageVersion>
<SkipValidatePackageTargetFramework>true</SkipValidatePackageTargetFramework>
<SkipGenerationCheck>true</SkipGenerationCheck>
<DefaultAllowedOutputExtensionsInPackageBuildOutputFolder>.dll;.exe;.winmd;.json;.pri;</DefaultAllowedOutputExtensionsInPackageBuildOutputFolder> <DefaultAllowedOutputExtensionsInPackageBuildOutputFolder>.dll;.exe;.winmd;.json;.pri;</DefaultAllowedOutputExtensionsInPackageBuildOutputFolder>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(DotNetBuildFromSource)' == 'true'"> <ItemGroup>
<!-- Don't permit harvesting since this requires pre-builts -->
<HarvestStablePackage>false</HarvestStablePackage>
<!-- Validation will fail in case we were relying on harvested assets or assets not built to satisfy stated support -->
<SkipValidatePackage>true</SkipValidatePackage>
</PropertyGroup>
<PropertyGroup>
<NuSpecOutputPath Condition="'$(NuSpecOutputPath)' == ''">$([MSBuild]::NormalizeDirectory('$(ArtifactsPackagesDir)', 'specs'))</NuSpecOutputPath>
<PkgProjPath>$(MSBuildProjectDirectory)\..\pkg\$(MSBuildProjectName).pkgproj</PkgProjPath>
</PropertyGroup>
<Import Condition="Exists('$(PkgDir)baseline\baseline.props') and '$(MSBuildProjectExtension)' == '.pkgproj'" Project="$(PkgDir)baseline\baseline.props" />
<ItemGroup Condition="'$(IsPackable)' == 'true'">
<!-- Add a marker to help the designer optimize & share .NET Core packages --> <!-- Add a marker to help the designer optimize & share .NET Core packages -->
<None Include="$(PackageDesignerMarkerFile)" <None Include="$(PackageDesignerMarkerFile)"
PackagePath="$([System.IO.Path]::GetFileName('$(PackageDesignerMarkerFile)'))" PackagePath="$([System.IO.Path]::GetFileName('$(PackageDesignerMarkerFile)'))"
Pack="true" Pack="true"
Condition="'$(IncludeDesignerMarker)' != 'false'" /> Condition="'$(IncludeDesignerMarker)' != 'false'" />
<!-- Make sure that NETStandard.Library package never gets added as a dependency for .NET 4.6.1 -->
<SuppressMetaPackage Include="NETStandard.Library" TargetFramework="net461" />
</ItemGroup>
<ItemGroup>
<!-- add 3.1 to validation, using 3.0 RIDs -->
<DefaultValidateFramework Include="netcoreapp3.1">
<RuntimeIDs>@(NETCoreApp30RIDs)</RuntimeIDs>
</DefaultValidateFramework>
</ItemGroup> </ItemGroup>
<!-- TODO: Remove when all required nuget pack features are part of the consumed SDK. --> <!-- TODO: Remove when all required nuget pack features are part of the consumed SDK. -->
<ItemGroup Condition="'$(IsPackable)' == 'true' and '$(IsSourceProject)' == 'true'"> <ItemGroup>
<PackageReference Include="NuGet.Build.Tasks.Pack" Version="$(NuGetBuildTasksPackVersion)" PrivateAssets="all" IsImplicitlyDefined="true" /> <PackageReference Include="NuGet.Build.Tasks.Pack" Version="$(NuGetBuildTasksPackVersion)" PrivateAssets="all" IsImplicitlyDefined="true" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View file

@ -1,18 +1,23 @@
<Project InitialTargets="_OverridePackDependsOnForCsProjToPkgProj"> <Project>
<PropertyGroup Condition="'$(IsPackable)' == 'true'"> <PropertyGroup>
<EnablePackageValidation Condition="'$(IsSourceProject)' == 'true' and !Exists('$(PkgProjPath)')">true</EnablePackageValidation> <EnablePackageValidation>true</EnablePackageValidation>
<!-- Don't restore prebuilt packages during sourcebuild. --> <!-- Don't restore prebuilt packages during sourcebuild. -->
<DisablePackageBaselineValidation Condition="'$(DotNetBuildFromSource)' == 'true'">true</DisablePackageBaselineValidation> <DisablePackageBaselineValidation Condition="'$(DotNetBuildFromSource)' == 'true'">true</DisablePackageBaselineValidation>
<PackageValidationBaselineVersion Condition="'$(PackageValidationBaselineVersion)' == ''">$([MSBuild]::Subtract($(MajorVersion), 1)).0.0</PackageValidationBaselineVersion> <PackageValidationBaselineVersion Condition="'$(PackageValidationBaselineVersion)' == ''">$([MSBuild]::Subtract($(MajorVersion), 1)).0.0</PackageValidationBaselineVersion>
<SymbolPackageOutputPath>$(PackageOutputPath)</SymbolPackageOutputPath> <SymbolPackageOutputPath>$(PackageOutputPath)</SymbolPackageOutputPath>
<TargetsForTfmSpecificContentInPackage>$(TargetsForTfmSpecificContentInPackage);AddDocumentationFileToPackage;AddRuntimeSpecificFilesToPackage</TargetsForTfmSpecificContentInPackage> <TargetsForTfmSpecificContentInPackage>$(TargetsForTfmSpecificContentInPackage);AddRuntimeSpecificFilesToPackage</TargetsForTfmSpecificContentInPackage>
<TargetsForTfmSpecificDebugSymbolsInPackage>$(TargetsForTfmSpecificDebugSymbolsInPackage);AddRuntimeSpecificSymbolToPackage</TargetsForTfmSpecificDebugSymbolsInPackage> <TargetsForTfmSpecificDebugSymbolsInPackage>$(TargetsForTfmSpecificDebugSymbolsInPackage);AddRuntimeSpecificSymbolToPackage</TargetsForTfmSpecificDebugSymbolsInPackage>
<IncludeBuildOutput Condition="'$(TargetsAnyOS)' != 'true' or '$(ExcludeFromPackage)' == 'true'">false</IncludeBuildOutput> <IncludeBuildOutput Condition="'$(TargetsAnyOS)' != 'true' or '$(ExcludeFromPackage)' == 'true'">false</IncludeBuildOutput>
<!-- Don't include target platform specific dependencies, since we use the target platform to represent RIDs instead --> <!-- Don't include target platform specific dependencies, since we use the target platform to represent RIDs instead -->
<SuppressDependenciesWhenPacking Condition="'$(ExcludeFromPackage)' == 'true' or ('$(TargetsAnyOS)' != 'true' and $([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net5.0')))">true</SuppressDependenciesWhenPacking> <SuppressDependenciesWhenPacking Condition="'$(ExcludeFromPackage)' == 'true' or ('$(TargetsAnyOS)' != 'true' and $([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net5.0')))">true</SuppressDependenciesWhenPacking>
<PackageDesignerMarkerFile>$(MSBuildThisFileDirectory)useSharedDesignerContext.txt</PackageDesignerMarkerFile> <PackageDesignerMarkerFile>$(MSBuildThisFileDirectory)useSharedDesignerContext.txt</PackageDesignerMarkerFile>
<GenerateNuspecDependsOn>IncludeAnalyzersInPackage;$(GenerateNuspecDependsOn)</GenerateNuspecDependsOn> <GenerateNuspecDependsOn>IncludeAnalyzersInPackage;$(GenerateNuspecDependsOn)</GenerateNuspecDependsOn>
<!-- Generate packages in the allconfigurations build. -->
<GeneratePackageOnBuild Condition="'$(BuildAllConfigurations)' == 'true'">true</GeneratePackageOnBuild>
<!-- Search for the documentation file in the intellisense package and otherwise pick up the generated one. -->
<LibIntellisenseDocumentationFilePath>$(XmlDocFileRoot)1033\$(AssemblyName).xml</LibIntellisenseDocumentationFilePath>
<UseIntellisenseDocumentationFile Condition="'$(UseIntellisenseDocumentationFile)' == '' and Exists('$(LibIntellisenseDocumentationFilePath)')">true</UseIntellisenseDocumentationFile>
</PropertyGroup> </PropertyGroup>
<ItemGroup Condition="'$(EnablePackageValidation)' == 'true'"> <ItemGroup Condition="'$(EnablePackageValidation)' == 'true'">
@ -29,8 +34,7 @@
</ItemGroup> </ItemGroup>
<Choose> <Choose>
<When Condition="'$(IsPackable)' == 'true' and <When Condition="'$(AddXamarinPlaceholderFilesToPackage)' == 'true' or '$(AddNETFrameworkPlaceholderFileToPackage)' == 'true'">
('$(AddXamarinPlaceholderFilesToPackage)' == 'true' or '$(AddNETFrameworkPlaceholderFileToPackage)' == 'true')">
<PropertyGroup> <PropertyGroup>
<!-- Placeholders don't need a dependency group. --> <!-- Placeholders don't need a dependency group. -->
<NoWarn>$(NoWarn);NU5128</NoWarn> <NoWarn>$(NoWarn);NU5128</NoWarn>
@ -50,77 +54,28 @@
</When> </When>
</Choose> </Choose>
<!-- There are some packages where we require only one ref for a specific framework to be present. In order to avoid problems with this package when targetting <!-- TODO: Remove this target when no library relies on the intellisense documentation file anymore.-->
dektop with RAR we will make sure there are no exclude=compile references in the package. <Target Name="ChangeDocumentationFileForPackaging"
For more info, please check issues: AfterTargets="DocumentationProjectOutputGroup"
- https://github.com/dotnet/runtime/issues/27470 -> Why reference assets were removed from the package Condition="'$(ExcludeFromPackage)' != 'true' and
- https://github.com/dotnet/aspnetcore/issues/11206 -> Why ASP.NET required a ref to be added back for netcoreapp '$(UseIntellisenseDocumentationFile)' == 'true'">
- https://github.com/dotnet/runtime/issues/29966 -> Issue tracking to work of readding a ref to netcoreapp -->
<Target Name="RemoveExcludeCompileFromPackageDependencies" Condition="'$(RemoveExcludeCompileFromPackageDependencies)' == 'true'" DependsOnTargets="GetPackageDependencies" BeforeTargets="ValidateExcludeCompileDesktop">
<ItemGroup> <ItemGroup>
<Dependency> <DocumentationProjectOutputGroupOutput Remove="@(DocumentationProjectOutputGroupOutput)" />
<Exclude></Exclude> <DocumentationProjectOutputGroupOutput Include="$(LibIntellisenseDocumentationFilePath)" />
</Dependency>
</ItemGroup>
</Target>
<Target Name="ValidateExcludeCompileDesktop"
AfterTargets="GetPackageDependencies"
Inputs="%(Dependency.Identity);%(Dependency.TargetFramework)"
Outputs="unused"
Condition="'$(SkipValidatePackage)' != 'true'">
<PropertyGroup>
<_excludeCompile Condition="@(Dependency->WithMetadataValue('Exclude', 'Compile')->Count()) == @(Dependency->Count())">true</_excludeCompile>
</PropertyGroup>
<Error Text="Cannot have Exclude=Compile dependencies when targeting a desktop TFM. @(Dependency). You can exclude the reference asset in the package by setting the ExcludeReferenceAssets property to true in your project."
Condition="$([System.String]::Copy('%(Dependency.TargetFramework)').StartsWith('net4')) and
'$(_excludeCompile)' == 'true' and
'%(Dependency.Identity)' != '_._'" />
</Target>
<!-- Point to the custom pack target which invokes the pkgproj from a source csproj. -->
<Target Name="_OverridePackDependsOnForCsProjToPkgProj"
Condition="'$(GeneratePackage)' == 'true' and
'$(IsSourceProject)' == 'true' and
Exists('$(PkgProjPath)')">
<PropertyGroup>
<IsPackable>true</IsPackable>
<PackDependsOn>_BuildPkgProj</PackDependsOn>
</PropertyGroup>
</Target>
<Target Name="_BuildPkgProj">
<MSBuild Projects="$(PkgProjPath)"
Targets="Build" />
</Target>
<Target Name="AddDocumentationFileToPackage"
Condition="'$(ExcludeFromPackage)' != 'true'">
<PropertyGroup>
<!-- Search for the documentation file in the intellisense package and otherwise pick up the generated one. -->
<_documentationFileToPackage Condition="Exists('$(XmlDocFileRoot)1033\$(TargetName).xml')">$(XmlDocFileRoot)1033\$(TargetName).xml</_documentationFileToPackage>
<_documentationFileToPackage Condition="'$(_documentationFileToPackage)' == '' and Exists('$(DocumentationFile)')">$(DocumentationFile)</_documentationFileToPackage>
</PropertyGroup>
<ItemGroup Condition="'$(_documentationFileToPackage)' != ''">
<!-- Place the documentation file into the lib or runtimes/lib folder depending on if the build is runtime agnostic or specific. -->
<TfmSpecificPackageFile Include="$(_documentationFileToPackage)"
PackagePath="$([MSBuild]::ValueOrDefault('$(BuildOutputTargetFolder)', 'lib'))/$(TargetFrameworkWithoutSuffix)"
Condition="'$(TargetsAnyOS)' == 'true'" />
<TfmRuntimeSpecificPackageFile Include="$(_documentationFileToPackage)"
Condition="'$(TargetsAnyOS)' != 'true'" />
</ItemGroup> </ItemGroup>
</Target> </Target>
<Target Name="AddRuntimeSpecificFilesToPackage" <Target Name="AddRuntimeSpecificFilesToPackage"
DependsOnTargets="BuiltProjectOutputGroup; DependsOnTargets="BuiltProjectOutputGroup;
DocumentationProjectOutputGroup;
SatelliteDllsProjectOutputGroup; SatelliteDllsProjectOutputGroup;
$(TargetsForTfmSpecificBuildOutput); $(TargetsForTfmSpecificBuildOutput)"
AddDocumentationFileToPackage"
Condition="'$(ExcludeFromPackage)' != 'true' and Condition="'$(ExcludeFromPackage)' != 'true' and
'$(TargetsAnyOS)' != 'true'"> '$(TargetsAnyOS)' != 'true'">
<ItemGroup> <ItemGroup>
<TfmRuntimeSpecificPackageFile Include="@(BuiltProjectOutputGroupOutput); <TfmRuntimeSpecificPackageFile Include="@(SatelliteDllsProjectOutputGroupOutput);
@(SatelliteDllsProjectOutputGroupOutput)" /> @(BuiltProjectOutputGroupOutput);
@(DocumentationProjectOutputGroupOutput)" />
<TfmSpecificPackageFile Include="@(TfmRuntimeSpecificPackageFile)" <TfmSpecificPackageFile Include="@(TfmRuntimeSpecificPackageFile)"
PackagePath="runtimes/$(PackageTargetRuntime)/lib/$(TargetFrameworkWithoutSuffix)" /> PackagePath="runtimes/$(PackageTargetRuntime)/lib/$(TargetFrameworkWithoutSuffix)" />
<!-- Copy runtime specific assemblies into the rid agnostic 'lib' folder if the ridless tfm doesn't exist on .NETFramework. <!-- Copy runtime specific assemblies into the rid agnostic 'lib' folder if the ridless tfm doesn't exist on .NETFramework.
@ -172,19 +127,4 @@
</ItemGroup> </ItemGroup>
</Target> </Target>
<Target Name="GetAnalyzerPackFiles"
DependsOnTargets="$(GenerateNuspecDependsOn)"
Returns="@(_AnalyzerPackFile)">
<PropertyGroup>
<_analyzerPath>analyzers/dotnet</_analyzerPath>
<_analyzerPath Condition="'$(AnalyzerLanguage)' != ''">$(_analyzerPath)/$(AnalyzerLanguage)</_analyzerPath>
</PropertyGroup>
<ItemGroup>
<_AnalyzerPackFile Include="@(_BuildOutputInPackage)" IsSymbol="false" />
<_AnalyzerPackFile Include="@(_TargetPathsToSymbols)" IsSymbol="true" />
<_AnalyzerPackFile PackagePath="$(_analyzerPath)/%(TargetPath)" />
</ItemGroup>
<Error Condition="'%(_AnalyzerPackFile.TargetFramework)' != 'netstandard2.0'"
Text="Analyzers must only target netstandard2.0 since they run in the compiler which targets netstandard2.0. The following files were found to target '%(_AnalyzerPackFile.TargetFramework)': @(_AnalyzerPackFile)" />
</Target>
</Project> </Project>

View file

@ -1,43 +0,0 @@
<Project InitialTargets="AddPackageDownload">
<PropertyGroup>
<PackagingTaskAssembly>$(NuGetPackageRoot)microsoft.dotnet.build.tasks.packaging\$(MicrosoftDotNetBuildTasksPackagingVersion)\tools\</PackagingTaskAssembly>
<PackagingTaskAssembly Condition="'$(MSBuildRuntimeType)' == 'core'">$(PackagingTaskAssembly)netcoreapp3.1\</PackagingTaskAssembly>
<PackagingTaskAssembly Condition="'$(MSBuildRuntimeType)' != 'core'">$(PackagingTaskAssembly)net472\</PackagingTaskAssembly>
<!-- TODO: Remove when https://github.com/dotnet/arcade/issues/7413 is fixed. -->
<PackagingTaskAssembly Condition="'$(MSBuildRuntimeType)' == 'core' and '$(DotNetBuildFromSource)' == 'true'">$(PackagingTaskAssembly)net5.0\</PackagingTaskAssembly>
<PackagingTaskAssembly>$(PackagingTaskAssembly)Microsoft.DotNet.Build.Tasks.Packaging.dll</PackagingTaskAssembly>
</PropertyGroup>
<UsingTask TaskName="GetLastStablePackage" AssemblyFile="$(PackagingTaskAssembly)"/>
<Target Name="AddPackageDownload">
<ItemGroup>
<_AllPkgProjs Include="$(LibrariesProjectRoot)*\pkg\**\*.pkgproj" />
</ItemGroup>
<!-- Need separate ItemGroups so right metadata gets populated -->
<ItemGroup>
<_AllPkgProjsToPackageIdentity Include="@(_AllPkgProjs -> '%(Filename)')" />
</ItemGroup>
<GetLastStablePackage
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 -->
<ItemGroup>
<_OverridenPackageDownloads Include="@(_PackageDownload)" Condition="'@(PackageDownload)' == '@(_PackageDownload)' and %(Identity) != ''" />
<_PackageDownload Remove="@(_OverridenPackageDownloads)" />
<_PackageDownload Include="@(PackageDownload)" />
<PackageDownload Remove="@(PackageDownload)" />
<PackageDownload Include="@(_PackageDownload)" Condition="'%(_PackageDownload.IsImplicitlyDefined)' != 'true'" />
<!-- Add exact version to PackageDownload -->
<PackageDownload>
<Version>[%(Version)]</Version>
</PackageDownload>
</ItemGroup>
</Target>
</Project>

View file

@ -1,26 +0,0 @@
<Project TreatAsLocalProperty="ExcludeRestorePackageImports">
<PropertyGroup>
<ToolSetCommonDirectory>$(RepoRoot)artifacts\toolset\Common\</ToolSetCommonDirectory>
<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
non-determinism where first restore changes a subsequent restore,
but we need these since they define properties (like TargetFramework) needed by restore.
In this case we guarantee this is ok since these specific props are not restored by this project's restore. -->
<_excludeRestorePackageImports>$(ExcludeRestorePackageImports)</_excludeRestorePackageImports>
<ExcludeRestorePackageImports>false</ExcludeRestorePackageImports>
</PropertyGroup>
<Import Project="$(ToolSetCommonDirectory)Tools.proj.nuget.g.props" Condition="Exists('$(ToolSetCommonDirectory)Tools.proj.nuget.g.props')" />
<PropertyGroup>
<ProjectAssetsFile Condition="'$(ProjectAssetsFile)' == 'unused'" />
<ExcludeRestorePackageImports>$(_excludeRestorePackageImports)</ExcludeRestorePackageImports>
</PropertyGroup>
<PropertyGroup>
<!-- Disable code paths that require project.assets.json files to be present or to be computed. -->
<GenerateDependencyFile>false</GenerateDependencyFile>
<ComputeNETCoreBuildOutputFiles>false</ComputeNETCoreBuildOutputFiles>
<GenerateRuntimeConfigurationFiles>false</GenerateRuntimeConfigurationFiles>
</PropertyGroup>
</Project>

View file

@ -1,29 +0,0 @@
<Project InitialTargets="_ClearResolvePackageAssets" TreatAsLocalProperty="ExcludeRestorePackageImports">
<PropertyGroup>
<!-- Disable restoring of package references in our projects -->
<RestoreProjectStyle>Unknown</RestoreProjectStyle>
</PropertyGroup>
<PropertyGroup>
<!-- Nuget will normally disable all generated imports as part of a restore to avoid
non-determinism where first restore changes a subsequent restore,
but we need these since they define properties (like TargetFramework) needed by restore.
In this case we guarantee this is ok since these specific props are not restored by this project's restore. -->
<_excludeRestorePackageImports>$(ExcludeRestorePackageImports)</_excludeRestorePackageImports>
<ExcludeRestorePackageImports>false</ExcludeRestorePackageImports>
</PropertyGroup>
<Import Project="$(ToolSetCommonDirectory)Tools.proj.nuget.g.targets" Condition="Exists('$(ToolSetCommonDirectory)Tools.proj.nuget.g.targets')" />
<PropertyGroup>
<ExcludeRestorePackageImports>$(_excludeRestorePackageImports)</ExcludeRestorePackageImports>
</PropertyGroup>
<!--
Hack workaround for not restoring each project. Instead, we turn off all the targets
that require a `project.assets.json`, since ours will be empty anyway.
-->
<Target Name="_ClearResolvePackageAssets">
<PropertyGroup>
<ResolvePackageDependenciesForBuildDependsOn />
</PropertyGroup>
</Target>
</Project>

View file

@ -13,23 +13,18 @@
</PropertyGroup> </PropertyGroup>
<Import Project="..\..\Directory.Build.props" /> <Import Project="..\..\Directory.Build.props" />
<Import Project="NetCoreAppLibrary.props" />
<PropertyGroup> <PropertyGroup>
<BeforeTargetFrameworkInferenceTargets>$(RepositoryEngineeringDir)BeforeTargetFrameworkInference.targets</BeforeTargetFrameworkInferenceTargets> <BeforeTargetFrameworkInferenceTargets>$(RepositoryEngineeringDir)BeforeTargetFrameworkInference.targets</BeforeTargetFrameworkInferenceTargets>
<RuntimeGraph>$(LibrariesProjectRoot)OSGroups.json</RuntimeGraph> <RuntimeGraph>$(LibrariesProjectRoot)OSGroups.json</RuntimeGraph>
<ShouldUnsetParentConfigurationAndPlatform>false</ShouldUnsetParentConfigurationAndPlatform> <ShouldUnsetParentConfigurationAndPlatform>false</ShouldUnsetParentConfigurationAndPlatform>
<!-- Remove once is fixed: https://github.com/dotnet/roslyn/issues/42344 -->
<GeneratePlatformNotSupportedAssemblyHeaderFile>$(RepositoryEngineeringDir)LicenseHeader.txt</GeneratePlatformNotSupportedAssemblyHeaderFile> <GeneratePlatformNotSupportedAssemblyHeaderFile>$(RepositoryEngineeringDir)LicenseHeader.txt</GeneratePlatformNotSupportedAssemblyHeaderFile>
</PropertyGroup>
<Import Sdk="Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk" Project="Sdk.props" Condition="'$(UseTargetFrameworkSDK)' != 'false'" />
<PropertyGroup>
<!-- Build all .NET Framework configurations when net48 is passed in. This is for convenience. --> <!-- Build all .NET Framework configurations when net48 is passed in. This is for convenience. -->
<AdditionalBuildTargetFrameworks Condition="'$(BuildTargetFramework)' == 'net48'">net461;net462;net47;net471;net472</AdditionalBuildTargetFrameworks> <AdditionalBuildTargetFrameworks Condition="'$(BuildTargetFramework)' == 'net48'">net461;net462;net47;net471;net472</AdditionalBuildTargetFrameworks>
</PropertyGroup> </PropertyGroup>
<Import Sdk="Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk" Project="Sdk.props" Condition="'$(UseTargetFrameworkSDK)' != 'false'" />
<!-- Define test projects and companions --> <!-- Define test projects and companions -->
<PropertyGroup Condition="'$(IsSourceProject)' != 'true'"> <PropertyGroup Condition="'$(IsSourceProject)' != 'true'">
<IsTestProject Condition="'$(IsTestProject)' == ''">false</IsTestProject> <IsTestProject Condition="'$(IsTestProject)' == ''">false</IsTestProject>
@ -52,11 +47,6 @@
<Nullable Condition="'$(Nullable)' == '' and '$(Language)' == 'C#'">annotations</Nullable> <Nullable Condition="'$(Nullable)' == '' and '$(Language)' == 'C#'">annotations</Nullable>
</PropertyGroup> </PropertyGroup>
<!-- Common repo directories -->
<PropertyGroup>
<PkgDir>$([MSBuild]::NormalizeDirectory('$(LibrariesProjectRoot)', 'pkg'))</PkgDir>
</PropertyGroup>
<PropertyGroup> <PropertyGroup>
<RunApiCompatForSrc>$([MSBuild]::ValueOrDefault('$(IsSourceProject)', 'false'))</RunApiCompatForSrc> <RunApiCompatForSrc>$([MSBuild]::ValueOrDefault('$(IsSourceProject)', 'false'))</RunApiCompatForSrc>
<RunMatchingRefApiCompat>$([MSBuild]::ValueOrDefault('$(IsSourceProject)', 'false'))</RunMatchingRefApiCompat> <RunMatchingRefApiCompat>$([MSBuild]::ValueOrDefault('$(IsSourceProject)', 'false'))</RunMatchingRefApiCompat>
@ -69,13 +59,8 @@
<ProjectExclusions Include="$(CommonTestPath)System\Net\Prerequisites\**\*.csproj" /> <ProjectExclusions Include="$(CommonTestPath)System\Net\Prerequisites\**\*.csproj" />
</ItemGroup> </ItemGroup>
<!-- Import packaging props --> <Import Project="NetCoreAppLibrary.props" />
<Import Project="$(RepositoryEngineeringDir)packaging.props" /> <Import Project="$(RepositoryEngineeringDir)packaging.props" Condition="'$(IsPackable)' == 'true'" />
<PropertyGroup>
<RefRootPath>$([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'ref'))</RefRootPath>
</PropertyGroup>
<Import Project="$(RepositoryEngineeringDir)referenceAssemblies.props" Condition="'$(IsReferenceAssembly)' == 'true'" /> <Import Project="$(RepositoryEngineeringDir)referenceAssemblies.props" Condition="'$(IsReferenceAssembly)' == 'true'" />
<Import Project="$(RepositoryEngineeringDir)targetframeworksuffix.props" Condition="'$(DesignTimeBuild)' != 'true'" /> <Import Project="$(RepositoryEngineeringDir)targetframeworksuffix.props" Condition="'$(DesignTimeBuild)' != 'true'" />
@ -86,12 +71,14 @@
<!-- TODO: Remove condition when all libraries migrated from pkgprojs to NuGet's Pack Task. --> <!-- TODO: Remove condition when all libraries migrated from pkgprojs to NuGet's Pack Task. -->
<StrongNameKeyId Condition="$(MSBuildProjectName.StartsWith('Microsoft.Extensions.'))">MicrosoftAspNetCore</StrongNameKeyId> <StrongNameKeyId Condition="$(MSBuildProjectName.StartsWith('Microsoft.Extensions.'))">MicrosoftAspNetCore</StrongNameKeyId>
<IsPackable Condition="$(MSBuildProjectName.StartsWith('Microsoft.Extensions.')) and '$(IsSourceProject)' == 'true'">true</IsPackable> <IsPackable Condition="$(MSBuildProjectName.StartsWith('Microsoft.Extensions.')) and '$(IsSourceProject)' == 'true'">true</IsPackable>
</PropertyGroup>
<!-- Disable some standard properties for building our projects -->
<PropertyGroup>
<!-- We can't generate an apphost without restoring the targeting pack. --> <!-- We can't generate an apphost without restoring the targeting pack. -->
<UseAppHost>false</UseAppHost> <UseAppHost>false</UseAppHost>
<EnableDefaultItems>false</EnableDefaultItems>
<!--
Microsoft.NET.TargetFrameworkInference.targets appends the TargetFramework.
We do this manually and use the Configuration instead.
-->
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
</PropertyGroup> </PropertyGroup>
<!-- Language configuration --> <!-- Language configuration -->
@ -102,19 +89,13 @@
<!-- Disable analyzers for tests and unsupported projects --> <!-- Disable analyzers for tests and unsupported projects -->
<RunAnalyzers Condition="'$(IsTestProject)' != 'true' and '$(IsSourceProject)' != 'true'">false</RunAnalyzers> <RunAnalyzers Condition="'$(IsTestProject)' != 'true' and '$(IsSourceProject)' != 'true'">false</RunAnalyzers>
<CodeAnalysisRuleset Condition="'$(IsTestProject)' == 'true'">$(RepositoryEngineeringDir)CodeAnalysis.test.ruleset</CodeAnalysisRuleset> <CodeAnalysisRuleset Condition="'$(IsTestProject)' == 'true'">$(RepositoryEngineeringDir)CodeAnalysis.test.ruleset</CodeAnalysisRuleset>
<!-- Enable documentation file generation by the compiler for all libraries except for vbproj. -->
<GenerateDocumentationFile Condition="'$(IsSourceProject)' == 'true' and '$(MSBuildProjectExtension)' != '.vbproj'">true</GenerateDocumentationFile>
<CLSCompliant Condition="'$(CLSCompliant)' == '' and '$(IsTestProject)' != 'true' and '$(IsTestSupportProject)' != 'true'">true</CLSCompliant>
</PropertyGroup> </PropertyGroup>
<!-- Set up common paths --> <!-- Set up common paths -->
<PropertyGroup> <PropertyGroup>
<!--
Microsoft.NET.TargetFrameworkInference.targets appends the TargetFramework.
We do this manually and use the Configuration instead.
-->
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<NetCoreAppCurrentRefPath>$([MSBuild]::NormalizeDirectory('$(RefRootPath)', '$(NetCoreAppCurrent)'))</NetCoreAppCurrentRefPath>
<NetCoreAppCurrentRuntimePath>$([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'runtime', '$(NetCoreAppCurrent)-$(TargetOS)-$(Configuration)-$(TargetArchitecture)'))</NetCoreAppCurrentRuntimePath>
<!-- Helix properties --> <!-- Helix properties -->
<OSPlatformConfig>$(TargetOS).$(Platform).$(Configuration)</OSPlatformConfig> <OSPlatformConfig>$(TargetOS).$(Platform).$(Configuration)</OSPlatformConfig>
<AnyOSPlatformConfig>AnyOS.AnyCPU.$(Configuration)</AnyOSPlatformConfig> <AnyOSPlatformConfig>AnyOS.AnyCPU.$(Configuration)</AnyOSPlatformConfig>
@ -126,6 +107,9 @@
<TestArchiveTestsDir>$(TestArchiveTestsRoot)$(OSPlatformConfig)/</TestArchiveTestsDir> <TestArchiveTestsDir>$(TestArchiveTestsRoot)$(OSPlatformConfig)/</TestArchiveTestsDir>
<TestArchiveRuntimeRoot>$(TestArchiveRoot)runtime/</TestArchiveRuntimeRoot> <TestArchiveRuntimeRoot>$(TestArchiveRoot)runtime/</TestArchiveRuntimeRoot>
<NetCoreAppCurrentRefPath>$([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'ref', '$(NetCoreAppCurrent)'))</NetCoreAppCurrentRefPath>
<NetCoreAppCurrentRuntimePath>$([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'runtime', '$(NetCoreAppCurrent)-$(TargetOS)-$(Configuration)-$(TargetArchitecture)'))</NetCoreAppCurrentRuntimePath>
<ASPNETCoreAppPackageRootPath>$([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'pkg', 'aspnetcoreapp'))</ASPNETCoreAppPackageRootPath> <ASPNETCoreAppPackageRootPath>$([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'pkg', 'aspnetcoreapp'))</ASPNETCoreAppPackageRootPath>
<ASPNETCoreAppPackageRefPath>$([MSBuild]::NormalizeDirectory('$(ASPNETCoreAppPackageRootPath)', 'ref'))</ASPNETCoreAppPackageRefPath> <ASPNETCoreAppPackageRefPath>$([MSBuild]::NormalizeDirectory('$(ASPNETCoreAppPackageRootPath)', 'ref'))</ASPNETCoreAppPackageRefPath>
<ASPNETCoreAppPackageRuntimePath>$([MSBuild]::NormalizeDirectory('$(ASPNETCoreAppPackageRootPath)', 'lib'))</ASPNETCoreAppPackageRuntimePath> <ASPNETCoreAppPackageRuntimePath>$([MSBuild]::NormalizeDirectory('$(ASPNETCoreAppPackageRootPath)', 'lib'))</ASPNETCoreAppPackageRuntimePath>
@ -135,16 +119,6 @@
<CommonTestPath>$([MSBuild]::NormalizeDirectory('$(CommonPathRoot)', 'tests'))</CommonTestPath> <CommonTestPath>$([MSBuild]::NormalizeDirectory('$(CommonPathRoot)', 'tests'))</CommonTestPath>
</PropertyGroup> </PropertyGroup>
<PropertyGroup>
<DisableProjectRestore Condition="'$(MSBuildProjectExtension)' == '.pkgproj'">true</DisableProjectRestore>
</PropertyGroup>
<Import Project="$(RepositoryEngineeringDir)restore\repoRestore.props" Condition="'$(DisableProjectRestore)' == 'true'" />
<PropertyGroup>
<EnableDefaultItems>false</EnableDefaultItems>
</PropertyGroup>
<ItemGroup Condition="'$(IsTestProject)' == 'true' and '$(SkipTestUtilitiesReference)' != 'true'"> <ItemGroup Condition="'$(IsTestProject)' == 'true' and '$(SkipTestUtilitiesReference)' != 'true'">
<ProjectReference Include="$(CommonTestPath)TestUtilities\TestUtilities.csproj" /> <ProjectReference Include="$(CommonTestPath)TestUtilities\TestUtilities.csproj" />
</ItemGroup> </ItemGroup>
@ -174,16 +148,8 @@
<ItemGroup> <ItemGroup>
<CoverageExcludeByFile Include="$([MSBuild]::NormalizePath('$(LibrariesProjectRoot)', 'Common', 'src', 'System', 'SR.*'))" /> <CoverageExcludeByFile Include="$([MSBuild]::NormalizePath('$(LibrariesProjectRoot)', 'Common', 'src', 'System', 'SR.*'))" />
<CoverageExcludeByFile Include="$([MSBuild]::NormalizePath('$(LibrariesProjectRoot)', 'Common', 'src', 'System', 'NotImplemented.cs'))" /> <CoverageExcludeByFile Include="$([MSBuild]::NormalizePath('$(LibrariesProjectRoot)', 'Common', 'src', 'System', 'NotImplemented.cs'))" />
</ItemGroup>
<ItemGroup>
<!-- Link to the testhost folder to probe additional assemblies. --> <!-- Link to the testhost folder to probe additional assemblies. -->
<CoverageIncludeDirectory Include="shared\Microsoft.NETCore.App\$(ProductVersion)" /> <CoverageIncludeDirectory Include="shared\Microsoft.NETCore.App\$(ProductVersion)" />
</ItemGroup> </ItemGroup>
<PropertyGroup>
<CLSCompliant Condition="'$(CLSCompliant)' == '' and ('$(IsTestProject)' == 'true' or '$(IsTestSupportProject)' == 'true')">false</CLSCompliant>
<CLSCompliant Condition="'$(CLSCompliant)' == ''">true</CLSCompliant>
</PropertyGroup>
</Project> </Project>

View file

@ -39,8 +39,6 @@
<NoWarn Condition="'$(IsPartialFacadeAssembly)' == 'true'">$(NoWarn);SYSLIB0003;SYSLIB0004;SYSLIB0015;SYSLIB0017;SYSLIB0021;SYSLIB0022;SYSLIB0023;SYSLIB0025;SYSLIB0032</NoWarn> <NoWarn Condition="'$(IsPartialFacadeAssembly)' == 'true'">$(NoWarn);SYSLIB0003;SYSLIB0004;SYSLIB0015;SYSLIB0017;SYSLIB0021;SYSLIB0022;SYSLIB0023;SYSLIB0025;SYSLIB0032</NoWarn>
<!-- Reset these properties back to blank, since they are defaulted by Microsoft.NET.Sdk --> <!-- Reset these properties back to blank, since they are defaulted by Microsoft.NET.Sdk -->
<WarningsAsErrors Condition="'$(WarningsAsErrors)' == 'NU1605'" /> <WarningsAsErrors Condition="'$(WarningsAsErrors)' == 'NU1605'" />
<!-- Set the documentation output file globally. -->
<DocumentationFile Condition="'$(IsSourceProject)' == 'true' and '$(DocumentationFile)' == '' and '$(MSBuildProjectExtension)' != '.vbproj'">$(OutputPath)$(TargetName).xml</DocumentationFile>
<IsNETCoreAppSrc Condition="'$(IsNETCoreAppSrc)' == '' and <IsNETCoreAppSrc Condition="'$(IsNETCoreAppSrc)' == '' and
'$(IsSourceProject)' == 'true' and '$(IsSourceProject)' == 'true' and
$(NetCoreAppLibrary.Contains('$(AssemblyName);'))">true</IsNETCoreAppSrc> $(NetCoreAppLibrary.Contains('$(AssemblyName);'))">true</IsNETCoreAppSrc>
@ -137,12 +135,11 @@
<Import Project="$(RepositoryEngineeringDir)slngen.targets" /> <Import Project="$(RepositoryEngineeringDir)slngen.targets" />
<Import Sdk="Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk" Project="Sdk.targets" Condition="'$(UseTargetFrameworkSDK)' != 'false'" /> <Import Sdk="Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk" Project="Sdk.targets" Condition="'$(UseTargetFrameworkSDK)' != 'false'" />
<Import Project="$(RepositoryEngineeringDir)restore\repoRestore.targets" Condition="'$(DisableProjectRestore)' == 'true'" />
<Import Project="$(RepositoryEngineeringDir)illink.targets" Condition="'$(IsSourceProject)' == 'true'" /> <Import Project="$(RepositoryEngineeringDir)illink.targets" Condition="'$(IsSourceProject)' == 'true'" />
<Import Project="$(RepositoryEngineeringDir)AvoidRestoreCycleOnSelfReference.targets" Condition="'$(AvoidRestoreCycleOnSelfReference)' == 'true'" /> <Import Project="$(RepositoryEngineeringDir)AvoidRestoreCycleOnSelfReference.targets" Condition="'$(AvoidRestoreCycleOnSelfReference)' == 'true'" />
<Import Project="$(RepositoryEngineeringDir)packaging.targets" Condition="'$(IsPackable)' == 'true'" />
<ItemGroup Condition="'$(IsSourceProject)' == 'true' or '$(IsReferenceAssembly)' == 'true' or '$(IsPartialFacadeAssembly)' == '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.ApiCompat" Condition="'$(DotNetBuildFromSource)' != 'true'" Version="$(MicrosoftDotNetApiCompatVersion)" PrivateAssets="all" IsImplicitlyDefined="true" />
<PackageReference Include="Microsoft.DotNet.GenAPI" Condition="'$(DotNetBuildFromSource)' != 'true'" Version="$(MicrosoftDotNetGenApiVersion)" PrivateAssets="all" IsImplicitlyDefined="true" /> <PackageReference Include="Microsoft.DotNet.GenAPI" Condition="'$(DotNetBuildFromSource)' != 'true'" Version="$(MicrosoftDotNetGenApiVersion)" PrivateAssets="all" IsImplicitlyDefined="true" />
<PackageReference Include="Microsoft.DotNet.GenFacades" Version="$(MicrosoftDotNetGenFacadesVersion)" PrivateAssets="all" IsImplicitlyDefined="true" /> <PackageReference Include="Microsoft.DotNet.GenFacades" Version="$(MicrosoftDotNetGenFacadesVersion)" PrivateAssets="all" IsImplicitlyDefined="true" />
@ -169,15 +166,6 @@
<Import Project="$(RepositoryEngineeringDir)outerBuild.targets" Condition="'$(IsCrossTargetingBuild)' == 'true'" /> <Import Project="$(RepositoryEngineeringDir)outerBuild.targets" Condition="'$(IsCrossTargetingBuild)' == 'true'" />
<!-- Import Packaging targets -->
<Import Project="$(RepositoryEngineeringDir)packaging.targets" />
<!-- Define this now until we can clean-up targets that depend on it in the packaging targets -->
<Target Name="CreateVersionFileDuringBuild" />
<!-- Define this target to override the workaround in arcade as we don't need it for our pkgprojs -->
<Target Name="InitializeStandardNuspecProperties" />
<Target Name="UpdateProjectReferencesWithAttributes" Condition="'@(ProjectReference)' != ''"> <Target Name="UpdateProjectReferencesWithAttributes" Condition="'@(ProjectReference)' != ''">
<ItemGroup> <ItemGroup>
<ProjectReference Condition="'%(Filename)' == 'System.Private.CoreLib'"> <ProjectReference Condition="'%(Filename)' == 'System.Private.CoreLib'">
@ -196,16 +184,6 @@
</PropertyGroup> </PropertyGroup>
</Target> </Target>
<!-- Returns the assembly version of the project for consumption
by the NuGet package generation -->
<Target Name="GetAssemblyVersion"
Returns="$(AssemblyVersion)"/>
<!-- Returns the generated documentation file for consumption
by the NuGet package generation -->
<Target Name="GetDocumentationFile"
Returns="$(DocumentationFile)"/>
<!-- <!--
Do not clean binplace assets in the ref targeting pack to avoid incremental build failures Do not clean binplace assets in the ref targeting pack to avoid incremental build failures
when the SDK tries to resolve the assets from the FrameworkList. when the SDK tries to resolve the assets from the FrameworkList.
@ -287,5 +265,21 @@
BuildReference="$(BuildAnalyzerReferences)" /> BuildReference="$(BuildAnalyzerReferences)" />
</ItemGroup> </ItemGroup>
<Target Name="GetAnalyzerPackFiles"
DependsOnTargets="$(GenerateNuspecDependsOn)"
Returns="@(_AnalyzerPackFile)">
<PropertyGroup>
<_analyzerPath>analyzers/dotnet</_analyzerPath>
<_analyzerPath Condition="'$(AnalyzerLanguage)' != ''">$(_analyzerPath)/$(AnalyzerLanguage)</_analyzerPath>
</PropertyGroup>
<ItemGroup>
<_AnalyzerPackFile Include="@(_BuildOutputInPackage)" IsSymbol="false" />
<_AnalyzerPackFile Include="@(_TargetPathsToSymbols)" IsSymbol="true" />
<_AnalyzerPackFile PackagePath="$(_analyzerPath)/%(TargetPath)" />
</ItemGroup>
<Error Condition="'%(_AnalyzerPackFile.TargetFramework)' != 'netstandard2.0'"
Text="Analyzers must only target netstandard2.0 since they run in the compiler which targets netstandard2.0. The following files were found to target '%(_AnalyzerPackFile.TargetFramework)': @(_AnalyzerPackFile)" />
</Target>
<Import Project="$(MSBuildThisFileDirectory)workloads-testing.targets" /> <Import Project="$(MSBuildThisFileDirectory)workloads-testing.targets" />
</Project> </Project>

View file

@ -12,7 +12,6 @@ Microsoft.Diagnostics.Tracing.EventSource</PackageDescription>
<DefineConstants>$(DefineConstants);NO_EVENTCOMMANDEXECUTED_SUPPORT;ES_BUILD_STANDALONE;FEATURE_MANAGED_ETW;TARGET_WINDOWS</DefineConstants> <DefineConstants>$(DefineConstants);NO_EVENTCOMMANDEXECUTED_SUPPORT;ES_BUILD_STANDALONE;FEATURE_MANAGED_ETW;TARGET_WINDOWS</DefineConstants>
<TargetFrameworks>net461-windows</TargetFrameworks> <TargetFrameworks>net461-windows</TargetFrameworks>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<IncludePlatformAttributes>true</IncludePlatformAttributes> <IncludePlatformAttributes>true</IncludePlatformAttributes>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup> </PropertyGroup>

View file

@ -2,15 +2,5 @@
<Import Project="..\Directory.Build.props" /> <Import Project="..\Directory.Build.props" />
<PropertyGroup> <PropertyGroup>
<IsAspNetCoreApp>true</IsAspNetCoreApp> <IsAspNetCoreApp>true</IsAspNetCoreApp>
<PackageDescription>Logging abstractions for Microsoft.Extensions.Logging.
Commonly Used Types:
Microsoft.Extensions.Logging.ILogger
Microsoft.Extensions.Logging.ILoggerFactory
Microsoft.Extensions.Logging.ILogger&lt;TCategoryName&gt;
Microsoft.Extensions.Logging.LogLevel
Microsoft.Extensions.Logging.Logger&lt;T&gt;
Microsoft.Extensions.Logging.LoggerMessage
Microsoft.Extensions.Logging.Abstractions.NullLogger</PackageDescription>
</PropertyGroup> </PropertyGroup>
</Project> </Project>

View file

@ -9,6 +9,8 @@
<IsSourceProject>false</IsSourceProject> <IsSourceProject>false</IsSourceProject>
<IsPackable>true</IsPackable> <IsPackable>true</IsPackable>
<!-- TODO: Enable after AvoidRestoreCycleOnSelfReference hack is removed. -->
<DisablePackageBaselineValidation>true</DisablePackageBaselineValidation>
<IncludeBuildOutput>false</IncludeBuildOutput> <IncludeBuildOutput>false</IncludeBuildOutput>
<IncludeSymbols>false</IncludeSymbols> <IncludeSymbols>false</IncludeSymbols>
<SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking> <SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking>

View file

@ -2,9 +2,9 @@
<PropertyGroup> <PropertyGroup>
<!-- Using a csproj extension to get the correct multi-targeting behavior. --> <!-- Using a csproj extension to get the correct multi-targeting behavior. -->
<TargetFrameworks>$(NetCoreAppCurrent);netcoreapp3.1;netstandard2.1;netstandard2.0</TargetFrameworks> <TargetFrameworks>$(NetCoreAppCurrent);netcoreapp3.1;netstandard2.1;netstandard2.0</TargetFrameworks>
<IsPackable>true</IsPackable>
<!-- Reference the outputs for the dependency nodes calculation. --> <!-- Reference the outputs for the dependency nodes calculation. -->
<NoTargetsDoNotReferenceOutputAssemblies>false</NoTargetsDoNotReferenceOutputAssemblies> <NoTargetsDoNotReferenceOutputAssemblies>false</NoTargetsDoNotReferenceOutputAssemblies>
<IsPackable>true</IsPackable>
<!-- This is a meta package and doesn't contain any libs. --> <!-- This is a meta package and doesn't contain any libs. -->
<NoWarn>$(NoWarn);NU5128</NoWarn> <NoWarn>$(NoWarn);NU5128</NoWarn>
<PackageDescription>This Windows Compatibility Pack provides access to APIs that were previously available only for .NET Framework. It can be used from both .NET Core as well as .NET Standard.</PackageDescription> <PackageDescription>This Windows Compatibility Pack provides access to APIs that were previously available only for .NET Framework. It can be used from both .NET Core as well as .NET Standard.</PackageDescription>

View file

@ -3,7 +3,6 @@
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<TargetFrameworks>$(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)</TargetFrameworks> <TargetFrameworks>$(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)</TargetFrameworks>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup> </PropertyGroup>
<!-- DesignTimeBuild requires all the TargetFramework Derived Properties to not be present in the first property group. --> <!-- DesignTimeBuild requires all the TargetFramework Derived Properties to not be present in the first property group. -->
<PropertyGroup> <PropertyGroup>

View file

@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>$(NetCoreAppCurrent);netcoreapp3.1;netstandard2.0;net461</TargetFrameworks> <TargetFrameworks>$(NetCoreAppCurrent);netcoreapp3.1;netstandard2.0;net461</TargetFrameworks>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<IsPackable>true</IsPackable> <IsPackable>true</IsPackable>
<PackageDescription>Single producer single consumer byte buffer management. <PackageDescription>Single producer single consumer byte buffer management.

View file

@ -11,7 +11,7 @@
<ItemGroup> <ItemGroup>
<!-- Listing the runtime specific packages to populate the dependencies section. <!-- Listing the runtime specific packages to populate the dependencies section.
Not building these references to avoid unintentional Build/Pack invocations. Not building these references to avoid unintentional Build/Pack invocations.
They are filtered in the traversal build in libraries-packages.proj based on the OutputRid. --> They are filtered in the traversal build in src.proj based on the OutputRid. -->
<ProjectReference Include="$(MSBuildThisFileDirectory)*.proj" Exclude="$(MSBuildProjectFile)" BuildReference="false" /> <ProjectReference Include="$(MSBuildThisFileDirectory)*.proj" Exclude="$(MSBuildProjectFile)" BuildReference="false" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View file

@ -2,7 +2,6 @@
<PropertyGroup> <PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework> <TargetFramework>netstandard2.0</TargetFramework>
<SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking> <SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking>
<IsPackable>true</IsPackable>
<!-- IncludeBuildOutput needs to be set to true to make NuGet include the passed in debug symbol files. --> <!-- IncludeBuildOutput needs to be set to true to make NuGet include the passed in debug symbol files. -->
<IncludeBuildOutput>true</IncludeBuildOutput> <IncludeBuildOutput>true</IncludeBuildOutput>
<DebugSymbols>false</DebugSymbols> <DebugSymbols>false</DebugSymbols>

View file

@ -6,8 +6,6 @@
<Nullable>annotations</Nullable> <Nullable>annotations</Nullable>
<TargetFrameworks>$(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent);netstandard2.0-windows;netstandard2.0-Unix;netstandard2.0;net461-windows</TargetFrameworks> <TargetFrameworks>$(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent);netstandard2.0-windows;netstandard2.0-Unix;netstandard2.0;net461-windows</TargetFrameworks>
<IsPackable>true</IsPackable> <IsPackable>true</IsPackable>
<!-- System.IO.Ports shouldn't see and build the runtime specific System.IO.Ports transitive references. -->
<DisableTransitiveProjectReferences>true</DisableTransitiveProjectReferences>
<PackageDescription>Provides classes for controlling serial ports. <PackageDescription>Provides classes for controlling serial ports.
Commonly Used Types: Commonly Used Types:
@ -155,8 +153,10 @@ System.IO.Ports.SerialPort</PackageDescription>
</ItemGroup> </ItemGroup>
<ItemGroup Condition="'$(IsPartialFacadeAssembly)' != 'true'"> <ItemGroup Condition="'$(IsPartialFacadeAssembly)' != 'true'">
<!-- Just reference the runtime meta package but don't build it to avoid accidentally packaging it when GeneratePackageOnBuild is true. --> <!-- Just reference the runtime meta package but don't build it to avoid unintentional Build/Pack invocations. -->
<ProjectReference Include="..\pkg\runtime.native.$(MSBuildProjectName).proj" BuildReference="false" /> <ProjectReference Include="..\pkg\runtime.native.$(MSBuildProjectName).proj" />
<!-- Make the runtime specific packages non transitive so that they aren't flowing into other projects. -->
<ProjectReference Include="..\pkg\runtime.*.runtime.native.$(MSBuildProjectName).proj" PrivateAssets="all" />
</ItemGroup> </ItemGroup>
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETStandard'"> <ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETStandard'">

View file

@ -3,7 +3,6 @@
<IsPartialFacadeAssembly>true</IsPartialFacadeAssembly> <IsPartialFacadeAssembly>true</IsPartialFacadeAssembly>
<TargetFrameworks>$(NetCoreAppCurrent)</TargetFrameworks> <TargetFrameworks>$(NetCoreAppCurrent)</TargetFrameworks>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="$(CoreLibProject)" /> <ProjectReference Include="$(CoreLibProject)" />

View file

@ -19,6 +19,8 @@
<IsPackable>true</IsPackable> <IsPackable>true</IsPackable>
<PackageDescription>Exposes new experimental APIs from System.Runtime</PackageDescription> <PackageDescription>Exposes new experimental APIs from System.Runtime</PackageDescription>
<PackageId>$(MSBuildProjectName)</PackageId> <PackageId>$(MSBuildProjectName)</PackageId>
<!-- TODO: Remove when the package shipped with NET6. -->
<DisablePackageBaselineValidation>true</DisablePackageBaselineValidation>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Compile Include="$(LibrariesProjectRoot)System.Runtime\ref\System.Runtime.cs" /> <Compile Include="$(LibrariesProjectRoot)System.Runtime\ref\System.Runtime.cs" />

View file

@ -0,0 +1,7 @@
<Project Sdk="Microsoft.Build.Traversal">
<ItemGroup>
<ProjectReference Include="..\ref\$(MSBuildProjectName).csproj" />
</ItemGroup>
</Project>

View file

@ -3,10 +3,5 @@
<PropertyGroup> <PropertyGroup>
<StrongNameKeyId>Open</StrongNameKeyId> <StrongNameKeyId>Open</StrongNameKeyId>
<SupportedOSPlatforms>windows</SupportedOSPlatforms> <SupportedOSPlatforms>windows</SupportedOSPlatforms>
<PackageDescription>Provides miscellaneous Windows-specific types
Commonly Used Types:
System.Security.Cryptography.X509Certificates.X509Certificate2UI
System.Security.Cryptography.X509Certificates.X509SelectionFlag</PackageDescription>
</PropertyGroup> </PropertyGroup>
</Project> </Project>

View file

@ -3,6 +3,11 @@
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<TargetFrameworks>$(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent);netcoreapp3.1-windows;netcoreapp3.1</TargetFrameworks> <TargetFrameworks>$(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent);netcoreapp3.1-windows;netcoreapp3.1</TargetFrameworks>
<IsPackable>true</IsPackable> <IsPackable>true</IsPackable>
<PackageDescription>Provides miscellaneous Windows-specific types
Commonly Used Types:
System.Security.Cryptography.X509Certificates.X509Certificate2UI
System.Security.Cryptography.X509Certificates.X509SelectionFlag</PackageDescription>
</PropertyGroup> </PropertyGroup>
<!-- DesignTimeBuild requires all the TargetFramework Derived Properties to not be present in the first property group. --> <!-- DesignTimeBuild requires all the TargetFramework Derived Properties to not be present in the first property group. -->
<PropertyGroup Condition="'$(TargetsWindows)' != 'true'"> <PropertyGroup Condition="'$(TargetsWindows)' != 'true'">

View file

@ -1,67 +0,0 @@
<Project Sdk="Microsoft.Build.Traversal" DefaultTargets="Pack">
<ItemGroup>
<PackageReference Include="Microsoft.DotNet.Build.Tasks.Packaging" Version="$(MicrosoftDotNetBuildTasksPackagingVersion)" />
</ItemGroup>
<ItemGroup Condition="'$(BuildAllConfigurations)' == 'true'">
<ProjectReference Include="$(MSBuildThisFileDirectory)System.Runtime.Experimental\ref\System.Runtime.Experimental.csproj" />
<ProjectReference Include="$(MSBuildThisFileDirectory)*\src\*.*proj"
Exclude="$(MSBuildThisFileDirectory)*\src\**\*.shproj" />
</ItemGroup>
<ItemGroup>
<!-- During an official build, build the identity package only in the allconfigurations build, otherwise always. -->
<ProjectReference Include="$(MSBuildThisFileDirectory)*\pkg\runtime.native.*.proj" Condition="'$(BuildingAnOfficialBuildLeg)' != 'true' or '$(BuildAllConfigurations)' == 'true'" />
<!-- During an official Build, build the rid specific package matching the OutputRid only outside of an allconfigurations build and only when targeting the CoreCLR runtime.
The limitation on the CoreCLR runtime is entirely artificial but avoids duplicate assets being publish. -->
<ProjectReference Include="$(MSBuildThisFileDirectory)*\pkg\runtime.$(OutputRid).*.proj" Condition="'$(BuildingAnOfficialBuildLeg)' != 'true' or
('$(BuildAllConfigurations)' != 'true' and '$(RuntimeFlavor)' == '$(PrimaryRuntimeFlavor)')" />
</ItemGroup>
<!-- Need the PackageIndexFile file property from baseline.props -->
<Import Project="$(PkgDir)baseline\baseline.props" />
<!-- Calculate PackageDownload items for restore. Skip this logic during source build to avoid pre-builts. -->
<Import Project="$(RepositoryEngineeringDir)restore\harvestPackages.targets" Condition="'$(MSBuildRestoreSessionId)' != '' and '$(DotNetBuildFromSource)' != 'true'" />
<!--
Updates the package index to mark all packages we are building that can go stable as stable.
this will allow for a kicked off build to control package stability at queue time. This does edit
the package index in-place but that shouldn't cause any problems for official builds are the only
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.
-->
<Target Name="UpdatePackageIndexWithStableVersions"
BeforeTargets="Build;Pack"
Condition="'$(DotNetFinalVersionKind)' == 'release'">
<ItemGroup>
<!--
The private packages don't get stabilized so they don't need to be included
in the set of packages that we are gathering stable versions from.
-->
<PkgProjects Include="$(PkgDir)*\*.pkgproj" Exclude="$(MSBuildThisFileDirectory)pkg\*Private*\*.pkgproj" />
<PkgProjects Include="*\pkg\**\*.pkgproj" />
</ItemGroup>
<MSBuild Targets="GetPackageIdentityIfStable"
BuildInParallel="$(BuildInParallel)"
Projects="@(PkgProjects)"
RemoveProperties="Configuration">
<Output TaskParameter="TargetOutputs" ItemName="_StablePackages" />
</MSBuild>
<Message Text="Marking package '%(_StablePackages.Identity)' stable with version '%(_StablePackages.Version)'" />
<UpdatePackageIndex
PackageIndexFile="$(PackageIndexFile)"
StablePackages="@(_StablePackages)" />
</Target>
<Target Name="SetAzureDevOpsVariableForBuiltPackages"
Condition="'$(ContinuousIntegrationBuild)' == 'true'"
AfterTargets="Build;Pack">
<Message Condition="Exists('$(ArtifactsDir)packages')" Importance="High" Text="##vso[task.setvariable variable=_librariesBuildProducedPackages]true" />
</Target>
</Project>

View file

@ -1,31 +0,0 @@
<Project>
<PropertyGroup>
<!-- Set PackageIndexFile to point to our local repo's index. This tells the packaging targets
which index should be used for updates -->
<PackageIndexFile>$(MSBuildThisFileDirectory)packageIndex.json</PackageIndexFile>
</PropertyGroup>
<ItemGroup>
<PackageIndex Include="$(PackageIndexFile)" />
</ItemGroup>
<!--
Below targets should moved to packaging.targets in BuildTools but keeping in corefx for convenience right now
-->
<Target Name="BlockStable" Condition="'$(SuppressFinalPackageVersion)' == 'true'" AfterTargets="CalculatePackageVersion">
<!-- DO NOT ship this packages as stable -->
<Error Condition="!$(PackageVersion.Contains('-'))" Text="Package $(Id) should not be built stable" />
</Target>
<!-- Get the package version if it isn't marked as block stable -->
<Target Name="GetPackageIdentityIfStable"
Returns="@(_StablePackageIdentity)">
<ItemGroup Condition="'$(SuppressFinalPackageVersion)' != 'true'">
<_StablePackageIdentity Include="$(Id)">
<Version>$(PackageVersion)</Version>
</_StablePackageIdentity>
</ItemGroup>
</Target>
</Project>

File diff suppressed because it is too large Load diff

View file

@ -5,20 +5,26 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<_allSrc Include="$(MSBuildThisFileDirectory)*\src\*.csproj" <_allSrc Include="$(MSBuildThisFileDirectory)*\src\*.*proj"
Exclude="@(ProjectExclusions)" /> Exclude="@(ProjectExclusions);
<!-- Don't build ProjectReferences of the compat pack in a traversal build to avoid unnecessary incremental builds. --> $(MSBuildThisFileDirectory)*\src\**\*.shproj" />
<_allSrc Update="$(MSBuildThisFileDirectory)Microsoft.Windows.Compatibility\src\Microsoft.Windows.Compatibility.csproj"
AdditionalProperties="BuildProjectReferences=false" />
<!-- Only build the compat pack in the allconfigurations leg. --> <!-- Only build the compat pack in the allconfigurations leg. -->
<_allSrc Remove="$(MSBuildThisFileDirectory)Microsoft.Windows.Compatibility\src\Microsoft.Windows.Compatibility.csproj" <_allSrc Remove="$(MSBuildThisFileDirectory)Microsoft.Windows.Compatibility\src\Microsoft.Windows.Compatibility.csproj"
Condition="'$(BuildAllConfigurations)' != 'true'" /> Condition="'$(BuildAllConfigurations)' != 'true'" />
<NonNetCoreAppProject Include="@(_allSrc)" <NonNetCoreAppProject Include="@(_allSrc)"
Exclude="@(NetCoreAppLibrary->'%(Identity)\src\%(Identity).csproj')" /> Exclude="@(NetCoreAppLibrary->'%(Identity)\src\%(Identity).csproj');
<NetCoreAppProject Include="$(CoreLibProject);
@(_allSrc);
$(MSBuildThisFileDirectory)Microsoft.VisualBasic.Core\src\Microsoft.VisualBasic.Core.vbproj; $(MSBuildThisFileDirectory)Microsoft.VisualBasic.Core\src\Microsoft.VisualBasic.Core.vbproj;
$(MSBuildThisFileDirectory)System.Runtime.CompilerServices.Unsafe\src\System.Runtime.CompilerServices.Unsafe.ilproj" $(MSBuildThisFileDirectory)System.Runtime.CompilerServices.Unsafe\src\System.Runtime.CompilerServices.Unsafe.ilproj" />
<!-- During an official build, build the identity package only in the allconfigurations build, otherwise always. -->
<NonNetCoreAppProject Include="$(MSBuildThisFileDirectory)*\pkg\runtime.native.*.proj" Condition="'$(BuildingAnOfficialBuildLeg)' != 'true' or '$(BuildAllConfigurations)' == 'true'" />
<!-- During an official Build, build the rid specific package matching the OutputRid only outside of an allconfigurations build and only when targeting the CoreCLR runtime.
The limitation on the CoreCLR runtime is entirely artificial but avoids duplicate assets being publish. -->
<NonNetCoreAppProject Include="$(MSBuildThisFileDirectory)*\pkg\runtime.$(OutputRid).*.proj" Condition="'$(BuildingAnOfficialBuildLeg)' != 'true' or
('$(BuildAllConfigurations)' != 'true' and '$(RuntimeFlavor)' == '$(PrimaryRuntimeFlavor)')" />
<NetCoreAppProject Include="$(CoreLibProject);
@(_allSrc)"
Exclude="@(NonNetCoreAppProject)" /> Exclude="@(NonNetCoreAppProject)" />
<ManualShimProject Include="shims\manual\*.csproj" /> <ManualShimProject Include="shims\manual\*.csproj" />
<ApiCompatProject Include="shims\ApiCompat.proj" <ApiCompatProject Include="shims\ApiCompat.proj"
@ -63,4 +69,11 @@
Projects="@(ApiCompatProject)" Projects="@(ApiCompatProject)"
Properties="$(TraversalGlobalProperties)" /> Properties="$(TraversalGlobalProperties)" />
</Target> </Target>
<Target Name="SetAzureDevOpsVariableForBuiltPackages"
Condition="'$(ContinuousIntegrationBuild)' == 'true'"
AfterTargets="Build;Pack">
<Message Condition="Exists('$(ArtifactsDir)packages')" Importance="High" Text="##vso[task.setvariable variable=_librariesBuildProducedPackages]true" />
</Target>
</Project> </Project>