Fixes https://github.com/dotnet/corefx/issues/5707
We are changing the .NET packages to no longer use the ‘dotnet’, ‘dotnet5.x’, and ‘dnxcore50’ monikers. This is thee first stage of the change for dotnet->netstandard.
The replacements are as follows
Old moniker | New moniker
----------------- | ------------------
dotnet5.x | netstandard1.y (where y = x -1)
DNXCore50 | netstandardapp1.5
dotnet | netstandard1.3
To prepare for this change you can do the following to your project.json. This change will require a recent build of NuGet or dotnet.exe and can be done prior to consuming the packages with the breaking change. These packages will not work with DNX.
For a project targeting dotnet5.6
```
"frameworks": {
"netstandard1.5": {
"imports": [ "dotnet5.6" ]
}
},
```
For a project targeting dnxcore50
```
"frameworks": {
"netstandardapp1.5": {
"imports": [ "dnxcore50", "portable-net45+win8" ]
}
},
```
[tfs-changeset: 1578321]
Commit migrated from https://github.com/dotnet/corefx/commit/4435f9f2776ae007e05f4454675e56cf76a51975
* Move all of the project configurations currently living in the
"facade\<lib>.csproj" files into the root library project. This means
there will now be only one project file for the source build of each
library, regardless of how many configurations it has. The .builds file
of each library will only reference that single project file multiple
times.
* Do some minor cleanup of project files along the way. Fix up the VS
default configuration blocks to be a bit more uniform. Remove redundant
defaults (OutputType, PlatformTarget, etc. Fix some condition spacing.
Commit migrated from https://github.com/dotnet/corefx/commit/26edfd6839044ca6368e28502e0893c1b1819b4c
Some fixes (adding imports, adding Platforms package) were tooled, but more complex ones (forking project.jsons, editing csproj's) were not.
Also makes dependency version validation rules case-insensitive. (I used this fix to update the versions of some packages.)
[tfs-changeset: 1573868]
Commit migrated from https://github.com/dotnet/corefx/commit/84af04317505d48feaa1e83dd5dc27ddc0f6de76
This these .builds files were updated and generated from a script
based on the configurations defined in the matching csproj files.
This updates the builds files to specify OSGroup and TargetGroup
as metadata instead of using AdditionalProperties and also sorts them by
TargetGroup followed by OSGroup.
Commit migrated from https://github.com/dotnet/corefx/commit/95efe37475916016a5fc6ee6f0ba584d990c4196
This add a default configuration before the Import of dirs.props
for any projects that don't have Debug as the default configuration.
Removed Configuration and Platform properties set after dirs.props
as they would have no affect and just cause confusion.
Removed OutputType=Library property as it isn't necessary.
Commit migrated from https://github.com/dotnet/corefx/commit/9e1da13cf6d5ff4b37b1867beb3411a2fe61da6a
These facade project files were generated using a porting tool I wrote,
which examined some information from our internal build and created
appropriate project files. I have also re-generated all of the .builds
files so that they import the facade projects in the correct manner.
Commit migrated from https://github.com/dotnet/corefx/commit/58e2f6e862060039e1ebad727d75c87703fdb2f2
A change was made to DNX to no longer restore project.jsons
that are in nested folders. This caused my batch update to miss
a number of tests and reference assembly projects.
This fixes the stale lock files, but restore is still broken.
[tfs-changeset: 1540448]
Commit migrated from https://github.com/dotnet/corefx/commit/3622cccc1b22fa1947a72d5126b59864e9d2fd0d
We need a new DNX to understand the latest packages.
We also need to move all "dotnet" projects to use dotnetX.X (generations)
now that the packages no longer have "dotnet" assets.
The new version of DNX dropped support for the aspnetcore
so I needed to update a few projects/packages that depended
on old package versions that had this moniker.
[tfs-changeset: 1540388]
Commit migrated from https://github.com/dotnet/corefx/commit/38f8d7a3ca1ee819c2b8eabb1c07ee4e99683c97
All projects that previously used dotnet have been updated to specify the appropriate generation of the surface area they depend on or in the case of desktop inbox contracts, the generation that includes the set of platforms they can support.
Now all packages contain all generations of API that they have ever shipped.
In doing this I needed to change how we determine package version. Before we ensured all assemblies would have the same version and used that. Now we choose the max.
Additionally I needed to change how we chose which asset to use for netcore50 when the dotnet asset was obscured by a placeholder for a previous netcore release (eg System.Runtime will have placeholders for Win8 since it was inbox there). To do this I wrote a task that uses nuget to evaluate the package assets with and without the placeholders. In this way it chooses the "best" dotnet implementation and reference assembly to use for netcore50.
This new model made my old MSBuild-based validation impossible to carry forward, so I wrote better validation in a task that actually uses Nuget's asset resolution algorithm. This uncovered many existing issues in packages that I have cleaned up. The validation algorithm could use some polish but its working now. Perf is not great, package build went from 15s to ~2 minutes. I'll work on this some more by making it incremental (input: nuspec, output: marker created on success). Profiling shows that most of the time is spent in calling the nuget APIs. I'll see if I can reduce some of this with caching for things that don't change (eg: RID graph). Ultimately I think its a reasonable tradeoff for the types of bugs I can find this way.
[tfs-changeset: 1539216]
Commit migrated from https://github.com/dotnet/corefx/commit/0931c347eb836c9da94d0d5ff9ad7a14403b9738
System.Linq.Queryable uses ReadOnlyCollectionExtensions to create
ReadOnlyCollection instances in a way that should increase aliasing (hence
reducing allocations), and guarantee that the underlying collection is not
mutated elsewhere.
However, the only paths that hit it do so with collections that will never
be already ReadOnlyCollection (one possible alias opportunity gone) or empty
or null (the other gone). Nor will the collections ever be accessed by any
other code (removing the risk of mutation).
Futher, while the use of `ToArray()` also gives the lightest possible choice
for contained collection, with an advantage on memory pressure if the instance
was long-lasting, all collections so-produced are soon eligible for collection,
so calling `ToArray()` just leads to more allocations unnecessarily, along with
having a more costly interface invocation.
Therefore, replace such uses with `List<T>`'s `AsReadOnly()`.
Commit migrated from https://github.com/dotnet/corefx/commit/bfa812bd8d362f9f7cba8a75711a16213a7751a1
Method is never called twice on same instance, so caching saves nothing.
Remove redundant array creation.
No calling code benefits from this. Use Where rather than explicit
filtering with yield as one caller then uses Where so the predicates
can be combined.
Hold result of repeated calls to GetTypeInfo in local
Hold result of repeated calls to Method getter in local
Don't construct array just to select just one element from it.
Commit migrated from https://github.com/dotnet/corefx/commit/df648a8f60ac70113bdcbb2695ce87e3ef320dee
ReadOnlyCollection is used to create an array, but that array is then never
used.
As the collection cannot be null, doesn't even change exception timing of null
reference to remove it, just removes redundant array construction.
Commit migrated from https://github.com/dotnet/corefx/commit/fd7231fc7227e8c0b1cb5cc271c013fdf96ce8d4
Adapt Enumerable tests for Queryable.
Copy tests for System.Linq.Enumerable.
Remove those specific to Enumerable, varying to test implementation details of
Enumerable, testing promises of Enumerable that Queryable doesn't promise (e.g.
stability in OrderBy), or otherwise not relevant.
Move the previous tests in QueryableTests into the relevant class introduced
with this.
Add some tests for runtime error checks not covered by this.
Increases line/branch coverage of assembly from 74.5%/44.7% to 85.6%/75.5% with
System.Linq.Queryable going from 86.8%/50.2% to 100%/100%.
Commit migrated from https://github.com/dotnet/corefx/commit/198551e1b26fea4915f8ba3fae2fa6678c637846
There were two instances in the code of trying to mimic the old
Type.GetGenericArguments() with TypeInfo API that were incorrect.
Both attempts ignored that TypeInfo separates generic type definition
parameters from generic instantiation arguments.
Case 1: System.Linq.Expressions.Tests
--------------------------------------
These already had a reference to System.Reflection.TypeExtensions,
which provides all of the compatibility API it needed, so the custom
helpers are simply deleted.
Case 2: System.Linq.Queryable
-----------------------------
This library doesn't depend on System.Reflection.TypeExtensions and
so the trivial helper is left there but corrected to match the expected
behavior of the classic API.
Commit migrated from https://github.com/dotnet/corefx/commit/cba086e8a35fadf3b44a949a7a3fd6cd0c2e003f