From 9709b8cfb4c47c7dd90fc8a8222375d5e89ec4cd Mon Sep 17 00:00:00 2001 From: Steffen Forkmann Date: Mon, 17 Jul 2017 19:05:23 +0200 Subject: [PATCH] Implement XamarinTV, XamarinWatch - fixes #2532 --- src/Paket.Core/Versioning/FrameworkHandling.fs | 12 ++++++++++++ src/Paket.Core/Versioning/PlatformMatching.fs | 2 ++ src/Paket/Paket.fsproj | 4 ++-- .../InstallModel/FrameworkIdentifierSpecs.fs | 8 ++++++++ 4 files changed, 24 insertions(+), 2 deletions(-) diff --git a/src/Paket.Core/Versioning/FrameworkHandling.fs b/src/Paket.Core/Versioning/FrameworkHandling.fs index a0945ba8e0..e1aa55d834 100644 --- a/src/Paket.Core/Versioning/FrameworkHandling.fs +++ b/src/Paket.Core/Versioning/FrameworkHandling.fs @@ -373,6 +373,8 @@ type FrameworkIdentifier = | MonoTouch | MonoMac | Native of BuildMode * Platform + | XamarinTV + | XamarinWatch | XamariniOS | XamarinMac | Windows of WindowsVersion @@ -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" @@ -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 ] @@ -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)) @@ -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) @@ -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 diff --git a/src/Paket.Core/Versioning/PlatformMatching.fs b/src/Paket.Core/Versioning/PlatformMatching.fs index 7127bb88c4..3b3702b497 100644 --- a/src/Paket.Core/Versioning/PlatformMatching.fs +++ b/src/Paket.Core/Versioning/PlatformMatching.fs @@ -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", "" diff --git a/src/Paket/Paket.fsproj b/src/Paket/Paket.fsproj index 4facbaad05..3b890559f5 100644 --- a/src/Paket/Paket.fsproj +++ b/src/Paket/Paket.fsproj @@ -31,8 +31,8 @@ Project paket.exe Project - install - D:\temp\test + convert-from-nuget + D:\temp\freya true diff --git a/tests/Paket.Tests/InstallModel/FrameworkIdentifierSpecs.fs b/tests/Paket.Tests/InstallModel/FrameworkIdentifierSpecs.fs index ea6e6f7fc7..69e7723577 100644 --- a/tests/Paket.Tests/InstallModel/FrameworkIdentifierSpecs.fs +++ b/tests/Paket.Tests/InstallModel/FrameworkIdentifierSpecs.fs @@ -38,6 +38,14 @@ let ``should understand xamarinios``() = let ``should serialize xamarinios``() = XamariniOS.ToString() |> shouldEqual "xamarinios" +[] +let ``should serialize xamarintvos``() = + XamarinTV.ToString() |> shouldEqual "xamarintvos" + +[] +let ``should serialize xamarinwtchos``() = + XamarinWatch.ToString() |> shouldEqual "xamarinwatchos" + [] let ``should understand xamarinmac``() = FrameworkDetection.Extract("xamarinmac20").Value |> shouldEqual (XamarinMac)