Skip to content

Commit

Permalink
Merge branch 'main' and dotnet#57297
Browse files Browse the repository at this point in the history
  • Loading branch information
sakno committed Aug 17, 2021
2 parents 2a94300 + 86562e1 commit 82187cb
Show file tree
Hide file tree
Showing 1,135 changed files with 37,196 additions and 29,009 deletions.
2 changes: 1 addition & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
]
},
"microsoft.dotnet.xharness.cli": {
"version": "1.0.0-prerelease.21373.1",
"version": "1.0.0-prerelease.21404.1",
"commands": [
"xharness"
]
Expand Down
9 changes: 0 additions & 9 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,7 @@ csharp_preserve_single_line_statements = false:none
csharp_prefer_static_local_function = true:suggestion
csharp_prefer_simple_using_statement = false:none
csharp_style_prefer_switch_expression = true:suggestion

# Code quality
dotnet_style_readonly_field = true:suggestion
dotnet_code_quality_unused_parameters = non_public:suggestion

# Expression-level preferences
dotnet_style_object_initializer = true:suggestion
Expand Down Expand Up @@ -157,12 +154,6 @@ csharp_space_between_method_declaration_parameter_list_parentheses = false
csharp_space_between_parentheses = false
csharp_space_between_square_brackets = false

# Analyzers
dotnet_code_quality.CA1052.api_surface = private, internal
dotnet_code_quality.CA1802.api_surface = private, internal
dotnet_code_quality.CA1822.api_surface = private, internal
dotnet_code_quality.CA2208.api_surface = public

# License header
file_header_template = Licensed to the .NET Foundation under one or more agreements.\nThe .NET Foundation licenses this file to you under the MIT license.

Expand Down
Empty file modified .vsconfig
100755 → 100644
Empty file.
6 changes: 0 additions & 6 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -259,12 +259,6 @@
<IsShippingAssembly Condition="$(IsExperimentalAssembly)">false</IsShippingAssembly>
<!-- We don't want Private packages to be shipped to NuGet.org -->
<IsShippingPackage Condition="$(MSBuildProjectName.Contains('Private')) or $(IsExperimentalAssembly)">false</IsShippingPackage>
<!-- A package isn't generated if in servicing or in runtimelab. Intended to be overridden at project level.
Excluding .sfxprojs as they have their own incremental servicing infra. -->
<GeneratePackage Condition="'$(GeneratePackage)' == ''">true</GeneratePackage>
<GeneratePackage Condition="(('$(PreReleaseVersionLabel)' == 'servicing' or
'$(GitHubRepositoryName)' == 'runtimelab') and
'$(MSBuildProjectExtension)' != '.sfxproj')">false</GeneratePackage>
<PlaceholderFile>$(RepositoryEngineeringDir)_._</PlaceholderFile>
</PropertyGroup>

Expand Down
82 changes: 34 additions & 48 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project InitialTargets="ErrorForMissingPackageDescription;_OverridePackDependsOn">
<Project>
<PropertyGroup>
<!--
For non-SDK projects that import this file and then import Microsoft.Common.targets,
Expand Down Expand Up @@ -39,7 +39,7 @@
<None Include="$(LicenseFile)"
PackagePath="$([System.IO.Path]::GetFileName('$(LicenseFile)'))"
Pack="true"
Condition="'$(MSBuildProjectExtension)' != '.sfxproj'" />
Condition="'$(MSBuildProjectExtension)' != '.sfxproj' and '$(MSBuildProjectFile)' != 'msi.csproj'" />
<None Include="$(PackageThirdPartyNoticesFile)"
PackagePath="$([System.IO.Path]::GetFileName('$(PackageThirdPartyNoticesFile)'))"
Pack="true" />
Expand All @@ -54,57 +54,43 @@
<PackageDescription Condition="'$(PackageDescription)' == '' and '$(UseRuntimePackageDisclaimer)' == 'true'">$(RuntimePackageDisclaimer)</PackageDescription>
<!-- Keep in sync as required by the Packaging SDK in Arcade. -->
<Description>$(PackageDescription)</Description>
<!-- BeforePack hook should be removed after porting all the projects to dotnet pack. -->
<BeforePack>$(BeforePack);AddNETStandardCompatErrorFileForPackaging</BeforePack>
<GenerateNuspecDependsOn>AddNETStandardCompatErrorFileForPackaging;$(GenerateNuspecDependsOn)</GenerateNuspecDependsOn>
</PropertyGroup>

<!-- Remove when https://github.com/NuGet/Home/issues/10405 is implemented and consumed. -->
<Target Name="ErrorForMissingPackageDescription"
Condition="'$(IsPackable)' == 'true' and '$(PackageDescription)' == ''">
<Error Text="Required property 'PackageDescription' is missing for $(MSBuildProjectName)." />
</Target>

<!-- <GeneratePackage /> controls if a package should be created by clearing out <PackDependsOn />. -->
<Target Name="_OverridePackDependsOn"
Condition="'$(IsPackable)' == 'true' and
'$(GeneratePackage)' != 'true'">
<!--
Arcade SDK versioning is defined by static properties in a targets file: work around this by
moving properties based on versioning into a target.
-->
<Target Name="GetProductVersions">
<PropertyGroup>
<PackDependsOn />
</PropertyGroup>
</Target>
<IncludePreReleaseLabelInPackageVersion Condition="'$(DotNetFinalVersionKind)' != 'release'">true</IncludePreReleaseLabelInPackageVersion>
<IncludePreReleaseLabelInPackageVersion Condition="'$(SuppressFinalPackageVersion)' == 'true'">true</IncludePreReleaseLabelInPackageVersion>
<IncludePreReleaseLabelInPackageVersion Condition="'$(IsShipping)' != 'true'">true</IncludePreReleaseLabelInPackageVersion>

<!-- Add targets file that marks a .NETStandard applicable tfm as unsupported. -->
<Target Name="AddNETStandardCompatErrorFileForPackaging"
Condition="'@(NETStandardCompatError)' != ''"
Inputs="%(NETStandardCompatError.Identity)"
Outputs="unused">
<PropertyGroup>
<_NETStandardCompatErrorFilePath>$(BaseIntermediateOutputPath)netstandardcompaterrors\%(NETStandardCompatError.Identity)\$(PackageId).targets</_NETStandardCompatErrorFilePath>
<_NETStandardCompatErrorFileTarget>NETStandardCompatError_$(PackageId.Replace('.', '_'))_$([System.String]::new('%(NETStandardCompatError.Supported)').Replace('.', '_'))</_NETStandardCompatErrorFileTarget>
<_NETStandardCompatErrorFileContent>
<![CDATA[<Project InitialTargets="$(_NETStandardCompatErrorFileTarget)">
<Target Name="$(_NETStandardCompatErrorFileTarget)"
Condition="'%24(SuppressTfmSupportBuildWarnings)' == ''">
<Error Text="$(PackageId) doesn't support %24(TargetFramework). Consider updating your TargetFramework to %(NETStandardCompatError.Supported) or later." />
</Target>
</Project>]]>
</_NETStandardCompatErrorFileContent>
</PropertyGroup>
<IncludeBuildNumberInPackageVersion Condition="'$(StabilizePackageVersion)' != 'true'">true</IncludeBuildNumberInPackageVersion>
<IncludeBuildNumberInPackageVersion Condition="'$(SuppressFinalPackageVersion)' == 'true'">true</IncludeBuildNumberInPackageVersion>
<IncludeBuildNumberInPackageVersion Condition="'$(IsShipping)' != 'true'">true</IncludeBuildNumberInPackageVersion>

<WriteLinesToFile File="$(_NETStandardCompatErrorFilePath)"
Lines="$(_NETStandardCompatErrorFileContent)"
Overwrite="true"
WriteOnlyWhenDifferent="true" />
<ProductVersionSuffix Condition="'$(IncludePreReleaseLabelInPackageVersion)' == 'true'">-$(VersionSuffix)</ProductVersionSuffix>
<ProductBandVersion Condition="'$(ProductBandVersion)' == ''">$(MajorVersion).$(MinorVersion)</ProductBandVersion>
<ProductionVersion Condition="'$(ProductionVersion)' == ''">$(ProductBandVersion).$(PatchVersion)</ProductionVersion>
<ProductVersion>$(ProductionVersion)$(ProductVersionSuffix)</ProductVersion>

<ItemGroup>
<None Include="$(_NETStandardCompatErrorFilePath)"
PackagePath="buildTransitive\%(NETStandardCompatError.Identity)"
Pack="true" />
<None Include="$(PlaceholderFile)"
PackagePath="buildTransitive\%(NETStandardCompatError.Supported)"
Pack="true" />
<FileWrites Include="$(_NETStandardCompatErrorFilePath)" />
</ItemGroup>
<SharedFrameworkNugetVersion>$(ProductVersion)</SharedFrameworkNugetVersion>
<NuGetVersion>$(SharedFrameworkNugetVersion)</NuGetVersion>
<InstallersRelativePath>Runtime/$(SharedFrameworkNugetVersion)/</InstallersRelativePath>

<!--
By default, we are always building the nuget packages for HostPolicy, HostFXR and
Dotnet/AppHost. Thus, the properties (below) are always set to $(ProductVersion).
However, there are scenarios when only some of these components will change (e.g. during
servicing, we may only change HostPolicy but not HostFXR and Dotnet/AppHost). In such cases,
pass the appropriate version value(s) as argument to the build command in order to override;
e.g. 'build -p:HostPolicyVersion=x.y.z ...'
-->
<HostVersion Condition="'$(HostVersion)' == ''">$(ProductVersion)</HostVersion>
<AppHostVersion Condition="'$(AppHostVersion)' == ''">$(ProductVersion)</AppHostVersion>
<HostResolverVersion Condition="'$(HostResolverVersion)' == ''">$(ProductVersion)</HostResolverVersion>
<HostPolicyVersion Condition="'$(HostPolicyVersion)' == ''">$(ProductVersion)</HostPolicyVersion>
</PropertyGroup>
</Target>
</Project>
41 changes: 0 additions & 41 deletions THIRD-PARTY-NOTICES.TXT
Original file line number Diff line number Diff line change
Expand Up @@ -902,47 +902,6 @@ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

License notice for Sun Microsystems
-----------------------------------


Copyright (c) 2002 Sun Microsystems, Inc. All Rights Reserved.

Redistribution and use in source and binary forms, with or
without modification, are permitted provided that the following
conditions are met:

-Redistribution of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.

-Redistribution in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials
provided with the distribution.

Neither the name of Sun Microsystems, Inc. or the names of
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.

This software is provided "AS IS," without a warranty of any
kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND
WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE
HEREBY EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS
LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY
LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS
SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR ITS
LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR
FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY
OF LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE
THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY
OF SUCH DAMAGES.

You acknowledge that this software is not designed, licensed or
intended for use in the design, construction, operation or
maintenance of any nuclear facility.


License notice for "Faster Unsigned Division by Constants"
------------------------------
Expand Down
10 changes: 0 additions & 10 deletions docs/coding-guidelines/adding-api-guidelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,6 @@ should be added to `net5.0`. [More Information on TargetFrameworks](https://docs

## 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**
- 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.
Expand All @@ -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.

## 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?**_

Expand Down
12 changes: 6 additions & 6 deletions docs/coding-guidelines/libraries-packaging.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

## .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).

Expand All @@ -26,17 +26,17 @@ Transport packages are non-shipping packages that dotnet/runtime produces in ord

This package represents the set of libraries which are produced in dotnet/runtime and ship in the ASP.NETCore shared framework. We produce a transport package so that we can easily share reference assemblies and implementation configurations that might not be present in NuGet packages that also ship.

To add a library to the ASP.NETCore shared framework, that library should set the `IsAspNetCoreApp` property for its `ref` and `src` project. This is typically done in the library's `Directory.Build.props`, for example https://github.com/dotnet/runtime/blob/98ac23212e6017c615e7e855e676fc43c8e44cb8/src/libraries/Microsoft.Extensions.Logging.Abstractions/Directory.Build.props#L4.
To add a library to the ASP.NETCore shared framework, that library should be listed in the `AspNetCoreAppLibrary` section in `NetCoreAppLibrary.props`.

Source generators and analyzers can be included in the ASP.NETCore shared framework by specifying `IsAspNetCoreAppAnalyzer`. These projects should specify `AnalyzerLanguage` as mentioned [below](#analyzers--source-generators).
Source generators and analyzers can be included in the ASP.NETCore shared framework by adding them to the `Microsoft.AspNetCore.Internal.Transport.proj` as an AnalyzerReference. These projects should specify `AnalyzerLanguage` as mentioned [below](#analyzers--source-generators).

Libraries included in this transport package should ensure all direct and transitive assembly references are also included in either the ASP.NETCore shared framework or the .NETCore shared framework. This is not validated in dotnet/runtime at the moment: https://github.com/dotnet/runtime/issues/52562

Removing a library from this transport package is a breaking change and should be avoided.

## 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.

Expand Down
Loading

0 comments on commit 82187cb

Please sign in to comment.