-
Notifications
You must be signed in to change notification settings - Fork 525
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Framework fixes #2250
Framework fixes #2250
Changes from 4 commits
fe37245
ea553a3
13f5b46
3fa93e4
2ff613d
9e208ef
3a17495
c8f8e2b
da847a1
b4093d2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,25 +22,73 @@ type FrameworkVersion = | |
| V4_6_1 | ||
| V4_6_2 | ||
| V4_6_3 | ||
| V4_7 | ||
| V5_0 | ||
member private self.NumKey = | ||
match self with | ||
| V1 -> 0 | ||
| V1_1 -> 1 | ||
| V2 -> 2 | ||
| V3 -> 3 | ||
| V3_5 -> 4 | ||
| V4_Client -> 5 | ||
| V4 -> 6 | ||
| V4_5 -> 7 | ||
| V4_5_1 -> 8 | ||
| V4_5_2 -> 9 | ||
| V4_5_3 -> 10 | ||
| V4_6 -> 11 | ||
| V4_6_1 -> 12 | ||
| V4_6_2 -> 13 | ||
| V4_6_3 -> 14 | ||
| V4_7 -> 15 | ||
| V5_0 -> 16 | ||
static member private FromNum num = | ||
match num with | ||
| 0 -> V1 | ||
| 1 -> V1_1 | ||
| 2 -> V2 | ||
| 3 -> V3 | ||
| 4 -> V3_5 | ||
| 5 -> V4_Client | ||
| 6 -> V4 | ||
| 7 -> V4_5 | ||
| 8 -> V4_5_1 | ||
| 9 -> V4_5_2 | ||
| 10 -> V4_5_3 | ||
| 11 -> V4_6 | ||
| 12 -> V4_6_1 | ||
| 13 -> V4_6_2 | ||
| 14 -> V4_6_3 | ||
| 15 -> V4_7 | ||
| 16 -> V5_0 | ||
| _ -> failwithf "'%i' has no corresponding framework version" num | ||
|
||
static member (<->) (lower:FrameworkVersion,upper:FrameworkVersion) = | ||
if lower.NumKey < upper.NumKey then | ||
[ lower.NumKey .. upper.NumKey ] |> List.map FrameworkVersion.FromNum | ||
else | ||
[ lower.NumKey .. -1 .. upper.NumKey ] |> List.map FrameworkVersion.FromNum | ||
|
||
override this.ToString() = | ||
match this with | ||
| V1 -> "v1.0" | ||
| V1_1 -> "v1.1" | ||
| V2 -> "v2.0" | ||
| V3 -> "v3.0" | ||
| V3_5 -> "v3.5" | ||
| V1 -> "v1.0" | ||
| V1_1 -> "v1.1" | ||
| V2 -> "v2.0" | ||
| V3 -> "v3.0" | ||
| V3_5 -> "v3.5" | ||
| V4_Client -> "v4.0" | ||
| V4 -> "v4.0" | ||
| V4_5 -> "v4.5" | ||
| V4_5_1 -> "v4.5.1" | ||
| V4_5_2 -> "v4.5.2" | ||
| V4_5_3 -> "v4.5.3" | ||
| V4_6 -> "v4.6" | ||
| V4_6_1 -> "v4.6.1" | ||
| V4_6_2 -> "v4.6.2" | ||
| V4_6_3 -> "v4.6.3" | ||
| V5_0 -> "v5.0" | ||
| V4 -> "v4.0" | ||
| V4_5 -> "v4.5" | ||
| V4_5_1 -> "v4.5.1" | ||
| V4_5_2 -> "v4.5.2" | ||
| V4_5_3 -> "v4.5.3" | ||
| V4_6 -> "v4.6" | ||
| V4_6_1 -> "v4.6.1" | ||
| V4_6_2 -> "v4.6.2" | ||
| V4_6_3 -> "v4.6.3" | ||
| V4_7 -> "v4.7" | ||
| V5_0 -> "v5.0" | ||
|
||
member this.ShortString() = | ||
match this with | ||
|
@@ -59,6 +107,7 @@ type FrameworkVersion = | |
| FrameworkVersion.V4_6_1 -> "461" | ||
| FrameworkVersion.V4_6_2 -> "462" | ||
| FrameworkVersion.V4_6_3 -> "463" | ||
| FrameworkVersion.V4_7 -> "47" | ||
| FrameworkVersion.V5_0 -> "50" | ||
|
||
[<RequireQualifiedAccess>] | ||
|
@@ -72,6 +121,35 @@ type DotNetStandardVersion = | |
| V1_4 | ||
| V1_5 | ||
| V1_6 | ||
| V2_0 | ||
member private this.NumKey = | ||
match this with | ||
| V1_0 -> 0 | ||
| V1_1 -> 1 | ||
| V1_2 -> 2 | ||
| V1_3 -> 3 | ||
| V1_4 -> 4 | ||
| V1_5 -> 5 | ||
| V1_6 -> 6 | ||
| V2_0 -> 7 | ||
static member private FromNum num = | ||
match num with | ||
| 0 -> V1_0 | ||
| 1 -> V1_1 | ||
| 2 -> V1_2 | ||
| 3 -> V1_3 | ||
| 4 -> V1_4 | ||
| 5 -> V1_5 | ||
| 6 -> V1_6 | ||
| 7 -> V2_0 | ||
| _ -> failwithf "'%i' has no corresponding framework version" num | ||
|
||
static member (<->) (lower:DotNetStandardVersion,upper:DotNetStandardVersion) = | ||
if lower.NumKey < upper.NumKey then | ||
[ lower.NumKey .. upper.NumKey ] |> List.map DotNetStandardVersion.FromNum | ||
else | ||
[ lower.NumKey .. -1 .. upper.NumKey ] |> List.map DotNetStandardVersion.FromNum | ||
|
||
override this.ToString() = | ||
match this with | ||
| V1_0 -> "v1.0" | ||
|
@@ -81,7 +159,7 @@ type DotNetStandardVersion = | |
| V1_4 -> "v1.4" | ||
| V1_5 -> "v1.5" | ||
| V1_6 -> "v1.6" | ||
|
||
| V2_0 -> "v2.0" | ||
member this.ShortString() = | ||
match this with | ||
| DotNetStandardVersion.V1_0 -> "10" | ||
|
@@ -91,6 +169,7 @@ type DotNetStandardVersion = | |
| DotNetStandardVersion.V1_4 -> "14" | ||
| DotNetStandardVersion.V1_5 -> "15" | ||
| DotNetStandardVersion.V1_6 -> "16" | ||
| DotNetStandardVersion.V2_0 -> "20" | ||
|
||
[<RequireQualifiedAccess>] | ||
/// The UAP version. | ||
|
@@ -112,15 +191,33 @@ type UAPVersion = | |
type DotNetCoreVersion = | ||
| V1_0 | ||
| V1_1 | ||
| V2_0 | ||
member private this.NumKey = | ||
match this with | ||
| V1_0 -> 0 | ||
| V1_1 -> 1 | ||
| V2_0 -> 2 | ||
static member private FromNum num = | ||
match num with | ||
| 0 -> V1_0 | ||
| 1 -> V1_1 | ||
| 2 -> V2_0 | ||
| _ -> failwithf "'%i' has no corresponding framework version" num | ||
static member (<->) (lower:DotNetCoreVersion,upper:DotNetCoreVersion) = | ||
if lower.NumKey < upper.NumKey then | ||
[ lower.NumKey .. upper.NumKey ] |> List.map DotNetCoreVersion.FromNum | ||
else | ||
[ lower.NumKey .. -1 .. upper.NumKey ] |> List.map DotNetCoreVersion.FromNum | ||
override this.ToString() = | ||
match this with | ||
| V1_0 -> "v1.0" | ||
| V1_1 -> "v1.1" | ||
|
||
| V2_0 -> "v2.0" | ||
member this.ShortString() = | ||
match this with | ||
| DotNetCoreVersion.V1_0 -> "10" | ||
| DotNetCoreVersion.V1_1 -> "11" | ||
| DotNetCoreVersion.V2_0 -> "20" | ||
|
||
module KnownAliases = | ||
let Data = | ||
|
@@ -185,6 +282,20 @@ type FrameworkIdentifier = | |
| WindowsPhoneApp v -> "wpa" + v | ||
| Silverlight v -> "sl" + v.Replace("v","").Replace(".","") | ||
|
||
member private x.CompatibleUpto (?topFramework, ?topStandard, ?topCore) = | ||
[ match topFramework with | ||
| None -> () | Some framework -> yield! framework <-> FrameworkVersion.V1 |> List.map DotNetFramework | ||
match topStandard with | ||
| None -> () | Some standard -> yield! standard <-> DotNetStandardVersion.V1_0 |> List.map DotNetStandard | ||
match topCore with | ||
| None -> () | Some core -> yield! core <-> DotNetCoreVersion.V1_0 |> List.map DotNetCore | ||
] | ||
|
||
member private x.CompatibleUpto (topStandard) = | ||
[ yield! topStandard <-> DotNetStandardVersion.V1_0 |> List.map DotNetStandard ] | ||
|
||
member private x.CompatibleUpto (topCore) = | ||
[ yield! topCore <-> DotNetCoreVersion.V1_0 |> List.map DotNetCore ] | ||
|
||
// returns a list of compatible platforms that this platform also supports | ||
member x.SupportedPlatforms = | ||
|
@@ -209,9 +320,10 @@ type FrameworkIdentifier = | |
| DotNetFramework FrameworkVersion.V4_5_2 -> [ DotNetFramework FrameworkVersion.V4_5_1; DotNetStandard DotNetStandardVersion.V1_2 ] | ||
| DotNetFramework FrameworkVersion.V4_5_3 -> [ DotNetFramework FrameworkVersion.V4_5_2; DotNetStandard DotNetStandardVersion.V1_2 ] | ||
| DotNetFramework FrameworkVersion.V4_6 -> [ DotNetFramework FrameworkVersion.V4_5_3; DotNetStandard DotNetStandardVersion.V1_3 ] | ||
| DotNetFramework FrameworkVersion.V4_6_1 -> [ DotNetFramework FrameworkVersion.V4_6; DotNetStandard DotNetStandardVersion.V1_4 ] | ||
| DotNetFramework FrameworkVersion.V4_6_1 -> [ DotNetFramework FrameworkVersion.V4_6; DotNetStandard DotNetStandardVersion.V1_4; DotNetStandard DotNetStandardVersion.V2_0 ] | ||
| DotNetFramework FrameworkVersion.V4_6_2 -> [ DotNetFramework FrameworkVersion.V4_6_1; DotNetStandard DotNetStandardVersion.V1_5 ] | ||
| DotNetFramework FrameworkVersion.V4_6_3 -> [ DotNetFramework FrameworkVersion.V4_6_2; DotNetStandard DotNetStandardVersion.V1_6 ] | ||
| DotNetFramework FrameworkVersion.V4_7 -> [ DotNetFramework FrameworkVersion.V4_6_3; DotNetStandard DotNetStandardVersion.V2_0 ] | ||
| DotNetFramework FrameworkVersion.V5_0 -> [ DotNetFramework FrameworkVersion.V4_6_2; DotNetStandard DotNetStandardVersion.V1_5 ] | ||
| DNX _ -> [ ] | ||
| DNXCore _ -> [ ] | ||
|
@@ -222,8 +334,10 @@ type FrameworkIdentifier = | |
| DotNetStandard DotNetStandardVersion.V1_4 -> [ DotNetStandard DotNetStandardVersion.V1_3 ] | ||
| DotNetStandard DotNetStandardVersion.V1_5 -> [ DotNetStandard DotNetStandardVersion.V1_4 ] | ||
| DotNetStandard DotNetStandardVersion.V1_6 -> [ DotNetStandard DotNetStandardVersion.V1_5 ] | ||
| DotNetStandard DotNetStandardVersion.V2_0 -> [ DotNetStandard DotNetStandardVersion.V1_6 ] | ||
| DotNetCore DotNetCoreVersion.V1_0 -> [ DotNetStandard DotNetStandardVersion.V1_6 ] | ||
| DotNetCore DotNetCoreVersion.V1_1 -> [ DotNetCore DotNetCoreVersion.V1_0 ] | ||
| DotNetCore DotNetCoreVersion.V2_0 -> [ DotNetCore DotNetCoreVersion.V1_1; DotNetStandard DotNetStandardVersion.V2_0 ] | ||
| Silverlight "v3.0" -> [ ] | ||
| Silverlight "v4.0" -> [ Silverlight "v3.0" ] | ||
| Silverlight "v5.0" -> [ Silverlight "v4.0" ] | ||
|
@@ -240,7 +354,6 @@ type FrameworkIdentifier = | |
| Windows _ -> [ Windows "v4.5.1" ] | ||
| WindowsPhoneApp _ -> [ WindowsPhoneApp "v8.1" ] | ||
| WindowsPhoneSilverlight _ -> [ WindowsPhoneSilverlight "v8.1" ] | ||
|
||
/// Return if the parameter is of the same framework category (dotnet, windows phone, silverlight, ...) | ||
member x.IsSameCategoryAs y = | ||
match (x, y) with | ||
|
@@ -330,6 +443,7 @@ module FrameworkDetection = | |
| "net461" -> Some (DotNetFramework FrameworkVersion.V4_6_1) | ||
| "net462" -> Some (DotNetFramework FrameworkVersion.V4_6_2) | ||
| "net463" -> Some (DotNetFramework FrameworkVersion.V4_6_3) | ||
| "net47" -> Some (DotNetFramework FrameworkVersion.V4_7) | ||
| "uap100" -> Some (UAP UAPVersion.V10) | ||
| "monotouch" | "monotouch10" | "monotouch1" -> Some MonoTouch | ||
| "monoandroid" | "monoandroid10" | "monoandroid1" | "monoandroid22" | "monoandroid23" | "monoandroid44" | "monoandroid403" | "monoandroid43" | "monoandroid41" | "monoandroid50" | "monoandroid60" | "monoandroid70" -> Some MonoAndroid | ||
|
@@ -365,8 +479,10 @@ module FrameworkDetection = | |
| "netstandard14" -> Some(DotNetStandard DotNetStandardVersion.V1_4) | ||
| "netstandard15" -> Some(DotNetStandard DotNetStandardVersion.V1_5) | ||
| "netstandard16" -> Some(DotNetStandard DotNetStandardVersion.V1_6) | ||
| "netstandard20" -> Some(DotNetStandard DotNetStandardVersion.V2_0) | ||
| "netcore10" -> Some (DotNetCore DotNetCoreVersion.V1_0) | ||
| "netcore11" -> Some (DotNetCore DotNetCoreVersion.V1_1) | ||
| "netcore20" -> Some (DotNetCore DotNetCoreVersion.V2_0) | ||
| v when v.StartsWith "netstandard" -> Some(DotNetStandard DotNetStandardVersion.V1_6) | ||
| _ -> None | ||
result) | ||
|
@@ -466,8 +582,8 @@ type TargetProfile = | |
| _ -> "portable-net45+netcore45+wpa81+wp8+MonoAndroid1+MonoTouch1" // Use Portable259 as default | ||
|
||
module KnownTargetProfiles = | ||
let DotNetFrameworkVersions = | ||
[FrameworkVersion.V1 | ||
let DotNetFrameworkVersions = [ | ||
FrameworkVersion.V1 | ||
FrameworkVersion.V1_1 | ||
FrameworkVersion.V2 | ||
FrameworkVersion.V3 | ||
|
@@ -481,7 +597,9 @@ module KnownTargetProfiles = | |
FrameworkVersion.V4_6 | ||
FrameworkVersion.V4_6_1 | ||
FrameworkVersion.V4_6_2 | ||
FrameworkVersion.V4_6_3] | ||
FrameworkVersion.V4_6_3 | ||
FrameworkVersion.V4_7 | ||
] | ||
|
||
let DotNetFrameworkIdentifiers = | ||
DotNetFrameworkVersions | ||
|
@@ -491,22 +609,27 @@ module KnownTargetProfiles = | |
DotNetFrameworkIdentifiers | ||
|> List.map SinglePlatform | ||
|
||
let DotNetStandardVersions = | ||
[DotNetStandardVersion.V1_0 | ||
let DotNetStandardVersions = [ | ||
DotNetStandardVersion.V1_0 | ||
DotNetStandardVersion.V1_1 | ||
DotNetStandardVersion.V1_2 | ||
DotNetStandardVersion.V1_3 | ||
DotNetStandardVersion.V1_4 | ||
DotNetStandardVersion.V1_5 | ||
DotNetStandardVersion.V1_6] | ||
DotNetStandardVersion.V1_6 | ||
DotNetStandardVersion.V2_0 | ||
] | ||
|
||
|
||
let DotNetStandardProfiles = | ||
DotNetStandardVersions | ||
|> List.map (DotNetStandard >> SinglePlatform) | ||
|
||
let DotNetCoreVersions = | ||
[DotNetCoreVersion.V1_0 ] | ||
let DotNetCoreVersions = [ | ||
DotNetCoreVersion.V1_0 | ||
DotNetCoreVersion.V1_1 | ||
DotNetCoreVersion.V2_0 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will this really be 2.0? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Interesting decision There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. thanks :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I started out on this trying to fix #2245, but I haven't managed to figure it out yet. Any ideas? |
||
] | ||
|
||
let DotNetCoreProfiles = | ||
DotNetCoreVersions | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be enough, why is the above needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i wasn't really sure what was working an what wasn't so I tried something more explicit, especially since the compatibility doesn't increase linearly, it drops back down to 4.6.1 for netstandard 2.0 after 1.5 was compatible with 4.6.2
It's probably not necessary though...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tbh I'd prefer the explicit list to be removed. Otherwise we have two places doing exactly the same. This part is already hard enough to understand :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll leave the rest to you then 😉