Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/Paket.Core/PaketConfigFiles/ProjectFile.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
8 changes: 4 additions & 4 deletions src/Paket.Core/Versioning/PlatformMatching.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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) ->
Expand Down Expand Up @@ -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
Expand Down
8 changes: 1 addition & 7 deletions src/Paket.Core/Versioning/Requirements.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

[<Test>]
let ``should create empty condition for empty profile list``() =
Expand Down
2 changes: 1 addition & 1 deletion tests/Paket.Tests/InstallModel/Xml/RxXaml.fs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ let expected = """
</Reference>
</ItemGroup>
</When>
<When Condition="($(TargetFrameworkIdentifier) == 'WindowsPhoneApp') Or ($(TargetFrameworkIdentifier) == 'MonoAndroid' And ($(TargetFrameworkVersion) == 'v10.0' Or $(TargetFrameworkVersion) == 'v7.0' Or $(TargetFrameworkVersion) == 'v7.1' Or $(TargetFrameworkVersion) == 'v8.0' Or $(TargetFrameworkVersion) == 'v8.1' Or $(TargetFrameworkVersion) == 'v9.0')) Or ($(TargetFrameworkIdentifier) == 'MonoTouch') Or ($(TargetFrameworkIdentifier) == '.NETCoreApp' And ($(TargetFrameworkVersion) == 'v1.0' Or $(TargetFrameworkVersion) == 'v1.1' Or $(TargetFrameworkVersion) == 'v2.0' Or $(TargetFrameworkVersion) == 'v2.1' Or $(TargetFrameworkVersion) == 'v2.2' Or $(TargetFrameworkVersion) == 'v3.0' Or $(TargetFrameworkVersion) == 'v3.1' Or $(TargetFrameworkVersion) == 'v5.0' Or ($(TargetFrameworkVersion) == 'v5.0' And $(TargetPlatformIdentifier) == 'Windows' And $(TargetPlatformVersion) == '10.0.17763.0') Or ($(TargetFrameworkVersion) == 'v5.0' And $(TargetPlatformIdentifier) == 'Windows' And $(TargetPlatformVersion) == '10.0.18362.0') Or ($(TargetFrameworkVersion) == 'v5.0' And $(TargetPlatformIdentifier) == 'Windows' And $(TargetPlatformVersion) == '10.0.19041.0') Or ($(TargetFrameworkVersion) == 'v5.0' And $(TargetPlatformIdentifier) == 'Windows' And $(TargetPlatformVersion) == '8.0') Or ($(TargetFrameworkVersion) == 'v5.0' And $(TargetPlatformIdentifier) == 'Windows') Or ($(TargetFrameworkVersion) == 'v5.0' And $(TargetPlatformIdentifier) == 'android') Or ($(TargetFrameworkVersion) == 'v5.0' And $(TargetPlatformIdentifier) == 'ios') Or ($(TargetFrameworkVersion) == 'v5.0' And $(TargetPlatformIdentifier) == 'macos') Or ($(TargetFrameworkVersion) == 'v5.0' And $(TargetPlatformIdentifier) == 'tvos') Or ($(TargetFrameworkVersion) == 'v5.0' And $(TargetPlatformIdentifier) == 'watchos'))) Or ($(TargetFrameworkIdentifier) == '.NETStandard' And ($(TargetFrameworkVersion) == 'v1.2' Or $(TargetFrameworkVersion) == 'v1.3' Or $(TargetFrameworkVersion) == 'v1.4' Or $(TargetFrameworkVersion) == 'v1.5' Or $(TargetFrameworkVersion) == 'v1.6' Or $(TargetFrameworkVersion) == 'v2.0' Or $(TargetFrameworkVersion) == 'v2.1')) Or ($(TargetFrameworkProfile) == 'Profile32') Or ($(TargetFrameworkIdentifier) == 'Xamarin.iOS') Or ($(TargetFrameworkIdentifier) == 'Xamarin.Mac') Or ($(TargetFrameworkIdentifier) == 'Xamarin.tvOS') Or ($(TargetFrameworkIdentifier) == 'Xamarin.watchOS')">
<When Condition="($(TargetFrameworkIdentifier) == 'WindowsPhoneApp') Or ($(TargetFrameworkIdentifier) == 'MonoAndroid' And ($(TargetFrameworkVersion) == 'v10.0' Or $(TargetFrameworkVersion) == 'v7.0' Or $(TargetFrameworkVersion) == 'v7.1' Or $(TargetFrameworkVersion) == 'v8.0' Or $(TargetFrameworkVersion) == 'v8.1' Or $(TargetFrameworkVersion) == 'v9.0')) Or ($(TargetFrameworkIdentifier) == 'MonoTouch') Or ($(TargetFrameworkIdentifier) == '.NETCoreApp' And ($(TargetFrameworkVersion) == 'v1.0' Or $(TargetFrameworkVersion) == 'v1.1' Or $(TargetFrameworkVersion) == 'v2.0' Or $(TargetFrameworkVersion) == 'v2.1' Or $(TargetFrameworkVersion) == 'v2.2' Or $(TargetFrameworkVersion) == 'v3.0' Or $(TargetFrameworkVersion) == 'v3.1' Or $(TargetFrameworkVersion) == 'v5.0' Or ($(TargetFrameworkVersion) == 'v5.0' And '$(TargetPlatformIdentifier)' == 'Windows' And '$(TargetPlatformVersion)' == '10.0.17763.0') Or ($(TargetFrameworkVersion) == 'v5.0' And '$(TargetPlatformIdentifier)' == 'Windows' And '$(TargetPlatformVersion)' == '10.0.18362.0') Or ($(TargetFrameworkVersion) == 'v5.0' And '$(TargetPlatformIdentifier)' == 'Windows' And '$(TargetPlatformVersion)' == '10.0.19041.0') Or ($(TargetFrameworkVersion) == 'v5.0' And '$(TargetPlatformIdentifier)' == 'Windows' And '$(TargetPlatformVersion)' == '8.0') Or ($(TargetFrameworkVersion) == 'v5.0' And '$(TargetPlatformIdentifier)' == 'Windows') Or ($(TargetFrameworkVersion) == 'v5.0' And '$(TargetPlatformIdentifier)' == 'android') Or ($(TargetFrameworkVersion) == 'v5.0' And '$(TargetPlatformIdentifier)' == 'ios') Or ($(TargetFrameworkVersion) == 'v5.0' And '$(TargetPlatformIdentifier)' == 'macos') Or ($(TargetFrameworkVersion) == 'v5.0' And '$(TargetPlatformIdentifier)' == 'tvos') Or ($(TargetFrameworkVersion) == 'v5.0' And '$(TargetPlatformIdentifier)' == 'watchos'))) Or ($(TargetFrameworkIdentifier) == '.NETStandard' And ($(TargetFrameworkVersion) == 'v1.2' Or $(TargetFrameworkVersion) == 'v1.3' Or $(TargetFrameworkVersion) == 'v1.4' Or $(TargetFrameworkVersion) == 'v1.5' Or $(TargetFrameworkVersion) == 'v1.6' Or $(TargetFrameworkVersion) == 'v2.0' Or $(TargetFrameworkVersion) == 'v2.1')) Or ($(TargetFrameworkProfile) == 'Profile32') Or ($(TargetFrameworkIdentifier) == 'Xamarin.iOS') Or ($(TargetFrameworkIdentifier) == 'Xamarin.Mac') Or ($(TargetFrameworkIdentifier) == 'Xamarin.tvOS') Or ($(TargetFrameworkIdentifier) == 'Xamarin.watchOS')">
<ItemGroup>
<Reference Include="System.Reactive.Windows.Threading">
<HintPath>..\..\..\Rx-XAML\lib\portable-win81+wpa81\System.Reactive.Windows.Threading.dll</HintPath>
Expand Down