Skip to content

Commit 5149ab5

Browse files
Update matching platform check 🚀
`os:mono` and `os:windows` are behaving wrongly for .Net Core version of the Paket. This is caused by the fact the check depends on `isMonoRuntime` function which on .Net Core always return `false` which caused `os:mono` to never be matched, and `os:windows` be matched on all platforms. The workaround for the problem is to use `os:win`, `os:linux` and `os:osx` - but it's breaking change for anyone already using those checks who just wanted to modernize build infrastructure (👋). Fix makes old syntax works correctly also on .Net Core by using the same checks as for `os:win`, `os:osx` and `os:linux`. `os:windows` will behave just like `os:win` and `os:mono` will be `os:osx || os:linux`
1 parent 86bd0ed commit 5149ab5

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

‎src/Paket.Core/Common/Utils.fs‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,8 +327,13 @@ let isMatchingOperatingSystem (operatingSystemFilter : string option) =
327327
let isMatchingPlatform (operatingSystemFilter : string option) =
328328
match operatingSystemFilter with
329329
| None -> true
330+
#if NETSTANDARD1_6 || NETSTANDARD2_0
331+
| Some filter when filter = "mono" -> isMacOS || isUnix
332+
| Some filter when filter = "windows" -> isWindows
333+
#else
330334
| Some filter when filter = "mono" -> isMonoRuntime
331335
| Some filter when filter = "windows" -> not isMonoRuntime
336+
#endif
332337
| _ -> isMatchingOperatingSystem operatingSystemFilter
333338

334339
/// [omit]
@@ -896,4 +901,4 @@ module List =
896901
module Task =
897902

898903
let Map<'TIn,'TOut> (mapper : 'TIn -> 'TOut) (t:Task<'TIn>) : Task<'TOut> =
899-
t.ContinueWith((fun (t:Task<'TIn>) -> mapper(t.Result)))
904+
t.ContinueWith((fun (t:Task<'TIn>) -> mapper(t.Result)))

0 commit comments

Comments
 (0)