Implement roll-forward policies for .NET Core SDK resolution. (dotnet/core-setup#6953)
Implements additional roll-forward policies for resolving a .NET
Core SDK based upon new SDK settings in `global.json`.
Two new values are now supported in `global.json` in the `sdk` settings:
* `rollForward` - the roll-forward policy to use (see below).
* `allowPrerelease` - controls whether or not preview SDKS may be resolved
(defaults to `true` to allow resolving prerelease SDKs).
The new roll-forward policies are:
* `patch` - If the requested SDK is installed, use it. Otherwise, use the
latest installed patch level that matches the requested major, minor, and
feature band.
* `feature` - If the requested major, minor, and feature band is installed, use
the latest patch level for the specified feature band. Otherwise, roll-forward
to the next available feature band and use the latest patch level for that
feature band.
* `minor` - If the requested major, minor, and feature band is installed, use
the latest patch level for the specified feature band. Otherwise, roll-forward
to the next available feature band available for the same major version and use
the latest patch level for that feature band.
* `major` - If the requested major, minor, and feature band is installed, use
the latest patch level for the specified feature band. Otherwise, roll-forward
to the next available feature band available without restriction and use the
latest patch level for that feature band.
* `latestPatch` - Use the latest installed patch level that matches the
requested major, minor, and feature band.
* `latestFeature` - Use the latest installed patch level for the latest
installed feature band that matches the requested major and minor version.
* `latestMinor` - Use the latest installed patch level for the latest installed
feature band for the latest installed minor version that matches the requested
major version.
* `latestMajor` - Use the absolutely latest .NET Core SDK available.
For backwards compatibility, the policy when a `version` is not specified in
`global.json` will be `latestMajor`. The default policy when a `version` is
specified but `rollForward` is not specified will be `patch`.
Commit migrated from https://github.com/dotnet/core-setup/commit/
5cd0245860335e0b307f6a46b99c6f9244887318