Skip to content

Commit

Permalink
Implement XamarinTV, XamarinWatch - fixes #2532
Browse files Browse the repository at this point in the history
  • Loading branch information
forki committed Jul 17, 2017
1 parent dbb8169 commit 9709b8c
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 2 deletions.
12 changes: 12 additions & 0 deletions src/Paket.Core/Versioning/FrameworkHandling.fs
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,8 @@ type FrameworkIdentifier =
| MonoTouch
| MonoMac
| Native of BuildMode * Platform
| XamarinTV
| XamarinWatch
| XamariniOS
| XamarinMac
| Windows of WindowsVersion
Expand All @@ -393,6 +395,8 @@ type FrameworkIdentifier =
| MonoTouch -> "monotouch"
| MonoMac -> "monomac"
| Native(_) -> "native"
| XamarinTV -> "xamarintvos"
| XamarinWatch -> "xamarinwatchos"
| XamariniOS -> "xamarinios"
| UAP v -> "uap" + v.ShortString()
| XamarinMac -> "xamarinmac"
Expand Down Expand Up @@ -445,6 +449,8 @@ type FrameworkIdentifier =
| Native(_) -> [ ]
| XamariniOS -> [ DotNetStandard DotNetStandardVersion.V1_6 ]
| XamarinMac -> [ DotNetStandard DotNetStandardVersion.V1_6 ]
| XamarinTV -> [ DotNetStandard DotNetStandardVersion.V1_6 ]
| XamarinWatch -> [ DotNetStandard DotNetStandardVersion.V1_6 ]
| UAP UAPVersion.V10 -> [ Windows WindowsVersion.V8_1; WindowsPhoneApp WindowsPhoneAppVersion.V8_1; DotNetStandard DotNetStandardVersion.V1_4 ]
| DotNetFramework FrameworkVersion.V1 -> [ ]
| DotNetFramework FrameworkVersion.V1_1 -> [ DotNetFramework FrameworkVersion.V1 ]
Expand Down Expand Up @@ -570,6 +576,8 @@ module FrameworkDetection =
| "monoandroid71" | "monoandroid7.1"-> Some (MonoAndroid MonoAndroidVersion.V71)
| "monomac" | "monomac10" | "monomac1" -> Some MonoMac
| "xamarinios" | "xamarinios10" | "xamarinios1" | "xamarin.ios10" -> Some XamariniOS
| "xamarinwatchos" | "xamarinwatchos10" | "xamarinwatchos1" | "xamarin.watchos10" -> Some XamarinWatch
| "xamarintvos" | "xamarintvos10" | "xamarintvos1" | "xamarin.tvos10" -> Some XamarinTV
| "xamarinmac" | "xamarinmac20" | "xamarin.mac20" -> Some XamarinMac
| "native/x86/debug" -> Some(Native(Debug,Win32))
| "native/x64/debug" -> Some(Native(Debug,X64))
Expand Down Expand Up @@ -1002,6 +1010,8 @@ module KnownTargetProfiles =
[SinglePlatform(MonoTouch)
SinglePlatform(XamariniOS)
SinglePlatform(XamarinMac)
SinglePlatform(XamarinTV)
SinglePlatform(XamarinWatch)
SinglePlatform(WindowsPhoneApp WindowsPhoneAppVersion.V8_1)] @
(AllPortableProfiles |> List.map PortableProfile)

Expand Down Expand Up @@ -1201,6 +1211,8 @@ module SupportCalculation =
| MonoTouch
| MonoAndroid _
| XamariniOS
| XamarinTV
| XamarinWatch
| XamarinMac ->
// http://danrigby.com/2014/05/14/supported-pcl-profiles-xamarin-for-visual-studio-2/
[ Profile5
Expand Down
2 changes: 2 additions & 0 deletions src/Paket.Core/Versioning/PlatformMatching.fs
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,8 @@ let getTargetCondition (target:TargetProfile) =
| MonoTouch -> "$(TargetFrameworkIdentifier) == 'MonoTouch'", ""
| MonoMac -> "$(TargetFrameworkIdentifier) == 'MonoMac'", ""
| XamariniOS -> "$(TargetFrameworkIdentifier) == 'Xamarin.iOS'", ""
| XamarinTV -> "$(TargetFrameworkIdentifier) == 'Xamarin.tvOS'", ""
| XamarinWatch -> "$(TargetFrameworkIdentifier) == 'Xamarin.watchOS'", ""
| UAP(version) -> "$(TargetFrameworkIdentifier) == '.NETCore'", sprintf "$(TargetFrameworkVersion) == '%O'" version.NetCoreVersion
| XamarinMac -> "$(TargetFrameworkIdentifier) == 'Xamarin.Mac'", ""
| Native(NoBuildMode,NoPlatform) -> "true", ""
Expand Down
4 changes: 2 additions & 2 deletions src/Paket/Paket.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
<StartAction>Project</StartAction>
<StartProgram>paket.exe</StartProgram>
<StartAction>Project</StartAction>
<StartArguments>install</StartArguments>
<StartWorkingDirectory>D:\temp\test</StartWorkingDirectory>
<StartArguments>convert-from-nuget</StartArguments>
<StartWorkingDirectory>D:\temp\freya</StartWorkingDirectory>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<Optimize>true</Optimize>
Expand Down
8 changes: 8 additions & 0 deletions tests/Paket.Tests/InstallModel/FrameworkIdentifierSpecs.fs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@ let ``should understand xamarinios``() =
let ``should serialize xamarinios``() =
XamariniOS.ToString() |> shouldEqual "xamarinios"

[<Test>]
let ``should serialize xamarintvos``() =
XamarinTV.ToString() |> shouldEqual "xamarintvos"

[<Test>]
let ``should serialize xamarinwtchos``() =
XamarinWatch.ToString() |> shouldEqual "xamarinwatchos"

[<Test>]
let ``should understand xamarinmac``() =
FrameworkDetection.Extract("xamarinmac20").Value |> shouldEqual (XamarinMac)
Expand Down

0 comments on commit 9709b8c

Please sign in to comment.