diff --git a/src/Paket.Core/PaketConfigFiles/ProjectFile.fs b/src/Paket.Core/PaketConfigFiles/ProjectFile.fs index dd338c1382..930465f0df 100644 --- a/src/Paket.Core/PaketConfigFiles/ProjectFile.fs +++ b/src/Paket.Core/PaketConfigFiles/ProjectFile.fs @@ -824,7 +824,7 @@ module ProjectFile = |> List.collect (fun libFolder -> match libFolder with | _ -> - match PlatformMatching.getCondition referenceCondition allTargets libFolder.Targets with + match PlatformMatching.getCondition referenceCondition libFolder.Targets with | "" -> [] | condition -> let condition = @@ -857,7 +857,7 @@ module ProjectFile = frameworkReferences |> List.partition (fun fr -> duplicates.Contains fr.Name) - match PlatformMatching.getCondition referenceCondition allTargets !assemblyTargets with + match PlatformMatching.getCondition referenceCondition !assemblyTargets with | "" -> [condition,createItemGroup libFolder.Targets rest libraries,false] | lowerCondition -> [lowerCondition,createItemGroup !assemblyTargets specialFrameworkAssemblies [],true @@ -874,7 +874,7 @@ module ProjectFile = let frameworkSpecificTargetsFileConditions = frameworkSpecificTargets - |> List.map (fun lib -> PlatformMatching.getCondition referenceCondition allTargets lib.Targets,createPropertyGroup (lib.FolderContents |> List.ofSeq)) + |> List.map (fun lib -> PlatformMatching.getCondition referenceCondition lib.Targets,createPropertyGroup (lib.FolderContents |> List.ofSeq)) let chooseNodes = match conditions with diff --git a/src/Paket.Core/Versioning/PlatformMatching.fs b/src/Paket.Core/Versioning/PlatformMatching.fs index 842aaf413d..770d0db92e 100644 --- a/src/Paket.Core/Versioning/PlatformMatching.fs +++ b/src/Paket.Core/Versioning/PlatformMatching.fs @@ -215,9 +215,9 @@ let getTargetCondition (target:TargetProfile) = match platform with | DotNetFramework(FrameworkVersion.V5) ->"$(TargetFrameworkIdentifier) == '.NETCoreApp'", "$(TargetFrameworkVersion) == 'v5.0'" | DotNetFramework(version) ->"$(TargetFrameworkIdentifier) == '.NETFramework'", sprintf "$(TargetFrameworkVersion) == '%O'" version - | DotNet5WithOs(os) ->"$(TargetFrameworkIdentifier) == '.NETCoreApp'", sprintf "($(TargetFrameworkVersion) == 'v5.0' And $(TargetPlatformIdentifier) == '%O')" os - | DotNet5Windows(Net5WindowsVersion.V7_0) ->"$(TargetFrameworkIdentifier) == '.NETCoreApp'", sprintf "($(TargetFrameworkVersion) == 'v5.0' And $(TargetPlatformIdentifier) == 'Windows')" - | DotNet5Windows(version) ->"$(TargetFrameworkIdentifier) == '.NETCoreApp'", sprintf "($(TargetFrameworkVersion) == 'v5.0' And $(TargetPlatformIdentifier) == 'Windows' And $(TargetPlatformVersion) == '%O')" version + | DotNet5WithOs(os) ->"$(TargetFrameworkIdentifier) == '.NETCoreApp'", sprintf "($(TargetFrameworkVersion) == 'v5.0' And '$(TargetPlatformIdentifier)' == '%O')" os + | DotNet5Windows(Net5WindowsVersion.V7_0) ->"$(TargetFrameworkIdentifier) == '.NETCoreApp'", sprintf "($(TargetFrameworkVersion) == 'v5.0' And '$(TargetPlatformIdentifier)' == 'Windows')" + | DotNet5Windows(version) ->"$(TargetFrameworkIdentifier) == '.NETCoreApp'", sprintf "($(TargetFrameworkVersion) == 'v5.0' And '$(TargetPlatformIdentifier)' == 'Windows' And '$(TargetPlatformVersion)' == '%O')" version | DotNetStandard(version) ->"$(TargetFrameworkIdentifier) == '.NETStandard'", sprintf "$(TargetFrameworkVersion) == '%O'" version | DotNetCoreApp(version) ->"$(TargetFrameworkIdentifier) == '.NETCoreApp'", sprintf "$(TargetFrameworkVersion) == '%O'" version | DotNetUnity(DotNetUnityVersion.V3_5_Full as version) -> @@ -248,7 +248,7 @@ let getTargetCondition (target:TargetProfile) = | Unsupported s -> "", "" | TargetProfile.PortableProfile p -> sprintf "$(TargetFrameworkProfile) == '%O'" p.ProfileName,"" -let getCondition (referenceCondition:string option) (allTargets: TargetProfile Set list) (targets : TargetProfile Set) = +let getCondition (referenceCondition:string option) (targets : TargetProfile Set) = let inline CheckIfFullyInGroup typeName matchF filterRestF (processed,targets) = let fullyContained = KnownTargetProfiles.AllDotNetProfiles diff --git a/src/Paket.Core/Versioning/Requirements.fs b/src/Paket.Core/Versioning/Requirements.fs index 0474d50cc8..277db74e45 100644 --- a/src/Paket.Core/Versioning/Requirements.fs +++ b/src/Paket.Core/Versioning/Requirements.fs @@ -299,13 +299,7 @@ type FrameworkRestriction = x.RawFormular.IsMatch tp member x.ToMSBuildCondition() = - let formulas = - [for fr in x.RepresentedFrameworks do - let fr = fr.ToString() - yield sprintf "('$(TargetFramework)' == '%s')" fr - if fr.Contains "." then - yield sprintf "('$(TargetFramework)' == '%s')" (fr.Replace(".",""))] - String.Join(" OR ",formulas) + PlatformMatching.getCondition None x.RepresentedFrameworks override x.Equals(y) = match y with diff --git a/tests/Paket.Tests/InstallModel/Penalty/FrameworkConditionsSpecs.fs b/tests/Paket.Tests/InstallModel/Penalty/FrameworkConditionsSpecs.fs index 49c9083435..83d514aae1 100644 --- a/tests/Paket.Tests/InstallModel/Penalty/FrameworkConditionsSpecs.fs +++ b/tests/Paket.Tests/InstallModel/Penalty/FrameworkConditionsSpecs.fs @@ -7,7 +7,7 @@ open Paket.Domain open Paket.PlatformMatching -let getCondition cond targets = getCondition cond [targets] targets +let getCondition cond targets = getCondition cond targets [] let ``should create empty condition for empty profile list``() = diff --git a/tests/Paket.Tests/InstallModel/Xml/RxXaml.fs b/tests/Paket.Tests/InstallModel/Xml/RxXaml.fs index 7814706898..721e1245a4 100644 --- a/tests/Paket.Tests/InstallModel/Xml/RxXaml.fs +++ b/tests/Paket.Tests/InstallModel/Xml/RxXaml.fs @@ -33,7 +33,7 @@ let expected = """ - + ..\..\..\Rx-XAML\lib\portable-win81+wpa81\System.Reactive.Windows.Threading.dll