From eed6a8118ad3fecbeedbd0812472fc214582d1cb Mon Sep 17 00:00:00 2001 From: Tomasz Heimowski Date: Fri, 17 Oct 2014 23:35:24 +0200 Subject: [PATCH 1/3] add net11 to framework handling - references #266 --- src/Paket.Core/FrameworkHandling.fs | 1 + src/Paket.Core/InstallModel.fs | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Paket.Core/FrameworkHandling.fs b/src/Paket.Core/FrameworkHandling.fs index 37942ac951..40edaade82 100644 --- a/src/Paket.Core/FrameworkHandling.fs +++ b/src/Paket.Core/FrameworkHandling.fs @@ -94,6 +94,7 @@ type FrameworkIdentifier = | "1.0" -> Some(DotNetFramework(All, Full)) | "1.1" -> Some(DotNetFramework(All, Full)) | "2.0" -> Some(DotNetFramework(All, Full)) + | "net11" -> Some(DotNetFramework(Framework FrameworkVersionNo.V1_1, Full)) | "net20" -> Some(DotNetFramework(Framework FrameworkVersionNo.V2, Full)) | "net20-full" -> Some(DotNetFramework(Framework FrameworkVersionNo.V2, Full)) | "net35" -> Some(DotNetFramework(Framework FrameworkVersionNo.V3_5, Full)) diff --git a/src/Paket.Core/InstallModel.fs b/src/Paket.Core/InstallModel.fs index d77ea570dc..5c95672125 100644 --- a/src/Paket.Core/InstallModel.fs +++ b/src/Paket.Core/InstallModel.fs @@ -178,8 +178,8 @@ type InstallModel = | _ -> ()] |> Set.ofList) - static member CreateFromLibs(packageName,packageVersions,libs,nuspec:Nuspec) = - InstallModel.EmptyModel(packageName,packageVersions) + static member CreateFromLibs(packageName,packageVersion,libs,nuspec:Nuspec) = + InstallModel.EmptyModel(packageName,packageVersion) .AddReferences(libs,nuspec.References) .AddFrameworkAssemblyReferences(nuspec.FrameworkAssemblyReferences) .Process() \ No newline at end of file From 52dc78c6bc3cf8862eb4719f2ee13a42ba63fc05 Mon Sep 17 00:00:00 2001 From: Tomasz Heimowski Date: Sat, 18 Oct 2014 13:39:06 +0200 Subject: [PATCH 2/3] removed FrameworkVersion.All --- src/Paket.Core/FrameworkHandling.fs | 75 ++++---- src/Paket.Core/InstallModel.fs | 21 +-- tests/Paket.Tests/InstallModel/NuspecSpecs.fs | 6 +- .../InstallModel/ProcessingSpecs.fs | 172 +++++++++--------- .../SystemNetHttpWithFrameworkReferences.fs | 4 +- .../Paket.Tests/ProjectFile/ConditionSpecs.fs | 42 ++--- 6 files changed, 148 insertions(+), 172 deletions(-) diff --git a/src/Paket.Core/FrameworkHandling.fs b/src/Paket.Core/FrameworkHandling.fs index 40edaade82..35d9f369b9 100644 --- a/src/Paket.Core/FrameworkHandling.fs +++ b/src/Paket.Core/FrameworkHandling.fs @@ -7,9 +7,10 @@ open System type FrameworkProfile = | Client | Full - + [] -type FrameworkVersionNo = +/// The Framework version. +type FrameworkVersion = | V1 | V1_1 | V2 @@ -31,22 +32,17 @@ type FrameworkVersionNo = | V4_5_2 -> "v4.5.2" | V4_5_3 -> "v4.5.3" -/// The Framework version. -type FrameworkVersion = - | All - | Framework of FrameworkVersionNo - static member KnownDotNetFrameworks = - [ FrameworkVersionNo.V1, Full - FrameworkVersionNo.V1_1, Full - FrameworkVersionNo.V2, Full - FrameworkVersionNo.V3_5, Full - FrameworkVersionNo.V4, Client - FrameworkVersionNo.V4, Full - FrameworkVersionNo.V4_5, Full - FrameworkVersionNo.V4_5_1, Full - FrameworkVersionNo.V4_5_2, Full - FrameworkVersionNo.V4_5_3, Full ] + [ FrameworkVersion.V1, Full + FrameworkVersion.V1_1, Full + FrameworkVersion.V2, Full + FrameworkVersion.V3_5, Full + FrameworkVersion.V4, Client + FrameworkVersion.V4, Full + FrameworkVersion.V4_5, Full + FrameworkVersion.V4_5_1, Full + FrameworkVersion.V4_5_2, Full + FrameworkVersion.V4_5_3, Full ] type PlatformVersion = string @@ -90,25 +86,25 @@ type FrameworkIdentifier = |> List.fold (fun (path:string) (pattern,replacement) -> path.Replace(pattern.ToLower(),replacement.ToLower())) (path.ToLower()) match path with - | "net" -> Some(DotNetFramework(All, Full)) - | "1.0" -> Some(DotNetFramework(All, Full)) - | "1.1" -> Some(DotNetFramework(All, Full)) - | "2.0" -> Some(DotNetFramework(All, Full)) - | "net11" -> Some(DotNetFramework(Framework FrameworkVersionNo.V1_1, Full)) - | "net20" -> Some(DotNetFramework(Framework FrameworkVersionNo.V2, Full)) - | "net20-full" -> Some(DotNetFramework(Framework FrameworkVersionNo.V2, Full)) - | "net35" -> Some(DotNetFramework(Framework FrameworkVersionNo.V3_5, Full)) - | "net35-full" -> Some(DotNetFramework(Framework FrameworkVersionNo.V3_5, Full)) - | "net4" -> Some(DotNetFramework(Framework FrameworkVersionNo.V4, Full)) - | "net40" -> Some(DotNetFramework(Framework FrameworkVersionNo.V4, Full)) - | "net40-full" -> Some(DotNetFramework(Framework FrameworkVersionNo.V4, Full)) - | "net40-client" -> Some(DotNetFramework(Framework FrameworkVersionNo.V4, Client)) - | "net45" -> Some(DotNetFramework(Framework FrameworkVersionNo.V4_5, Full)) - | "net45-full" -> Some(DotNetFramework(Framework FrameworkVersionNo.V4_5, Full)) - | "net451" -> Some(DotNetFramework(Framework FrameworkVersionNo.V4_5_1, Full)) - | "35" -> Some(DotNetFramework(Framework FrameworkVersionNo.V3_5, Full)) - | "40" -> Some(DotNetFramework(Framework FrameworkVersionNo.V4, Full)) - | "45" -> Some(DotNetFramework(Framework FrameworkVersionNo.V4_5, Full)) + | "net" -> Some(DotNetFramework(FrameworkVersion.V2, Full)) // not sure here + | "1.0" -> Some(DotNetFramework(FrameworkVersion.V1, Full)) + | "1.1" -> Some(DotNetFramework(FrameworkVersion.V1_1, Full)) + | "2.0" -> Some(DotNetFramework(FrameworkVersion.V2, Full)) + | "net11" -> Some(DotNetFramework(FrameworkVersion.V1_1, Full)) + | "net20" -> Some(DotNetFramework(FrameworkVersion.V2, Full)) + | "net20-full" -> Some(DotNetFramework(FrameworkVersion.V2, Full)) + | "net35" -> Some(DotNetFramework(FrameworkVersion.V3_5, Full)) + | "net35-full" -> Some(DotNetFramework(FrameworkVersion.V3_5, Full)) + | "net4" -> Some(DotNetFramework(FrameworkVersion.V4, Full)) + | "net40" -> Some(DotNetFramework(FrameworkVersion.V4, Full)) + | "net40-full" -> Some(DotNetFramework(FrameworkVersion.V4, Full)) + | "net40-client" -> Some(DotNetFramework(FrameworkVersion.V4, Client)) + | "net45" -> Some(DotNetFramework(FrameworkVersion.V4_5, Full)) + | "net45-full" -> Some(DotNetFramework(FrameworkVersion.V4_5, Full)) + | "net451" -> Some(DotNetFramework(FrameworkVersion.V4_5_1, Full)) + | "35" -> Some(DotNetFramework(FrameworkVersion.V3_5, Full)) + | "40" -> Some(DotNetFramework(FrameworkVersion.V4, Full)) + | "45" -> Some(DotNetFramework(FrameworkVersion.V4_5, Full)) | "sl3" -> Some(Silverlight "v3.0") | "sl4" -> Some(Silverlight "v4.0") | "sl5" -> Some(Silverlight "v5.0") @@ -229,10 +225,7 @@ type FrameworkIdentifier = y else x + " And " + y match x with - | DotNetFramework(v,_) -> - match v with - | Framework fw -> sprintf "$(TargetFrameworkVersion) == '%s'" (fw.ToString()) ++ x.GetFrameworkProfile() - | All -> "true" + | DotNetFramework(fw,_) -> sprintf "$(TargetFrameworkVersion) == '%s'" (fw.ToString()) ++ x.GetFrameworkProfile() | PortableFramework _ -> x.GetFrameworkProfile() ++ x.GetPlatformIdentifier() ++ x.GetPlatformVersion() | WindowsPhoneApp _ -> x.GetPlatformVersion() | Windows _ -> x.GetPlatformVersion() @@ -249,7 +242,7 @@ type FrameworkIdentifier = let path = path.Replace("\\", "/").ToLower() let fi = new FileInfo(path) - if path.Contains("lib/" + fi.Name.ToLower()) then Some(DotNetFramework(All, Full)) + if path.Contains("lib/" + fi.Name.ToLower()) then Some(DotNetFramework(FrameworkVersion.V1, Full)) else let startPos = path.IndexOf("lib/") let endPos = path.IndexOf(fi.Name.ToLower()) diff --git a/src/Paket.Core/InstallModel.fs b/src/Paket.Core/InstallModel.fs index 5c95672125..a04b667e3a 100644 --- a/src/Paket.Core/InstallModel.fs +++ b/src/Paket.Core/InstallModel.fs @@ -26,7 +26,7 @@ type InstallModel = static member EmptyModel(packageName, packageVersion) : InstallModel = let frameworks = - [ for x, p in FrameworkVersion.KnownDotNetFrameworks -> DotNetFramework(Framework x, p) ] + [ for x, p in FrameworkVersion.KnownDotNetFrameworks -> DotNetFramework(x, p) ] { PackageName = packageName PackageVersion = packageVersion Fallbacks = Map.empty @@ -97,31 +97,17 @@ type InstallModel = (fun frameworks f -> Map.map (fun _ files -> {files with References = files.References |> Set.filter (f >> not)}) frameworks) this.Frameworks } - member this.UseGenericFrameworkVersionIfEmpty() = - let genericFramework = DotNetFramework(All, Full) - let newFiles = this.GetReferences genericFramework - - let model = - if Set.isEmpty newFiles then this else - - let target = DotNetFramework(Framework FrameworkVersionNo.V1,Full) - match Map.tryFind target this.Frameworks with - | Some files when Set.isEmpty files.References |> not -> this - | _ -> { this with Frameworks = Map.add target { References = newFiles; ContentFiles = Set.empty } this.Frameworks } - - { model with Frameworks = model.Frameworks |> Map.remove genericFramework } - member this.UseLowerVersionLibIfEmpty() = FrameworkVersion.KnownDotNetFrameworks |> List.rev |> List.fold (fun (model : InstallModel) (lowerVersion,lowerProfile) -> - let newFiles = model.GetReferences(DotNetFramework(Framework lowerVersion, lowerProfile)) + let newFiles = model.GetReferences(DotNetFramework(lowerVersion, lowerProfile)) if Set.isEmpty newFiles then model else FrameworkVersion.KnownDotNetFrameworks |> List.filter (fun (version,profile) -> (version,profile) > (lowerVersion,lowerProfile)) |> List.fold (fun (model : InstallModel) (upperVersion,upperProfile) -> - let framework = DotNetFramework(Framework upperVersion, upperProfile) + let framework = DotNetFramework(upperVersion, upperProfile) match Map.tryFind framework model.Frameworks with | Some files when Set.isEmpty files.References -> { model with Frameworks = Map.add framework { References = newFiles; ContentFiles = Set.empty } model.Frameworks } @@ -161,7 +147,6 @@ type InstallModel = member this.Process() = this - .UseGenericFrameworkVersionIfEmpty() .UseLowerVersionLibIfEmpty() .UsePortableVersionLibIfEmpty() .UseLowerVersionLibIfEmpty() // because we now might need to use portable diff --git a/tests/Paket.Tests/InstallModel/NuspecSpecs.fs b/tests/Paket.Tests/InstallModel/NuspecSpecs.fs index 9010679a77..93e065b779 100644 --- a/tests/Paket.Tests/InstallModel/NuspecSpecs.fs +++ b/tests/Paket.Tests/InstallModel/NuspecSpecs.fs @@ -38,8 +38,8 @@ let ``if nuspec is not found we assume no framework references``() = let ``can detect framework assemblies for Microsoft.Net.Http``() = Nuspec.Load("TestFiles/Microsoft.Net.Http.nuspec").FrameworkAssemblyReferences |> shouldEqual - [{ AssemblyName = "System.Net.Http"; TargetFramework = DotNetFramework(FrameworkVersion.Framework(FrameworkVersionNo.V4_5),Full) } - { AssemblyName = "System.Net.Http.WebRequest"; TargetFramework = DotNetFramework(FrameworkVersion.Framework(FrameworkVersionNo.V4_5),Full) } + [{ AssemblyName = "System.Net.Http"; TargetFramework = DotNetFramework(FrameworkVersion.V4_5,Full) } + { AssemblyName = "System.Net.Http.WebRequest"; TargetFramework = DotNetFramework(FrameworkVersion.V4_5,Full) } { AssemblyName = "System.Net.Http"; TargetFramework = MonoTouch } { AssemblyName = "System.Net.Http"; TargetFramework = MonoAndroid } ] @@ -47,4 +47,4 @@ let ``can detect framework assemblies for Microsoft.Net.Http``() = let ``can detect framework assemblies for Octokit``() = Nuspec.Load("TestFiles/Octokit.nuspec").FrameworkAssemblyReferences |> shouldEqual - [{ AssemblyName = "System.Net.Http"; TargetFramework = DotNetFramework(FrameworkVersion.Framework(FrameworkVersionNo.V4_5),Full) }] \ No newline at end of file + [{ AssemblyName = "System.Net.Http"; TargetFramework = DotNetFramework(FrameworkVersion.V4_5,Full) }] \ No newline at end of file diff --git a/tests/Paket.Tests/InstallModel/ProcessingSpecs.fs b/tests/Paket.Tests/InstallModel/ProcessingSpecs.fs index a168bebe7a..f62d8b8113 100644 --- a/tests/Paket.Tests/InstallModel/ProcessingSpecs.fs +++ b/tests/Paket.Tests/InstallModel/ProcessingSpecs.fs @@ -10,15 +10,15 @@ let emptymodel = InstallModel.EmptyModel("Unknown",SemVer.Parse "0.1") let ``should create empty model with net40, net45 ...``() = let model = emptymodel.AddReferences [ @"..\Rx-Main\lib\net40\Rx.dll"; @"..\Rx-Main\lib\net45\Rx.dll" ] - model.GetFrameworks() |> shouldContain (DotNetFramework(Framework FrameworkVersionNo.V4, Full)) - model.GetFrameworks() |> shouldContain (DotNetFramework(Framework FrameworkVersionNo.V4_5, Full)) + model.GetFrameworks() |> shouldContain (DotNetFramework(FrameworkVersion.V4, Full)) + model.GetFrameworks() |> shouldContain (DotNetFramework(FrameworkVersion.V4_5, Full)) [] let ``should understand net40 and net45``() = let model = emptymodel.AddReferences [ @"..\Rx-Main\lib\net40\Rx.dll"; @"..\Rx-Main\lib\net45\Rx.dll" ] - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V4, Full)) |> shouldContain @"..\Rx-Main\lib\net40\Rx.dll" - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V4_5, Full)) |> shouldContain @"..\Rx-Main\lib\net45\Rx.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4, Full)) |> shouldContain @"..\Rx-Main\lib\net40\Rx.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4_5, Full)) |> shouldContain @"..\Rx-Main\lib\net45\Rx.dll" [] let ``should add net35 if we have net20 and net40``() = @@ -26,19 +26,19 @@ let ``should add net35 if we have net20 and net40``() = emptymodel.AddReferences([ @"..\Rx-Main\lib\net20\Rx.dll"; @"..\Rx-Main\lib\net40\Rx.dll" ]) .UseLowerVersionLibIfEmpty() - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V2, Full)) |> shouldContain @"..\Rx-Main\lib\net20\Rx.dll" - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V3_5, Full)) |> shouldContain @"..\Rx-Main\lib\net20\Rx.dll" - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V4, Full)) |> shouldContain @"..\Rx-Main\lib\net40\Rx.dll" - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V4, Full)) |> shouldNotContain @"..\Rx-Main\lib\net20\Rx.dll" - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V4_5, Full)) |> shouldContain @"..\Rx-Main\lib\net40\Rx.dll" - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V4_5_1, Full)) |> shouldContain @"..\Rx-Main\lib\net40\Rx.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V2, Full)) |> shouldContain @"..\Rx-Main\lib\net20\Rx.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V3_5, Full)) |> shouldContain @"..\Rx-Main\lib\net20\Rx.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4, Full)) |> shouldContain @"..\Rx-Main\lib\net40\Rx.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4, Full)) |> shouldNotContain @"..\Rx-Main\lib\net20\Rx.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4_5, Full)) |> shouldContain @"..\Rx-Main\lib\net40\Rx.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4_5_1, Full)) |> shouldContain @"..\Rx-Main\lib\net40\Rx.dll" [] let ``should put _._ files into right buckets``() = let model = emptymodel.AddReferences [ @"..\Rx-Main\lib\net40\_._"; @"..\Rx-Main\lib\net20\_._" ] - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V2, Full)) |> shouldContain @"..\Rx-Main\lib\net20\_._" - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V4, Full)) |> shouldContain @"..\Rx-Main\lib\net40\_._" + model.GetFiles(DotNetFramework(FrameworkVersion.V2, Full)) |> shouldContain @"..\Rx-Main\lib\net20\_._" + model.GetFiles(DotNetFramework(FrameworkVersion.V4, Full)) |> shouldContain @"..\Rx-Main\lib\net40\_._" [] let ``should inherit _._ files to higher frameworks``() = @@ -46,11 +46,11 @@ let ``should inherit _._ files to higher frameworks``() = emptymodel.AddReferences([ @"..\Rx-Main\lib\net40\_._"; @"..\Rx-Main\lib\net20\_._" ]) .UseLowerVersionLibIfEmpty() - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V2, Full)) |> shouldContain @"..\Rx-Main\lib\net20\_._" - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V3_5, Full)) |> shouldContain @"..\Rx-Main\lib\net20\_._" - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V4, Full)) |> shouldContain @"..\Rx-Main\lib\net40\_._" - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V4_5, Full)) |> shouldContain @"..\Rx-Main\lib\net40\_._" - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V4_5_1, Full)) |> shouldContain @"..\Rx-Main\lib\net40\_._" + model.GetFiles(DotNetFramework(FrameworkVersion.V2, Full)) |> shouldContain @"..\Rx-Main\lib\net20\_._" + model.GetFiles(DotNetFramework(FrameworkVersion.V3_5, Full)) |> shouldContain @"..\Rx-Main\lib\net20\_._" + model.GetFiles(DotNetFramework(FrameworkVersion.V4, Full)) |> shouldContain @"..\Rx-Main\lib\net40\_._" + model.GetFiles(DotNetFramework(FrameworkVersion.V4_5, Full)) |> shouldContain @"..\Rx-Main\lib\net40\_._" + model.GetFiles(DotNetFramework(FrameworkVersion.V4_5_1, Full)) |> shouldContain @"..\Rx-Main\lib\net40\_._" [] @@ -59,10 +59,10 @@ let ``should skip buckets which contain placeholder while adjusting upper versio emptymodel.AddReferences([ @"..\Rx-Main\lib\net20\Rx.dll"; @"..\Rx-Main\lib\net40\_._"; ]) .UseLowerVersionLibIfEmpty() - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V2, Full)) |> shouldContain @"..\Rx-Main\lib\net20\Rx.dll" - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V3_5, Full)) |> shouldContain @"..\Rx-Main\lib\net20\Rx.dll" - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V4, Full)) |> shouldNotContain @"..\Rx-Main\lib\net20\Rx.dll" - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V4_5, Full)) |> shouldNotContain @"..\Rx-Main\lib\net20\Rx.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V2, Full)) |> shouldContain @"..\Rx-Main\lib\net20\Rx.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V3_5, Full)) |> shouldContain @"..\Rx-Main\lib\net20\Rx.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4, Full)) |> shouldNotContain @"..\Rx-Main\lib\net20\Rx.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4_5, Full)) |> shouldNotContain @"..\Rx-Main\lib\net20\Rx.dll" [] let ``should filter _._ when processing blacklist``() = @@ -70,8 +70,8 @@ let ``should filter _._ when processing blacklist``() = emptymodel.AddReferences([ @"..\Rx-Main\lib\net40\_._"; @"..\Rx-Main\lib\net20\_._" ]) .FilterBlackList() - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V2, Full)) |> shouldNotContain @"..\Rx-Main\lib\net20\_._" - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V4, Full)) |> shouldNotContain @"..\Rx-Main\lib\net40\_._" + model.GetFiles(DotNetFramework(FrameworkVersion.V2, Full)) |> shouldNotContain @"..\Rx-Main\lib\net20\_._" + model.GetFiles(DotNetFramework(FrameworkVersion.V4, Full)) |> shouldNotContain @"..\Rx-Main\lib\net40\_._" [] let ``should install single client profile lib for everything``() = @@ -79,10 +79,10 @@ let ``should install single client profile lib for everything``() = emptymodel.AddReferences([ @"..\Castle.Core\lib\net40-client\Castle.Core.dll" ]) .UseLowerVersionLibIfEmpty() - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V3_5, Full)) |> shouldNotContain @"..\Castle.Core\lib\net40-client\Castle.Core.dll" - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V4, Client)) |> shouldContain @"..\Castle.Core\lib\net40-client\Castle.Core.dll" - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V4, Full)) |> shouldContain @"..\Castle.Core\lib\net40-client\Castle.Core.dll" - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V4_5, Full)) |> shouldContain @"..\Castle.Core\lib\net40-client\Castle.Core.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V3_5, Full)) |> shouldNotContain @"..\Castle.Core\lib\net40-client\Castle.Core.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4, Client)) |> shouldContain @"..\Castle.Core\lib\net40-client\Castle.Core.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4, Full)) |> shouldContain @"..\Castle.Core\lib\net40-client\Castle.Core.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4_5, Full)) |> shouldContain @"..\Castle.Core\lib\net40-client\Castle.Core.dll" [] let ``should handle lib install of Microsoft.Net.Http for .NET 4.5``() = @@ -97,14 +97,14 @@ let ``should handle lib install of Microsoft.Net.Http for .NET 4.5``() = @"..\Microsoft.Net.Http\lib\net45\System.Net.Http.Primitives.dll" ]) .UseLowerVersionLibIfEmpty() - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V3_5, Full)) |> shouldNotContain @"..\Microsoft.Net.Http\lib\net40\System.Net.Http.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V3_5, Full)) |> shouldNotContain @"..\Microsoft.Net.Http\lib\net40\System.Net.Http.dll" - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V4, Full)) |> shouldContain @"..\Microsoft.Net.Http\lib\net40\System.Net.Http.dll" - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V4, Full)) |> shouldContain @"..\Microsoft.Net.Http\lib\net40\System.Net.Http.Primitives.dll" - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V4, Full)) |> shouldContain @"..\Microsoft.Net.Http\lib\net40\System.Net.Http.WebRequest.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4, Full)) |> shouldContain @"..\Microsoft.Net.Http\lib\net40\System.Net.Http.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4, Full)) |> shouldContain @"..\Microsoft.Net.Http\lib\net40\System.Net.Http.Primitives.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4, Full)) |> shouldContain @"..\Microsoft.Net.Http\lib\net40\System.Net.Http.WebRequest.dll" - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V4_5, Full)) |> shouldNotContain @"..\Microsoft.Net.Http\lib\net40\System.Net.Http.dll" - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V4_5, Full)) |> shouldContain @"..\Microsoft.Net.Http\lib\net45\System.Net.Http.Primitives.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4_5, Full)) |> shouldNotContain @"..\Microsoft.Net.Http\lib\net40\System.Net.Http.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4_5, Full)) |> shouldContain @"..\Microsoft.Net.Http\lib\net45\System.Net.Http.Primitives.dll" [] let ``should handle lib install of Jint for NET >= 40 and SL >= 50``() = @@ -114,9 +114,9 @@ let ``should handle lib install of Jint for NET >= 40 and SL >= 50``() = model.GetFiles(PortableFramework("7.0", "net40+sl50+win+wp80")) |> shouldContain @"..\Jint\lib\portable-net40+sl50+win+wp80\Jint.dll" - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V3_5, Full)) |> shouldNotContain @"..\Jint\lib\portable-net40+sl50+win+wp80\Jint.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V3_5, Full)) |> shouldNotContain @"..\Jint\lib\portable-net40+sl50+win+wp80\Jint.dll" - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V4, Full)) |> shouldContain @"..\Jint\lib\portable-net40+sl50+win+wp80\Jint.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4, Full)) |> shouldContain @"..\Jint\lib\portable-net40+sl50+win+wp80\Jint.dll" model.GetFiles(Silverlight("v5.0")) |> shouldContain @"..\Jint\lib\portable-net40+sl50+win+wp80\Jint.dll" @@ -131,14 +131,14 @@ let ``should handle lib install of Microsoft.BCL for NET >= 40``() = @"..\Microsoft.Bcl\lib\net45\_._" ]) .Process() - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V3_5, Full)) |> shouldNotContain @"..\Microsoft.Bcl\lib\net40\System.IO.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V3_5, Full)) |> shouldNotContain @"..\Microsoft.Bcl\lib\net40\System.IO.dll" - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V4, Full)) |> shouldContain @"..\Microsoft.Bcl\lib\net40\System.IO.dll" - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V4, Full)) |> shouldContain @"..\Microsoft.Bcl\lib\net40\System.Runtime.dll" - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V4, Full)) |> shouldContain @"..\Microsoft.Bcl\lib\net40\System.Threading.Tasks.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4, Full)) |> shouldContain @"..\Microsoft.Bcl\lib\net40\System.IO.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4, Full)) |> shouldContain @"..\Microsoft.Bcl\lib\net40\System.Runtime.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4, Full)) |> shouldContain @"..\Microsoft.Bcl\lib\net40\System.Threading.Tasks.dll" - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V4_5, Full)) |> shouldBeEmpty - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V4_5_1, Full)) |> shouldBeEmpty + model.GetFiles(DotNetFramework(FrameworkVersion.V4_5, Full)) |> shouldBeEmpty + model.GetFiles(DotNetFramework(FrameworkVersion.V4_5_1, Full)) |> shouldBeEmpty [] @@ -168,9 +168,9 @@ let ``should not use portable-net40 if we have net40``() = @"..\Microsoft.Bcl\lib\portable-net40+sl4+win8\System.Runtime.dll" @"..\Microsoft.Bcl\lib\portable-net40+sl4+win8\System.Threading.Tasks.dll" ]) - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V4, Full)) |> shouldContain @"..\Microsoft.Bcl\lib\net40\System.IO.dll" - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V4, Full)) |> shouldContain @"..\Microsoft.Bcl\lib\net40\System.Runtime.dll" - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V4, Full)) |> shouldContain @"..\Microsoft.Bcl\lib\net40\System.Threading.Tasks.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4, Full)) |> shouldContain @"..\Microsoft.Bcl\lib\net40\System.IO.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4, Full)) |> shouldContain @"..\Microsoft.Bcl\lib\net40\System.Runtime.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4, Full)) |> shouldContain @"..\Microsoft.Bcl\lib\net40\System.Threading.Tasks.dll" model.GetFiles(PortableFramework("7.0", "net40+sl4+win8")) |> shouldContain @"..\Microsoft.Bcl\lib\portable-net40+sl4+win8\System.IO.dll" model.GetFiles(PortableFramework("7.0", "net40+sl4+win8")) |> shouldContain @"..\Microsoft.Bcl\lib\portable-net40+sl4+win8\System.Runtime.dll" @@ -180,10 +180,10 @@ let ``should not use portable-net40 if we have net40``() = let ``should handle lib install of DotNetZip 1.9.3``() = let model = emptymodel.AddReferences([ @"..\DotNetZip\lib\net20\Ionic.Zip.dll" ]).Process() - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V2, Full)) |> shouldContain @"..\DotNetZip\lib\net20\Ionic.Zip.dll" - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V3_5, Full)) |> shouldContain @"..\DotNetZip\lib\net20\Ionic.Zip.dll" - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V4, Full)) |> shouldContain @"..\DotNetZip\lib\net20\Ionic.Zip.dll" - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V4_5, Full)) |> shouldContain @"..\DotNetZip\lib\net20\Ionic.Zip.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V2, Full)) |> shouldContain @"..\DotNetZip\lib\net20\Ionic.Zip.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V3_5, Full)) |> shouldContain @"..\DotNetZip\lib\net20\Ionic.Zip.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4, Full)) |> shouldContain @"..\DotNetZip\lib\net20\Ionic.Zip.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4_5, Full)) |> shouldContain @"..\DotNetZip\lib\net20\Ionic.Zip.dll" [] @@ -218,11 +218,11 @@ let ``should handle lib install of Microsoft.Net.Http 2.2.28``() = @"..\Microsoft.Net.Http\lib\wpa81\System.Net.Http.Primitives.dll" ]) .Process() - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V3_5, Full)) |> shouldNotContain @"..\Microsoft.Net.Http\lib\net40\System.Net.Http.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V3_5, Full)) |> shouldNotContain @"..\Microsoft.Net.Http\lib\net40\System.Net.Http.dll" - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V4, Full)) |> shouldContain @"..\Microsoft.Net.Http\lib\net40\System.Net.Http.dll" - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V4, Full)) |> shouldContain @"..\Microsoft.Net.Http\lib\net40\System.Net.Http.Primitives.dll" - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V4, Full)) |> shouldContain @"..\Microsoft.Net.Http\lib\net40\System.Net.Http.WebRequest.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4, Full)) |> shouldContain @"..\Microsoft.Net.Http\lib\net40\System.Net.Http.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4, Full)) |> shouldContain @"..\Microsoft.Net.Http\lib\net40\System.Net.Http.Primitives.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4, Full)) |> shouldContain @"..\Microsoft.Net.Http\lib\net40\System.Net.Http.WebRequest.dll" model.GetFiles(MonoAndroid) |> shouldContain @"..\Microsoft.Net.Http\lib\monoandroid\System.Net.Http.Extensions.dll" model.GetFiles(MonoAndroid) |> shouldContain @"..\Microsoft.Net.Http\lib\monoandroid\System.Net.Http.Primitives.dll" @@ -230,11 +230,11 @@ let ``should handle lib install of Microsoft.Net.Http 2.2.28``() = model.GetFiles(MonoTouch) |> shouldContain @"..\Microsoft.Net.Http\lib\monotouch\System.Net.Http.Extensions.dll" model.GetFiles(MonoTouch) |> shouldContain @"..\Microsoft.Net.Http\lib\monotouch\System.Net.Http.Primitives.dll" - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V4_5, Full)) |> shouldNotContain @"..\Microsoft.Net.Http\lib\net40\System.Net.Http.dll" - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V4_5, Full)) |> shouldContain @"..\Microsoft.Net.Http\lib\net45\System.Net.Http.Primitives.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4_5, Full)) |> shouldNotContain @"..\Microsoft.Net.Http\lib\net40\System.Net.Http.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4_5, Full)) |> shouldContain @"..\Microsoft.Net.Http\lib\net45\System.Net.Http.Primitives.dll" - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V4_5, Full)) |> shouldNotContain @"..\Microsoft.Net.Http\lib\net40\System.Net.Http.dll" - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V4_5, Full)) |> shouldContain @"..\Microsoft.Net.Http\lib\net45\System.Net.Http.Primitives.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4_5, Full)) |> shouldNotContain @"..\Microsoft.Net.Http\lib\net40\System.Net.Http.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4_5, Full)) |> shouldContain @"..\Microsoft.Net.Http\lib\net45\System.Net.Http.Primitives.dll" model.GetFiles(PortableFramework("7.0", "net40+sl4+win8+wp71+wpa81")) |> shouldContain @"..\Microsoft.Net.Http\lib\portable-net40+sl4+win8+wp71+wpa81\System.Net.Http.dll" model.GetFiles(PortableFramework("7.0", "net40+sl4+win8+wp71+wpa81")) |> shouldContain @"..\Microsoft.Net.Http\lib\portable-net40+sl4+win8+wp71+wpa81\System.Net.Http.Extensions.dll" @@ -288,11 +288,11 @@ let ``should handle lib install of Microsoft.Bcl 1.1.9``() = ]) .Process() - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V4, Full)) |> shouldContain @"..\Microsoft.Bcl\lib\net40\System.IO.dll" - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V4, Full)) |> shouldContain @"..\Microsoft.Bcl\lib\net40\System.Runtime.dll" - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V4, Full)) |> shouldContain @"..\Microsoft.Bcl\lib\net40\System.Threading.Tasks.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4, Full)) |> shouldContain @"..\Microsoft.Bcl\lib\net40\System.IO.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4, Full)) |> shouldContain @"..\Microsoft.Bcl\lib\net40\System.Runtime.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4, Full)) |> shouldContain @"..\Microsoft.Bcl\lib\net40\System.Threading.Tasks.dll" - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V4_5, Full)) |> shouldBeEmpty + model.GetFiles(DotNetFramework(FrameworkVersion.V4_5, Full)) |> shouldBeEmpty model.GetFiles(MonoAndroid) |> shouldBeEmpty model.GetFiles(MonoTouch) |> shouldBeEmpty model.GetFiles(Windows "v8.0") |> shouldBeEmpty @@ -327,18 +327,17 @@ let ``should handle lib install of Fantomas 1.5``() = @"..\Fantomas\lib\Fantomas.exe" ]) .Process() - model.GetFiles(DotNetFramework(All, Full)) |> shouldBeEmpty - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V2, Full)) |> shouldContain @"..\Fantomas\lib\FantomasLib.dll" - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V2, Full)) |> shouldContain @"..\Fantomas\lib\FSharp.Core.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V2, Full)) |> shouldContain @"..\Fantomas\lib\FantomasLib.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V2, Full)) |> shouldContain @"..\Fantomas\lib\FSharp.Core.dll" - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V3_5, Full)) |> shouldContain @"..\Fantomas\lib\FantomasLib.dll" - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V3_5, Full)) |> shouldContain @"..\Fantomas\lib\FSharp.Core.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V3_5, Full)) |> shouldContain @"..\Fantomas\lib\FantomasLib.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V3_5, Full)) |> shouldContain @"..\Fantomas\lib\FSharp.Core.dll" - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V4, Full)) |> shouldContain @"..\Fantomas\lib\FantomasLib.dll" - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V4, Full)) |> shouldContain @"..\Fantomas\lib\FSharp.Core.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4, Full)) |> shouldContain @"..\Fantomas\lib\FantomasLib.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4, Full)) |> shouldContain @"..\Fantomas\lib\FSharp.Core.dll" - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V4_5, Full)) |> shouldContain @"..\Fantomas\lib\FantomasLib.dll" - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V4_5, Full)) |> shouldContain @"..\Fantomas\lib\FSharp.Core.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4_5, Full)) |> shouldContain @"..\Fantomas\lib\FantomasLib.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4_5, Full)) |> shouldContain @"..\Fantomas\lib\FSharp.Core.dll" [] let ``should handle lib install of Fantomas 1.5.0 with explicit references``() = @@ -349,18 +348,17 @@ let ``should handle lib install of Fantomas 1.5.0 with explicit references``() = @"..\Fantomas\lib\Fantomas.exe" ], NuspecReferences.Explicit ["FantomasLib.dll"]) .Process() - model.GetFiles(DotNetFramework(All, Full)) |> shouldBeEmpty - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V2, Full)) |> shouldContain @"..\Fantomas\lib\FantomasLib.dll" - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V2, Full)) |> shouldNotContain @"..\Fantomas\lib\FSharp.Core.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V2, Full)) |> shouldContain @"..\Fantomas\lib\FantomasLib.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V2, Full)) |> shouldNotContain @"..\Fantomas\lib\FSharp.Core.dll" - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V3_5, Full)) |> shouldContain @"..\Fantomas\lib\FantomasLib.dll" - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V3_5, Full)) |> shouldNotContain @"..\Fantomas\lib\FSharp.Core.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V3_5, Full)) |> shouldContain @"..\Fantomas\lib\FantomasLib.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V3_5, Full)) |> shouldNotContain @"..\Fantomas\lib\FSharp.Core.dll" - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V4, Full)) |> shouldContain @"..\Fantomas\lib\FantomasLib.dll" - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V4, Full)) |> shouldNotContain @"..\Fantomas\lib\FSharp.Core.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4, Full)) |> shouldContain @"..\Fantomas\lib\FantomasLib.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4, Full)) |> shouldNotContain @"..\Fantomas\lib\FSharp.Core.dll" - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V4_5, Full)) |> shouldContain @"..\Fantomas\lib\FantomasLib.dll" - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V4_5, Full)) |> shouldNotContain @"..\Fantomas\lib\FSharp.Core.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4_5, Full)) |> shouldContain @"..\Fantomas\lib\FantomasLib.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4_5, Full)) |> shouldNotContain @"..\Fantomas\lib\FSharp.Core.dll" [] @@ -373,10 +371,10 @@ let ``should only handle dll and exe files``() = @"..\Fantomas\lib\Fantomas.exe" ], NuspecReferences.All) .Process() - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V2, Full)) |> shouldContain @"..\Fantomas\lib\FantomasLib.dll" - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V2, Full)) |> shouldContain @"..\Fantomas\lib\FSharp.Core.dll" - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V2, Full)) |> shouldContain @"..\Fantomas\lib\Fantomas.exe" - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V2, Full)) |> shouldNotContain @"..\Fantomas\lib\FantomasLib.xml" + model.GetFiles(DotNetFramework(FrameworkVersion.V2, Full)) |> shouldContain @"..\Fantomas\lib\FantomasLib.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V2, Full)) |> shouldContain @"..\Fantomas\lib\FSharp.Core.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V2, Full)) |> shouldContain @"..\Fantomas\lib\Fantomas.exe" + model.GetFiles(DotNetFramework(FrameworkVersion.V2, Full)) |> shouldNotContain @"..\Fantomas\lib\FantomasLib.xml" [] let ``should use portable net40 in net45 when don't have other files``() = @@ -385,11 +383,11 @@ let ``should use portable net40 in net45 when don't have other files``() = [ @"..\Google.Apis.Core\lib\portable-net40+sl50+win+wpa81+wp80\Google.Apis.Core.dll" ], NuspecReferences.All) .Process() - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V4, Full)) |> shouldContain @"..\Google.Apis.Core\lib\portable-net40+sl50+win+wpa81+wp80\Google.Apis.Core.dll" - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V4_5, Full)) |> shouldContain @"..\Google.Apis.Core\lib\portable-net40+sl50+win+wpa81+wp80\Google.Apis.Core.dll" - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V4_5_1, Full)) |> shouldContain @"..\Google.Apis.Core\lib\portable-net40+sl50+win+wpa81+wp80\Google.Apis.Core.dll" - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V4_5_2, Full)) |> shouldContain @"..\Google.Apis.Core\lib\portable-net40+sl50+win+wpa81+wp80\Google.Apis.Core.dll" - model.GetFiles(DotNetFramework(Framework FrameworkVersionNo.V4_5_3, Full)) |> shouldContain @"..\Google.Apis.Core\lib\portable-net40+sl50+win+wpa81+wp80\Google.Apis.Core.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4, Full)) |> shouldContain @"..\Google.Apis.Core\lib\portable-net40+sl50+win+wpa81+wp80\Google.Apis.Core.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4_5, Full)) |> shouldContain @"..\Google.Apis.Core\lib\portable-net40+sl50+win+wpa81+wp80\Google.Apis.Core.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4_5_1, Full)) |> shouldContain @"..\Google.Apis.Core\lib\portable-net40+sl50+win+wpa81+wp80\Google.Apis.Core.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4_5_2, Full)) |> shouldContain @"..\Google.Apis.Core\lib\portable-net40+sl50+win+wpa81+wp80\Google.Apis.Core.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4_5_3, Full)) |> shouldContain @"..\Google.Apis.Core\lib\portable-net40+sl50+win+wpa81+wp80\Google.Apis.Core.dll" [] let ``should not install tools``() = diff --git a/tests/Paket.Tests/InstallModel/Xml/SystemNetHttpWithFrameworkReferences.fs b/tests/Paket.Tests/InstallModel/Xml/SystemNetHttpWithFrameworkReferences.fs index 4f74cf90a5..dc27f28720 100644 --- a/tests/Paket.Tests/InstallModel/Xml/SystemNetHttpWithFrameworkReferences.fs +++ b/tests/Paket.Tests/InstallModel/Xml/SystemNetHttpWithFrameworkReferences.fs @@ -85,8 +85,8 @@ let ``should generate Xml for System.Net.Http 2.2.8``() = @"..\Microsoft.Net.Http\lib\net45\System.Net.Http.Primitives.dll"], { References = NuspecReferences.All FrameworkAssemblyReferences = - [{ AssemblyName = "System.Net.Http"; TargetFramework = DotNetFramework(FrameworkVersion.Framework(FrameworkVersionNo.V4_5),Full) } - { AssemblyName = "System.Net.Http.WebRequest"; TargetFramework = DotNetFramework(FrameworkVersion.Framework(FrameworkVersionNo.V4_5),Full) }] }) + [{ AssemblyName = "System.Net.Http"; TargetFramework = DotNetFramework(FrameworkVersion.V4_5,Full) } + { AssemblyName = "System.Net.Http.WebRequest"; TargetFramework = DotNetFramework(FrameworkVersion.V4_5,Full) }] }) let chooseNode = ProjectFile.Load("./ProjectFile/TestData/Empty.fsprojtest").Value.GenerateXml(model) chooseNode.OuterXml diff --git a/tests/Paket.Tests/ProjectFile/ConditionSpecs.fs b/tests/Paket.Tests/ProjectFile/ConditionSpecs.fs index c13b5e08c2..cbc21bbb3d 100644 --- a/tests/Paket.Tests/ProjectFile/ConditionSpecs.fs +++ b/tests/Paket.Tests/ProjectFile/ConditionSpecs.fs @@ -8,33 +8,33 @@ let element x = match x with | Some y -> y [] let ``should detect framework version from path``() = - FrameworkIdentifier.DetectFromPath(@"..\RestSharp\lib\net4\RestSharp.dll")|> element |> shouldEqual (DotNetFramework(Framework FrameworkVersionNo.V4,Full)) - FrameworkIdentifier.DetectFromPath(@"..\Rx-Main\lib\net40\Rx.dll")|> element |> shouldEqual (DotNetFramework(Framework FrameworkVersionNo.V4,Full)) - FrameworkIdentifier.DetectFromPath(@"..\Rx-Main\lib\net45\Rx.dll")|> element |> shouldEqual (DotNetFramework(Framework FrameworkVersionNo.V4_5,Full)) - FrameworkIdentifier.DetectFromPath(@"..\Rx-Main\lib\net20\Rx.dll")|> element |> shouldEqual (DotNetFramework(Framework FrameworkVersionNo.V2,Full)) - FrameworkIdentifier.DetectFromPath(@"..\Rx-Main\lib\net35\Rx.dll")|> element |> shouldEqual (DotNetFramework(Framework FrameworkVersionNo.V3_5,Full)) - FrameworkIdentifier.DetectFromPath("../Rx-Main/lib/net35/Rx.dll")|> element |> shouldEqual (DotNetFramework(Framework FrameworkVersionNo.V3_5,Full)) - FrameworkIdentifier.DetectFromPath(@"..\NUnit\lib\NUnit.dll")|> element |> shouldEqual (DotNetFramework(All,Full)) - FrameworkIdentifier.DetectFromPath("../NUnit/lib/NUnit.dll")|> element |> shouldEqual (DotNetFramework(All,Full)) + FrameworkIdentifier.DetectFromPath(@"..\RestSharp\lib\net4\RestSharp.dll")|> element |> shouldEqual (DotNetFramework(FrameworkVersion.V4,Full)) + FrameworkIdentifier.DetectFromPath(@"..\Rx-Main\lib\net40\Rx.dll")|> element |> shouldEqual (DotNetFramework(FrameworkVersion.V4,Full)) + FrameworkIdentifier.DetectFromPath(@"..\Rx-Main\lib\net45\Rx.dll")|> element |> shouldEqual (DotNetFramework(FrameworkVersion.V4_5,Full)) + FrameworkIdentifier.DetectFromPath(@"..\Rx-Main\lib\net20\Rx.dll")|> element |> shouldEqual (DotNetFramework(FrameworkVersion.V2,Full)) + FrameworkIdentifier.DetectFromPath(@"..\Rx-Main\lib\net35\Rx.dll")|> element |> shouldEqual (DotNetFramework(FrameworkVersion.V3_5,Full)) + FrameworkIdentifier.DetectFromPath("../Rx-Main/lib/net35/Rx.dll")|> element |> shouldEqual (DotNetFramework(FrameworkVersion.V3_5,Full)) + FrameworkIdentifier.DetectFromPath(@"..\NUnit\lib\NUnit.dll")|> element |> shouldEqual (DotNetFramework(FrameworkVersion.V1,Full)) + FrameworkIdentifier.DetectFromPath("../NUnit/lib/NUnit.dll")|> element |> shouldEqual (DotNetFramework(FrameworkVersion.V1,Full)) [] let ``should detect CLR version from path``() = - FrameworkIdentifier.DetectFromPath(@"..\Rx-log4net\lib\1.0\log4net.dll")|> element |> shouldEqual (DotNetFramework(All,Full)) - FrameworkIdentifier.DetectFromPath(@"..\Rx-log4net\lib\1.1\log4net.dll")|> element |> shouldEqual (DotNetFramework(All,Full)) - FrameworkIdentifier.DetectFromPath(@"..\Rx-log4net\lib\2.0\log4net.dll")|> element |> shouldEqual (DotNetFramework(All,Full)) + FrameworkIdentifier.DetectFromPath(@"..\Rx-log4net\lib\1.0\log4net.dll")|> element |> shouldEqual (DotNetFramework(FrameworkVersion.V1,Full)) + FrameworkIdentifier.DetectFromPath(@"..\Rx-log4net\lib\1.1\log4net.dll")|> element |> shouldEqual (DotNetFramework(FrameworkVersion.V1_1,Full)) + FrameworkIdentifier.DetectFromPath(@"..\Rx-log4net\lib\2.0\log4net.dll")|> element |> shouldEqual (DotNetFramework(FrameworkVersion.V2,Full)) [] let ``should detect client framework version from path``() = - FrameworkIdentifier.DetectFromPath(@"..\packages\Castle.Core\lib\net40-client\Castle.Core.dll")|> element |> shouldEqual (DotNetFramework(Framework FrameworkVersionNo.V4,Client)) + FrameworkIdentifier.DetectFromPath(@"..\packages\Castle.Core\lib\net40-client\Castle.Core.dll")|> element |> shouldEqual (DotNetFramework(FrameworkVersion.V4,Client)) [] let ``should detect net40-full as net40``() = - FrameworkIdentifier.DetectFromPath(@"..\packages\log4net\lib\net40-full\log4net.dll")|> element |> shouldEqual(DotNetFramework(Framework FrameworkVersionNo.V4,Full)) - FrameworkIdentifier.DetectFromPath(@"..\packages\log4net\lib\net40\log4net.dll")|> element |> shouldEqual (DotNetFramework(Framework FrameworkVersionNo.V4,Full)) + FrameworkIdentifier.DetectFromPath(@"..\packages\log4net\lib\net40-full\log4net.dll")|> element |> shouldEqual(DotNetFramework(FrameworkVersion.V4,Full)) + FrameworkIdentifier.DetectFromPath(@"..\packages\log4net\lib\net40\log4net.dll")|> element |> shouldEqual (DotNetFramework(FrameworkVersion.V4,Full)) [] let ``should detect net451``() = - FrameworkIdentifier.DetectFromPath(@"..\Rx-Main\lib\net451\Rx.dll")|> element |> shouldEqual (DotNetFramework(Framework FrameworkVersionNo.V4_5_1,Full)) + FrameworkIdentifier.DetectFromPath(@"..\Rx-Main\lib\net451\Rx.dll")|> element |> shouldEqual (DotNetFramework(FrameworkVersion.V4_5_1,Full)) [] let ``should detect Silverlight version from path``() = @@ -49,21 +49,21 @@ let ``should detect WindowsPhone version from path``() = [] let ``should detect framework version from uppercase path``() = - FrameworkIdentifier.DetectFromPath(@"..\packages\GitVersion.1.2.0\Lib\Net45\GitVersionCore.dll")|> element |> shouldEqual (DotNetFramework(Framework FrameworkVersionNo.V4_5,Full)) + FrameworkIdentifier.DetectFromPath(@"..\packages\GitVersion.1.2.0\Lib\Net45\GitVersionCore.dll")|> element |> shouldEqual (DotNetFramework(FrameworkVersion.V4_5,Full)) [] let ``should detect net45-full``() = - FrameworkIdentifier.DetectFromPath(@"..\packages\Ninject\lib\net45-full\Ninject.dll")|> element |> shouldEqual (DotNetFramework(Framework FrameworkVersionNo.V4_5,Full)) + FrameworkIdentifier.DetectFromPath(@"..\packages\Ninject\lib\net45-full\Ninject.dll")|> element |> shouldEqual (DotNetFramework(FrameworkVersion.V4_5,Full)) [] let ``should detect net``() = - FrameworkIdentifier.DetectFromPath(@"..\packages\RhinoMocks\lib\net\Rhino.Mocks.dll")|> element |> shouldEqual (DotNetFramework(All,Full)) + FrameworkIdentifier.DetectFromPath(@"..\packages\RhinoMocks\lib\net\Rhino.Mocks.dll")|> element |> shouldEqual (DotNetFramework(FrameworkVersion.V2,Full)) [] let ``should detect 35, 40 and 45``() = - FrameworkIdentifier.DetectFromPath(@"..\packages\FSharpx.Core\lib\35\FSharp.Core.dll")|> element |> shouldEqual (DotNetFramework(Framework FrameworkVersionNo.V3_5,Full)) - FrameworkIdentifier.DetectFromPath(@"..\packages\FSharpx.Core\lib\40\FSharp.Core.dll")|> element |> shouldEqual (DotNetFramework(Framework FrameworkVersionNo.V4,Full)) - FrameworkIdentifier.DetectFromPath(@"..\packages\FSharpx.Core\lib\45\FSharp.Core.dll")|> element |> shouldEqual (DotNetFramework(Framework FrameworkVersionNo.V4_5,Full)) + FrameworkIdentifier.DetectFromPath(@"..\packages\FSharpx.Core\lib\35\FSharp.Core.dll")|> element |> shouldEqual (DotNetFramework(FrameworkVersion.V3_5,Full)) + FrameworkIdentifier.DetectFromPath(@"..\packages\FSharpx.Core\lib\40\FSharp.Core.dll")|> element |> shouldEqual (DotNetFramework(FrameworkVersion.V4,Full)) + FrameworkIdentifier.DetectFromPath(@"..\packages\FSharpx.Core\lib\45\FSharp.Core.dll")|> element |> shouldEqual (DotNetFramework(FrameworkVersion.V4_5,Full)) [] From 876b8f8d385838059a1487520149525077b98840 Mon Sep 17 00:00:00 2001 From: Tomasz Heimowski Date: Sat, 18 Oct 2014 13:54:46 +0200 Subject: [PATCH 3/3] removing FrameworkProfile, embed V4_Client case --- src/Paket.Core/FrameworkHandling.fs | 73 ++++---- src/Paket.Core/InstallModel.fs | 12 +- tests/Paket.Tests/InstallModel/NuspecSpecs.fs | 6 +- .../InstallModel/ProcessingSpecs.fs | 170 +++++++++--------- .../SystemNetHttpWithFrameworkReferences.fs | 4 +- .../Paket.Tests/ProjectFile/ConditionSpecs.fs | 42 ++--- 6 files changed, 152 insertions(+), 155 deletions(-) diff --git a/src/Paket.Core/FrameworkHandling.fs b/src/Paket.Core/FrameworkHandling.fs index 35d9f369b9..928e9f21dc 100644 --- a/src/Paket.Core/FrameworkHandling.fs +++ b/src/Paket.Core/FrameworkHandling.fs @@ -3,11 +3,6 @@ open System.IO open System -/// The Framework profile. -type FrameworkProfile = - | Client - | Full - [] /// The Framework version. type FrameworkVersion = @@ -15,6 +10,7 @@ type FrameworkVersion = | V1_1 | V2 | V3_5 + | V4_Client | V4 | V4_5 | V4_5_1 @@ -26,6 +22,7 @@ type FrameworkVersion = | V1_1 -> "v1.1" | V2 -> "v2.0" | V3_5 -> "v3.5" + | V4_Client -> "v4.0" | V4 -> "v4.0" | V4_5 -> "v4.5" | V4_5_1 -> "v4.5.1" @@ -33,16 +30,16 @@ type FrameworkVersion = | V4_5_3 -> "v4.5.3" static member KnownDotNetFrameworks = - [ FrameworkVersion.V1, Full - FrameworkVersion.V1_1, Full - FrameworkVersion.V2, Full - FrameworkVersion.V3_5, Full - FrameworkVersion.V4, Client - FrameworkVersion.V4, Full - FrameworkVersion.V4_5, Full - FrameworkVersion.V4_5_1, Full - FrameworkVersion.V4_5_2, Full - FrameworkVersion.V4_5_3, Full ] + [ FrameworkVersion.V1 + FrameworkVersion.V1_1 + FrameworkVersion.V2 + FrameworkVersion.V3_5 + FrameworkVersion.V4_Client + FrameworkVersion.V4 + FrameworkVersion.V4_5 + FrameworkVersion.V4_5_1 + FrameworkVersion.V4_5_2 + FrameworkVersion.V4_5_3 ] type PlatformVersion = string @@ -50,7 +47,7 @@ type PortableFrameworkProfile = string /// Framework Identifier type. type FrameworkIdentifier = - | DotNetFramework of FrameworkVersion * FrameworkProfile + | DotNetFramework of FrameworkVersion | PortableFramework of PlatformVersion * PortableFrameworkProfile | MonoAndroid | MonoTouch @@ -86,25 +83,25 @@ type FrameworkIdentifier = |> List.fold (fun (path:string) (pattern,replacement) -> path.Replace(pattern.ToLower(),replacement.ToLower())) (path.ToLower()) match path with - | "net" -> Some(DotNetFramework(FrameworkVersion.V2, Full)) // not sure here - | "1.0" -> Some(DotNetFramework(FrameworkVersion.V1, Full)) - | "1.1" -> Some(DotNetFramework(FrameworkVersion.V1_1, Full)) - | "2.0" -> Some(DotNetFramework(FrameworkVersion.V2, Full)) - | "net11" -> Some(DotNetFramework(FrameworkVersion.V1_1, Full)) - | "net20" -> Some(DotNetFramework(FrameworkVersion.V2, Full)) - | "net20-full" -> Some(DotNetFramework(FrameworkVersion.V2, Full)) - | "net35" -> Some(DotNetFramework(FrameworkVersion.V3_5, Full)) - | "net35-full" -> Some(DotNetFramework(FrameworkVersion.V3_5, Full)) - | "net4" -> Some(DotNetFramework(FrameworkVersion.V4, Full)) - | "net40" -> Some(DotNetFramework(FrameworkVersion.V4, Full)) - | "net40-full" -> Some(DotNetFramework(FrameworkVersion.V4, Full)) - | "net40-client" -> Some(DotNetFramework(FrameworkVersion.V4, Client)) - | "net45" -> Some(DotNetFramework(FrameworkVersion.V4_5, Full)) - | "net45-full" -> Some(DotNetFramework(FrameworkVersion.V4_5, Full)) - | "net451" -> Some(DotNetFramework(FrameworkVersion.V4_5_1, Full)) - | "35" -> Some(DotNetFramework(FrameworkVersion.V3_5, Full)) - | "40" -> Some(DotNetFramework(FrameworkVersion.V4, Full)) - | "45" -> Some(DotNetFramework(FrameworkVersion.V4_5, Full)) + | "net" -> Some(DotNetFramework(FrameworkVersion.V2)) // not sure here + | "1.0" -> Some(DotNetFramework(FrameworkVersion.V1)) + | "1.1" -> Some(DotNetFramework(FrameworkVersion.V1_1)) + | "2.0" -> Some(DotNetFramework(FrameworkVersion.V2)) + | "net11" -> Some(DotNetFramework(FrameworkVersion.V1_1)) + | "net20" -> Some(DotNetFramework(FrameworkVersion.V2)) + | "net20-full" -> Some(DotNetFramework(FrameworkVersion.V2)) + | "net35" -> Some(DotNetFramework(FrameworkVersion.V3_5)) + | "net35-full" -> Some(DotNetFramework(FrameworkVersion.V3_5)) + | "net4" -> Some(DotNetFramework(FrameworkVersion.V4)) + | "net40" -> Some(DotNetFramework(FrameworkVersion.V4)) + | "net40-full" -> Some(DotNetFramework(FrameworkVersion.V4)) + | "net40-client" -> Some(DotNetFramework(FrameworkVersion.V4_Client)) + | "net45" -> Some(DotNetFramework(FrameworkVersion.V4_5)) + | "net45-full" -> Some(DotNetFramework(FrameworkVersion.V4_5)) + | "net451" -> Some(DotNetFramework(FrameworkVersion.V4_5_1)) + | "35" -> Some(DotNetFramework(FrameworkVersion.V3_5)) + | "40" -> Some(DotNetFramework(FrameworkVersion.V4)) + | "45" -> Some(DotNetFramework(FrameworkVersion.V4_5)) | "sl3" -> Some(Silverlight "v3.0") | "sl4" -> Some(Silverlight "v4.0") | "sl5" -> Some(Silverlight "v5.0") @@ -198,7 +195,7 @@ type FrameworkIdentifier = member x.GetFrameworkProfile() = match x with - | DotNetFramework(_,Client) -> "$(TargetFrameworkProfile) == 'Client'" + | DotNetFramework(FrameworkVersion.V4_Client) -> "$(TargetFrameworkProfile) == 'Client'" | PortableFramework(_,profile) -> match x.GetPortableProfile() with | None -> sprintf "$(TargetFrameworkProfile) == '%s'" profile @@ -225,7 +222,7 @@ type FrameworkIdentifier = y else x + " And " + y match x with - | DotNetFramework(fw,_) -> sprintf "$(TargetFrameworkVersion) == '%s'" (fw.ToString()) ++ x.GetFrameworkProfile() + | DotNetFramework(fw) -> sprintf "$(TargetFrameworkVersion) == '%s'" (fw.ToString()) ++ x.GetFrameworkProfile() | PortableFramework _ -> x.GetFrameworkProfile() ++ x.GetPlatformIdentifier() ++ x.GetPlatformVersion() | WindowsPhoneApp _ -> x.GetPlatformVersion() | Windows _ -> x.GetPlatformVersion() @@ -242,7 +239,7 @@ type FrameworkIdentifier = let path = path.Replace("\\", "/").ToLower() let fi = new FileInfo(path) - if path.Contains("lib/" + fi.Name.ToLower()) then Some(DotNetFramework(FrameworkVersion.V1, Full)) + if path.Contains("lib/" + fi.Name.ToLower()) then Some(DotNetFramework(FrameworkVersion.V1)) else let startPos = path.IndexOf("lib/") let endPos = path.IndexOf(fi.Name.ToLower()) diff --git a/src/Paket.Core/InstallModel.fs b/src/Paket.Core/InstallModel.fs index a04b667e3a..3ed28b63d4 100644 --- a/src/Paket.Core/InstallModel.fs +++ b/src/Paket.Core/InstallModel.fs @@ -26,7 +26,7 @@ type InstallModel = static member EmptyModel(packageName, packageVersion) : InstallModel = let frameworks = - [ for x, p in FrameworkVersion.KnownDotNetFrameworks -> DotNetFramework(x, p) ] + [ for x in FrameworkVersion.KnownDotNetFrameworks -> DotNetFramework(x) ] { PackageName = packageName PackageVersion = packageVersion Fallbacks = Map.empty @@ -100,14 +100,14 @@ type InstallModel = member this.UseLowerVersionLibIfEmpty() = FrameworkVersion.KnownDotNetFrameworks |> List.rev - |> List.fold (fun (model : InstallModel) (lowerVersion,lowerProfile) -> - let newFiles = model.GetReferences(DotNetFramework(lowerVersion, lowerProfile)) + |> List.fold (fun (model : InstallModel) (lowerVersion) -> + let newFiles = model.GetReferences(DotNetFramework(lowerVersion)) if Set.isEmpty newFiles then model else FrameworkVersion.KnownDotNetFrameworks - |> List.filter (fun (version,profile) -> (version,profile) > (lowerVersion,lowerProfile)) - |> List.fold (fun (model : InstallModel) (upperVersion,upperProfile) -> - let framework = DotNetFramework(upperVersion, upperProfile) + |> List.filter (fun (version) -> (version) > (lowerVersion)) + |> List.fold (fun (model : InstallModel) (upperVersion) -> + let framework = DotNetFramework(upperVersion) match Map.tryFind framework model.Frameworks with | Some files when Set.isEmpty files.References -> { model with Frameworks = Map.add framework { References = newFiles; ContentFiles = Set.empty } model.Frameworks } diff --git a/tests/Paket.Tests/InstallModel/NuspecSpecs.fs b/tests/Paket.Tests/InstallModel/NuspecSpecs.fs index 93e065b779..6c67afde0c 100644 --- a/tests/Paket.Tests/InstallModel/NuspecSpecs.fs +++ b/tests/Paket.Tests/InstallModel/NuspecSpecs.fs @@ -38,8 +38,8 @@ let ``if nuspec is not found we assume no framework references``() = let ``can detect framework assemblies for Microsoft.Net.Http``() = Nuspec.Load("TestFiles/Microsoft.Net.Http.nuspec").FrameworkAssemblyReferences |> shouldEqual - [{ AssemblyName = "System.Net.Http"; TargetFramework = DotNetFramework(FrameworkVersion.V4_5,Full) } - { AssemblyName = "System.Net.Http.WebRequest"; TargetFramework = DotNetFramework(FrameworkVersion.V4_5,Full) } + [{ AssemblyName = "System.Net.Http"; TargetFramework = DotNetFramework(FrameworkVersion.V4_5) } + { AssemblyName = "System.Net.Http.WebRequest"; TargetFramework = DotNetFramework(FrameworkVersion.V4_5) } { AssemblyName = "System.Net.Http"; TargetFramework = MonoTouch } { AssemblyName = "System.Net.Http"; TargetFramework = MonoAndroid } ] @@ -47,4 +47,4 @@ let ``can detect framework assemblies for Microsoft.Net.Http``() = let ``can detect framework assemblies for Octokit``() = Nuspec.Load("TestFiles/Octokit.nuspec").FrameworkAssemblyReferences |> shouldEqual - [{ AssemblyName = "System.Net.Http"; TargetFramework = DotNetFramework(FrameworkVersion.V4_5,Full) }] \ No newline at end of file + [{ AssemblyName = "System.Net.Http"; TargetFramework = DotNetFramework(FrameworkVersion.V4_5) }] \ No newline at end of file diff --git a/tests/Paket.Tests/InstallModel/ProcessingSpecs.fs b/tests/Paket.Tests/InstallModel/ProcessingSpecs.fs index f62d8b8113..a0e57adc0f 100644 --- a/tests/Paket.Tests/InstallModel/ProcessingSpecs.fs +++ b/tests/Paket.Tests/InstallModel/ProcessingSpecs.fs @@ -10,15 +10,15 @@ let emptymodel = InstallModel.EmptyModel("Unknown",SemVer.Parse "0.1") let ``should create empty model with net40, net45 ...``() = let model = emptymodel.AddReferences [ @"..\Rx-Main\lib\net40\Rx.dll"; @"..\Rx-Main\lib\net45\Rx.dll" ] - model.GetFrameworks() |> shouldContain (DotNetFramework(FrameworkVersion.V4, Full)) - model.GetFrameworks() |> shouldContain (DotNetFramework(FrameworkVersion.V4_5, Full)) + model.GetFrameworks() |> shouldContain (DotNetFramework(FrameworkVersion.V4)) + model.GetFrameworks() |> shouldContain (DotNetFramework(FrameworkVersion.V4_5)) [] let ``should understand net40 and net45``() = let model = emptymodel.AddReferences [ @"..\Rx-Main\lib\net40\Rx.dll"; @"..\Rx-Main\lib\net45\Rx.dll" ] - model.GetFiles(DotNetFramework(FrameworkVersion.V4, Full)) |> shouldContain @"..\Rx-Main\lib\net40\Rx.dll" - model.GetFiles(DotNetFramework(FrameworkVersion.V4_5, Full)) |> shouldContain @"..\Rx-Main\lib\net45\Rx.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4)) |> shouldContain @"..\Rx-Main\lib\net40\Rx.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4_5)) |> shouldContain @"..\Rx-Main\lib\net45\Rx.dll" [] let ``should add net35 if we have net20 and net40``() = @@ -26,19 +26,19 @@ let ``should add net35 if we have net20 and net40``() = emptymodel.AddReferences([ @"..\Rx-Main\lib\net20\Rx.dll"; @"..\Rx-Main\lib\net40\Rx.dll" ]) .UseLowerVersionLibIfEmpty() - model.GetFiles(DotNetFramework(FrameworkVersion.V2, Full)) |> shouldContain @"..\Rx-Main\lib\net20\Rx.dll" - model.GetFiles(DotNetFramework(FrameworkVersion.V3_5, Full)) |> shouldContain @"..\Rx-Main\lib\net20\Rx.dll" - model.GetFiles(DotNetFramework(FrameworkVersion.V4, Full)) |> shouldContain @"..\Rx-Main\lib\net40\Rx.dll" - model.GetFiles(DotNetFramework(FrameworkVersion.V4, Full)) |> shouldNotContain @"..\Rx-Main\lib\net20\Rx.dll" - model.GetFiles(DotNetFramework(FrameworkVersion.V4_5, Full)) |> shouldContain @"..\Rx-Main\lib\net40\Rx.dll" - model.GetFiles(DotNetFramework(FrameworkVersion.V4_5_1, Full)) |> shouldContain @"..\Rx-Main\lib\net40\Rx.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V2)) |> shouldContain @"..\Rx-Main\lib\net20\Rx.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V3_5)) |> shouldContain @"..\Rx-Main\lib\net20\Rx.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4)) |> shouldContain @"..\Rx-Main\lib\net40\Rx.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4)) |> shouldNotContain @"..\Rx-Main\lib\net20\Rx.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4_5)) |> shouldContain @"..\Rx-Main\lib\net40\Rx.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4_5_1)) |> shouldContain @"..\Rx-Main\lib\net40\Rx.dll" [] let ``should put _._ files into right buckets``() = let model = emptymodel.AddReferences [ @"..\Rx-Main\lib\net40\_._"; @"..\Rx-Main\lib\net20\_._" ] - model.GetFiles(DotNetFramework(FrameworkVersion.V2, Full)) |> shouldContain @"..\Rx-Main\lib\net20\_._" - model.GetFiles(DotNetFramework(FrameworkVersion.V4, Full)) |> shouldContain @"..\Rx-Main\lib\net40\_._" + model.GetFiles(DotNetFramework(FrameworkVersion.V2)) |> shouldContain @"..\Rx-Main\lib\net20\_._" + model.GetFiles(DotNetFramework(FrameworkVersion.V4)) |> shouldContain @"..\Rx-Main\lib\net40\_._" [] let ``should inherit _._ files to higher frameworks``() = @@ -46,11 +46,11 @@ let ``should inherit _._ files to higher frameworks``() = emptymodel.AddReferences([ @"..\Rx-Main\lib\net40\_._"; @"..\Rx-Main\lib\net20\_._" ]) .UseLowerVersionLibIfEmpty() - model.GetFiles(DotNetFramework(FrameworkVersion.V2, Full)) |> shouldContain @"..\Rx-Main\lib\net20\_._" - model.GetFiles(DotNetFramework(FrameworkVersion.V3_5, Full)) |> shouldContain @"..\Rx-Main\lib\net20\_._" - model.GetFiles(DotNetFramework(FrameworkVersion.V4, Full)) |> shouldContain @"..\Rx-Main\lib\net40\_._" - model.GetFiles(DotNetFramework(FrameworkVersion.V4_5, Full)) |> shouldContain @"..\Rx-Main\lib\net40\_._" - model.GetFiles(DotNetFramework(FrameworkVersion.V4_5_1, Full)) |> shouldContain @"..\Rx-Main\lib\net40\_._" + model.GetFiles(DotNetFramework(FrameworkVersion.V2)) |> shouldContain @"..\Rx-Main\lib\net20\_._" + model.GetFiles(DotNetFramework(FrameworkVersion.V3_5)) |> shouldContain @"..\Rx-Main\lib\net20\_._" + model.GetFiles(DotNetFramework(FrameworkVersion.V4)) |> shouldContain @"..\Rx-Main\lib\net40\_._" + model.GetFiles(DotNetFramework(FrameworkVersion.V4_5)) |> shouldContain @"..\Rx-Main\lib\net40\_._" + model.GetFiles(DotNetFramework(FrameworkVersion.V4_5_1)) |> shouldContain @"..\Rx-Main\lib\net40\_._" [] @@ -59,10 +59,10 @@ let ``should skip buckets which contain placeholder while adjusting upper versio emptymodel.AddReferences([ @"..\Rx-Main\lib\net20\Rx.dll"; @"..\Rx-Main\lib\net40\_._"; ]) .UseLowerVersionLibIfEmpty() - model.GetFiles(DotNetFramework(FrameworkVersion.V2, Full)) |> shouldContain @"..\Rx-Main\lib\net20\Rx.dll" - model.GetFiles(DotNetFramework(FrameworkVersion.V3_5, Full)) |> shouldContain @"..\Rx-Main\lib\net20\Rx.dll" - model.GetFiles(DotNetFramework(FrameworkVersion.V4, Full)) |> shouldNotContain @"..\Rx-Main\lib\net20\Rx.dll" - model.GetFiles(DotNetFramework(FrameworkVersion.V4_5, Full)) |> shouldNotContain @"..\Rx-Main\lib\net20\Rx.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V2)) |> shouldContain @"..\Rx-Main\lib\net20\Rx.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V3_5)) |> shouldContain @"..\Rx-Main\lib\net20\Rx.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4)) |> shouldNotContain @"..\Rx-Main\lib\net20\Rx.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4_5)) |> shouldNotContain @"..\Rx-Main\lib\net20\Rx.dll" [] let ``should filter _._ when processing blacklist``() = @@ -70,8 +70,8 @@ let ``should filter _._ when processing blacklist``() = emptymodel.AddReferences([ @"..\Rx-Main\lib\net40\_._"; @"..\Rx-Main\lib\net20\_._" ]) .FilterBlackList() - model.GetFiles(DotNetFramework(FrameworkVersion.V2, Full)) |> shouldNotContain @"..\Rx-Main\lib\net20\_._" - model.GetFiles(DotNetFramework(FrameworkVersion.V4, Full)) |> shouldNotContain @"..\Rx-Main\lib\net40\_._" + model.GetFiles(DotNetFramework(FrameworkVersion.V2)) |> shouldNotContain @"..\Rx-Main\lib\net20\_._" + model.GetFiles(DotNetFramework(FrameworkVersion.V4)) |> shouldNotContain @"..\Rx-Main\lib\net40\_._" [] let ``should install single client profile lib for everything``() = @@ -79,10 +79,10 @@ let ``should install single client profile lib for everything``() = emptymodel.AddReferences([ @"..\Castle.Core\lib\net40-client\Castle.Core.dll" ]) .UseLowerVersionLibIfEmpty() - model.GetFiles(DotNetFramework(FrameworkVersion.V3_5, Full)) |> shouldNotContain @"..\Castle.Core\lib\net40-client\Castle.Core.dll" - model.GetFiles(DotNetFramework(FrameworkVersion.V4, Client)) |> shouldContain @"..\Castle.Core\lib\net40-client\Castle.Core.dll" - model.GetFiles(DotNetFramework(FrameworkVersion.V4, Full)) |> shouldContain @"..\Castle.Core\lib\net40-client\Castle.Core.dll" - model.GetFiles(DotNetFramework(FrameworkVersion.V4_5, Full)) |> shouldContain @"..\Castle.Core\lib\net40-client\Castle.Core.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V3_5)) |> shouldNotContain @"..\Castle.Core\lib\net40-client\Castle.Core.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4_Client)) |> shouldContain @"..\Castle.Core\lib\net40-client\Castle.Core.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4)) |> shouldContain @"..\Castle.Core\lib\net40-client\Castle.Core.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4_5)) |> shouldContain @"..\Castle.Core\lib\net40-client\Castle.Core.dll" [] let ``should handle lib install of Microsoft.Net.Http for .NET 4.5``() = @@ -97,14 +97,14 @@ let ``should handle lib install of Microsoft.Net.Http for .NET 4.5``() = @"..\Microsoft.Net.Http\lib\net45\System.Net.Http.Primitives.dll" ]) .UseLowerVersionLibIfEmpty() - model.GetFiles(DotNetFramework(FrameworkVersion.V3_5, Full)) |> shouldNotContain @"..\Microsoft.Net.Http\lib\net40\System.Net.Http.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V3_5)) |> shouldNotContain @"..\Microsoft.Net.Http\lib\net40\System.Net.Http.dll" - model.GetFiles(DotNetFramework(FrameworkVersion.V4, Full)) |> shouldContain @"..\Microsoft.Net.Http\lib\net40\System.Net.Http.dll" - model.GetFiles(DotNetFramework(FrameworkVersion.V4, Full)) |> shouldContain @"..\Microsoft.Net.Http\lib\net40\System.Net.Http.Primitives.dll" - model.GetFiles(DotNetFramework(FrameworkVersion.V4, Full)) |> shouldContain @"..\Microsoft.Net.Http\lib\net40\System.Net.Http.WebRequest.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4)) |> shouldContain @"..\Microsoft.Net.Http\lib\net40\System.Net.Http.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4)) |> shouldContain @"..\Microsoft.Net.Http\lib\net40\System.Net.Http.Primitives.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4)) |> shouldContain @"..\Microsoft.Net.Http\lib\net40\System.Net.Http.WebRequest.dll" - model.GetFiles(DotNetFramework(FrameworkVersion.V4_5, Full)) |> shouldNotContain @"..\Microsoft.Net.Http\lib\net40\System.Net.Http.dll" - model.GetFiles(DotNetFramework(FrameworkVersion.V4_5, Full)) |> shouldContain @"..\Microsoft.Net.Http\lib\net45\System.Net.Http.Primitives.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4_5)) |> shouldNotContain @"..\Microsoft.Net.Http\lib\net40\System.Net.Http.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4_5)) |> shouldContain @"..\Microsoft.Net.Http\lib\net45\System.Net.Http.Primitives.dll" [] let ``should handle lib install of Jint for NET >= 40 and SL >= 50``() = @@ -114,9 +114,9 @@ let ``should handle lib install of Jint for NET >= 40 and SL >= 50``() = model.GetFiles(PortableFramework("7.0", "net40+sl50+win+wp80")) |> shouldContain @"..\Jint\lib\portable-net40+sl50+win+wp80\Jint.dll" - model.GetFiles(DotNetFramework(FrameworkVersion.V3_5, Full)) |> shouldNotContain @"..\Jint\lib\portable-net40+sl50+win+wp80\Jint.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V3_5)) |> shouldNotContain @"..\Jint\lib\portable-net40+sl50+win+wp80\Jint.dll" - model.GetFiles(DotNetFramework(FrameworkVersion.V4, Full)) |> shouldContain @"..\Jint\lib\portable-net40+sl50+win+wp80\Jint.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4)) |> shouldContain @"..\Jint\lib\portable-net40+sl50+win+wp80\Jint.dll" model.GetFiles(Silverlight("v5.0")) |> shouldContain @"..\Jint\lib\portable-net40+sl50+win+wp80\Jint.dll" @@ -131,14 +131,14 @@ let ``should handle lib install of Microsoft.BCL for NET >= 40``() = @"..\Microsoft.Bcl\lib\net45\_._" ]) .Process() - model.GetFiles(DotNetFramework(FrameworkVersion.V3_5, Full)) |> shouldNotContain @"..\Microsoft.Bcl\lib\net40\System.IO.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V3_5)) |> shouldNotContain @"..\Microsoft.Bcl\lib\net40\System.IO.dll" - model.GetFiles(DotNetFramework(FrameworkVersion.V4, Full)) |> shouldContain @"..\Microsoft.Bcl\lib\net40\System.IO.dll" - model.GetFiles(DotNetFramework(FrameworkVersion.V4, Full)) |> shouldContain @"..\Microsoft.Bcl\lib\net40\System.Runtime.dll" - model.GetFiles(DotNetFramework(FrameworkVersion.V4, Full)) |> shouldContain @"..\Microsoft.Bcl\lib\net40\System.Threading.Tasks.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4)) |> shouldContain @"..\Microsoft.Bcl\lib\net40\System.IO.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4)) |> shouldContain @"..\Microsoft.Bcl\lib\net40\System.Runtime.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4)) |> shouldContain @"..\Microsoft.Bcl\lib\net40\System.Threading.Tasks.dll" - model.GetFiles(DotNetFramework(FrameworkVersion.V4_5, Full)) |> shouldBeEmpty - model.GetFiles(DotNetFramework(FrameworkVersion.V4_5_1, Full)) |> shouldBeEmpty + model.GetFiles(DotNetFramework(FrameworkVersion.V4_5)) |> shouldBeEmpty + model.GetFiles(DotNetFramework(FrameworkVersion.V4_5_1)) |> shouldBeEmpty [] @@ -168,9 +168,9 @@ let ``should not use portable-net40 if we have net40``() = @"..\Microsoft.Bcl\lib\portable-net40+sl4+win8\System.Runtime.dll" @"..\Microsoft.Bcl\lib\portable-net40+sl4+win8\System.Threading.Tasks.dll" ]) - model.GetFiles(DotNetFramework(FrameworkVersion.V4, Full)) |> shouldContain @"..\Microsoft.Bcl\lib\net40\System.IO.dll" - model.GetFiles(DotNetFramework(FrameworkVersion.V4, Full)) |> shouldContain @"..\Microsoft.Bcl\lib\net40\System.Runtime.dll" - model.GetFiles(DotNetFramework(FrameworkVersion.V4, Full)) |> shouldContain @"..\Microsoft.Bcl\lib\net40\System.Threading.Tasks.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4)) |> shouldContain @"..\Microsoft.Bcl\lib\net40\System.IO.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4)) |> shouldContain @"..\Microsoft.Bcl\lib\net40\System.Runtime.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4)) |> shouldContain @"..\Microsoft.Bcl\lib\net40\System.Threading.Tasks.dll" model.GetFiles(PortableFramework("7.0", "net40+sl4+win8")) |> shouldContain @"..\Microsoft.Bcl\lib\portable-net40+sl4+win8\System.IO.dll" model.GetFiles(PortableFramework("7.0", "net40+sl4+win8")) |> shouldContain @"..\Microsoft.Bcl\lib\portable-net40+sl4+win8\System.Runtime.dll" @@ -180,10 +180,10 @@ let ``should not use portable-net40 if we have net40``() = let ``should handle lib install of DotNetZip 1.9.3``() = let model = emptymodel.AddReferences([ @"..\DotNetZip\lib\net20\Ionic.Zip.dll" ]).Process() - model.GetFiles(DotNetFramework(FrameworkVersion.V2, Full)) |> shouldContain @"..\DotNetZip\lib\net20\Ionic.Zip.dll" - model.GetFiles(DotNetFramework(FrameworkVersion.V3_5, Full)) |> shouldContain @"..\DotNetZip\lib\net20\Ionic.Zip.dll" - model.GetFiles(DotNetFramework(FrameworkVersion.V4, Full)) |> shouldContain @"..\DotNetZip\lib\net20\Ionic.Zip.dll" - model.GetFiles(DotNetFramework(FrameworkVersion.V4_5, Full)) |> shouldContain @"..\DotNetZip\lib\net20\Ionic.Zip.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V2)) |> shouldContain @"..\DotNetZip\lib\net20\Ionic.Zip.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V3_5)) |> shouldContain @"..\DotNetZip\lib\net20\Ionic.Zip.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4)) |> shouldContain @"..\DotNetZip\lib\net20\Ionic.Zip.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4_5)) |> shouldContain @"..\DotNetZip\lib\net20\Ionic.Zip.dll" [] @@ -218,11 +218,11 @@ let ``should handle lib install of Microsoft.Net.Http 2.2.28``() = @"..\Microsoft.Net.Http\lib\wpa81\System.Net.Http.Primitives.dll" ]) .Process() - model.GetFiles(DotNetFramework(FrameworkVersion.V3_5, Full)) |> shouldNotContain @"..\Microsoft.Net.Http\lib\net40\System.Net.Http.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V3_5)) |> shouldNotContain @"..\Microsoft.Net.Http\lib\net40\System.Net.Http.dll" - model.GetFiles(DotNetFramework(FrameworkVersion.V4, Full)) |> shouldContain @"..\Microsoft.Net.Http\lib\net40\System.Net.Http.dll" - model.GetFiles(DotNetFramework(FrameworkVersion.V4, Full)) |> shouldContain @"..\Microsoft.Net.Http\lib\net40\System.Net.Http.Primitives.dll" - model.GetFiles(DotNetFramework(FrameworkVersion.V4, Full)) |> shouldContain @"..\Microsoft.Net.Http\lib\net40\System.Net.Http.WebRequest.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4)) |> shouldContain @"..\Microsoft.Net.Http\lib\net40\System.Net.Http.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4)) |> shouldContain @"..\Microsoft.Net.Http\lib\net40\System.Net.Http.Primitives.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4)) |> shouldContain @"..\Microsoft.Net.Http\lib\net40\System.Net.Http.WebRequest.dll" model.GetFiles(MonoAndroid) |> shouldContain @"..\Microsoft.Net.Http\lib\monoandroid\System.Net.Http.Extensions.dll" model.GetFiles(MonoAndroid) |> shouldContain @"..\Microsoft.Net.Http\lib\monoandroid\System.Net.Http.Primitives.dll" @@ -230,11 +230,11 @@ let ``should handle lib install of Microsoft.Net.Http 2.2.28``() = model.GetFiles(MonoTouch) |> shouldContain @"..\Microsoft.Net.Http\lib\monotouch\System.Net.Http.Extensions.dll" model.GetFiles(MonoTouch) |> shouldContain @"..\Microsoft.Net.Http\lib\monotouch\System.Net.Http.Primitives.dll" - model.GetFiles(DotNetFramework(FrameworkVersion.V4_5, Full)) |> shouldNotContain @"..\Microsoft.Net.Http\lib\net40\System.Net.Http.dll" - model.GetFiles(DotNetFramework(FrameworkVersion.V4_5, Full)) |> shouldContain @"..\Microsoft.Net.Http\lib\net45\System.Net.Http.Primitives.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4_5)) |> shouldNotContain @"..\Microsoft.Net.Http\lib\net40\System.Net.Http.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4_5)) |> shouldContain @"..\Microsoft.Net.Http\lib\net45\System.Net.Http.Primitives.dll" - model.GetFiles(DotNetFramework(FrameworkVersion.V4_5, Full)) |> shouldNotContain @"..\Microsoft.Net.Http\lib\net40\System.Net.Http.dll" - model.GetFiles(DotNetFramework(FrameworkVersion.V4_5, Full)) |> shouldContain @"..\Microsoft.Net.Http\lib\net45\System.Net.Http.Primitives.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4_5)) |> shouldNotContain @"..\Microsoft.Net.Http\lib\net40\System.Net.Http.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4_5)) |> shouldContain @"..\Microsoft.Net.Http\lib\net45\System.Net.Http.Primitives.dll" model.GetFiles(PortableFramework("7.0", "net40+sl4+win8+wp71+wpa81")) |> shouldContain @"..\Microsoft.Net.Http\lib\portable-net40+sl4+win8+wp71+wpa81\System.Net.Http.dll" model.GetFiles(PortableFramework("7.0", "net40+sl4+win8+wp71+wpa81")) |> shouldContain @"..\Microsoft.Net.Http\lib\portable-net40+sl4+win8+wp71+wpa81\System.Net.Http.Extensions.dll" @@ -288,11 +288,11 @@ let ``should handle lib install of Microsoft.Bcl 1.1.9``() = ]) .Process() - model.GetFiles(DotNetFramework(FrameworkVersion.V4, Full)) |> shouldContain @"..\Microsoft.Bcl\lib\net40\System.IO.dll" - model.GetFiles(DotNetFramework(FrameworkVersion.V4, Full)) |> shouldContain @"..\Microsoft.Bcl\lib\net40\System.Runtime.dll" - model.GetFiles(DotNetFramework(FrameworkVersion.V4, Full)) |> shouldContain @"..\Microsoft.Bcl\lib\net40\System.Threading.Tasks.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4)) |> shouldContain @"..\Microsoft.Bcl\lib\net40\System.IO.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4)) |> shouldContain @"..\Microsoft.Bcl\lib\net40\System.Runtime.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4)) |> shouldContain @"..\Microsoft.Bcl\lib\net40\System.Threading.Tasks.dll" - model.GetFiles(DotNetFramework(FrameworkVersion.V4_5, Full)) |> shouldBeEmpty + model.GetFiles(DotNetFramework(FrameworkVersion.V4_5)) |> shouldBeEmpty model.GetFiles(MonoAndroid) |> shouldBeEmpty model.GetFiles(MonoTouch) |> shouldBeEmpty model.GetFiles(Windows "v8.0") |> shouldBeEmpty @@ -327,17 +327,17 @@ let ``should handle lib install of Fantomas 1.5``() = @"..\Fantomas\lib\Fantomas.exe" ]) .Process() - model.GetFiles(DotNetFramework(FrameworkVersion.V2, Full)) |> shouldContain @"..\Fantomas\lib\FantomasLib.dll" - model.GetFiles(DotNetFramework(FrameworkVersion.V2, Full)) |> shouldContain @"..\Fantomas\lib\FSharp.Core.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V2)) |> shouldContain @"..\Fantomas\lib\FantomasLib.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V2)) |> shouldContain @"..\Fantomas\lib\FSharp.Core.dll" - model.GetFiles(DotNetFramework(FrameworkVersion.V3_5, Full)) |> shouldContain @"..\Fantomas\lib\FantomasLib.dll" - model.GetFiles(DotNetFramework(FrameworkVersion.V3_5, Full)) |> shouldContain @"..\Fantomas\lib\FSharp.Core.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V3_5)) |> shouldContain @"..\Fantomas\lib\FantomasLib.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V3_5)) |> shouldContain @"..\Fantomas\lib\FSharp.Core.dll" - model.GetFiles(DotNetFramework(FrameworkVersion.V4, Full)) |> shouldContain @"..\Fantomas\lib\FantomasLib.dll" - model.GetFiles(DotNetFramework(FrameworkVersion.V4, Full)) |> shouldContain @"..\Fantomas\lib\FSharp.Core.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4)) |> shouldContain @"..\Fantomas\lib\FantomasLib.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4)) |> shouldContain @"..\Fantomas\lib\FSharp.Core.dll" - model.GetFiles(DotNetFramework(FrameworkVersion.V4_5, Full)) |> shouldContain @"..\Fantomas\lib\FantomasLib.dll" - model.GetFiles(DotNetFramework(FrameworkVersion.V4_5, Full)) |> shouldContain @"..\Fantomas\lib\FSharp.Core.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4_5)) |> shouldContain @"..\Fantomas\lib\FantomasLib.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4_5)) |> shouldContain @"..\Fantomas\lib\FSharp.Core.dll" [] let ``should handle lib install of Fantomas 1.5.0 with explicit references``() = @@ -348,17 +348,17 @@ let ``should handle lib install of Fantomas 1.5.0 with explicit references``() = @"..\Fantomas\lib\Fantomas.exe" ], NuspecReferences.Explicit ["FantomasLib.dll"]) .Process() - model.GetFiles(DotNetFramework(FrameworkVersion.V2, Full)) |> shouldContain @"..\Fantomas\lib\FantomasLib.dll" - model.GetFiles(DotNetFramework(FrameworkVersion.V2, Full)) |> shouldNotContain @"..\Fantomas\lib\FSharp.Core.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V2)) |> shouldContain @"..\Fantomas\lib\FantomasLib.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V2)) |> shouldNotContain @"..\Fantomas\lib\FSharp.Core.dll" - model.GetFiles(DotNetFramework(FrameworkVersion.V3_5, Full)) |> shouldContain @"..\Fantomas\lib\FantomasLib.dll" - model.GetFiles(DotNetFramework(FrameworkVersion.V3_5, Full)) |> shouldNotContain @"..\Fantomas\lib\FSharp.Core.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V3_5)) |> shouldContain @"..\Fantomas\lib\FantomasLib.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V3_5)) |> shouldNotContain @"..\Fantomas\lib\FSharp.Core.dll" - model.GetFiles(DotNetFramework(FrameworkVersion.V4, Full)) |> shouldContain @"..\Fantomas\lib\FantomasLib.dll" - model.GetFiles(DotNetFramework(FrameworkVersion.V4, Full)) |> shouldNotContain @"..\Fantomas\lib\FSharp.Core.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4)) |> shouldContain @"..\Fantomas\lib\FantomasLib.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4)) |> shouldNotContain @"..\Fantomas\lib\FSharp.Core.dll" - model.GetFiles(DotNetFramework(FrameworkVersion.V4_5, Full)) |> shouldContain @"..\Fantomas\lib\FantomasLib.dll" - model.GetFiles(DotNetFramework(FrameworkVersion.V4_5, Full)) |> shouldNotContain @"..\Fantomas\lib\FSharp.Core.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4_5)) |> shouldContain @"..\Fantomas\lib\FantomasLib.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4_5)) |> shouldNotContain @"..\Fantomas\lib\FSharp.Core.dll" [] @@ -371,10 +371,10 @@ let ``should only handle dll and exe files``() = @"..\Fantomas\lib\Fantomas.exe" ], NuspecReferences.All) .Process() - model.GetFiles(DotNetFramework(FrameworkVersion.V2, Full)) |> shouldContain @"..\Fantomas\lib\FantomasLib.dll" - model.GetFiles(DotNetFramework(FrameworkVersion.V2, Full)) |> shouldContain @"..\Fantomas\lib\FSharp.Core.dll" - model.GetFiles(DotNetFramework(FrameworkVersion.V2, Full)) |> shouldContain @"..\Fantomas\lib\Fantomas.exe" - model.GetFiles(DotNetFramework(FrameworkVersion.V2, Full)) |> shouldNotContain @"..\Fantomas\lib\FantomasLib.xml" + model.GetFiles(DotNetFramework(FrameworkVersion.V2)) |> shouldContain @"..\Fantomas\lib\FantomasLib.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V2)) |> shouldContain @"..\Fantomas\lib\FSharp.Core.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V2)) |> shouldContain @"..\Fantomas\lib\Fantomas.exe" + model.GetFiles(DotNetFramework(FrameworkVersion.V2)) |> shouldNotContain @"..\Fantomas\lib\FantomasLib.xml" [] let ``should use portable net40 in net45 when don't have other files``() = @@ -383,11 +383,11 @@ let ``should use portable net40 in net45 when don't have other files``() = [ @"..\Google.Apis.Core\lib\portable-net40+sl50+win+wpa81+wp80\Google.Apis.Core.dll" ], NuspecReferences.All) .Process() - model.GetFiles(DotNetFramework(FrameworkVersion.V4, Full)) |> shouldContain @"..\Google.Apis.Core\lib\portable-net40+sl50+win+wpa81+wp80\Google.Apis.Core.dll" - model.GetFiles(DotNetFramework(FrameworkVersion.V4_5, Full)) |> shouldContain @"..\Google.Apis.Core\lib\portable-net40+sl50+win+wpa81+wp80\Google.Apis.Core.dll" - model.GetFiles(DotNetFramework(FrameworkVersion.V4_5_1, Full)) |> shouldContain @"..\Google.Apis.Core\lib\portable-net40+sl50+win+wpa81+wp80\Google.Apis.Core.dll" - model.GetFiles(DotNetFramework(FrameworkVersion.V4_5_2, Full)) |> shouldContain @"..\Google.Apis.Core\lib\portable-net40+sl50+win+wpa81+wp80\Google.Apis.Core.dll" - model.GetFiles(DotNetFramework(FrameworkVersion.V4_5_3, Full)) |> shouldContain @"..\Google.Apis.Core\lib\portable-net40+sl50+win+wpa81+wp80\Google.Apis.Core.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4)) |> shouldContain @"..\Google.Apis.Core\lib\portable-net40+sl50+win+wpa81+wp80\Google.Apis.Core.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4_5)) |> shouldContain @"..\Google.Apis.Core\lib\portable-net40+sl50+win+wpa81+wp80\Google.Apis.Core.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4_5_1)) |> shouldContain @"..\Google.Apis.Core\lib\portable-net40+sl50+win+wpa81+wp80\Google.Apis.Core.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4_5_2)) |> shouldContain @"..\Google.Apis.Core\lib\portable-net40+sl50+win+wpa81+wp80\Google.Apis.Core.dll" + model.GetFiles(DotNetFramework(FrameworkVersion.V4_5_3)) |> shouldContain @"..\Google.Apis.Core\lib\portable-net40+sl50+win+wpa81+wp80\Google.Apis.Core.dll" [] let ``should not install tools``() = diff --git a/tests/Paket.Tests/InstallModel/Xml/SystemNetHttpWithFrameworkReferences.fs b/tests/Paket.Tests/InstallModel/Xml/SystemNetHttpWithFrameworkReferences.fs index dc27f28720..232743f7ef 100644 --- a/tests/Paket.Tests/InstallModel/Xml/SystemNetHttpWithFrameworkReferences.fs +++ b/tests/Paket.Tests/InstallModel/Xml/SystemNetHttpWithFrameworkReferences.fs @@ -85,8 +85,8 @@ let ``should generate Xml for System.Net.Http 2.2.8``() = @"..\Microsoft.Net.Http\lib\net45\System.Net.Http.Primitives.dll"], { References = NuspecReferences.All FrameworkAssemblyReferences = - [{ AssemblyName = "System.Net.Http"; TargetFramework = DotNetFramework(FrameworkVersion.V4_5,Full) } - { AssemblyName = "System.Net.Http.WebRequest"; TargetFramework = DotNetFramework(FrameworkVersion.V4_5,Full) }] }) + [{ AssemblyName = "System.Net.Http"; TargetFramework = DotNetFramework(FrameworkVersion.V4_5) } + { AssemblyName = "System.Net.Http.WebRequest"; TargetFramework = DotNetFramework(FrameworkVersion.V4_5) }] }) let chooseNode = ProjectFile.Load("./ProjectFile/TestData/Empty.fsprojtest").Value.GenerateXml(model) chooseNode.OuterXml diff --git a/tests/Paket.Tests/ProjectFile/ConditionSpecs.fs b/tests/Paket.Tests/ProjectFile/ConditionSpecs.fs index cbc21bbb3d..d3e8ec62d5 100644 --- a/tests/Paket.Tests/ProjectFile/ConditionSpecs.fs +++ b/tests/Paket.Tests/ProjectFile/ConditionSpecs.fs @@ -8,33 +8,33 @@ let element x = match x with | Some y -> y [] let ``should detect framework version from path``() = - FrameworkIdentifier.DetectFromPath(@"..\RestSharp\lib\net4\RestSharp.dll")|> element |> shouldEqual (DotNetFramework(FrameworkVersion.V4,Full)) - FrameworkIdentifier.DetectFromPath(@"..\Rx-Main\lib\net40\Rx.dll")|> element |> shouldEqual (DotNetFramework(FrameworkVersion.V4,Full)) - FrameworkIdentifier.DetectFromPath(@"..\Rx-Main\lib\net45\Rx.dll")|> element |> shouldEqual (DotNetFramework(FrameworkVersion.V4_5,Full)) - FrameworkIdentifier.DetectFromPath(@"..\Rx-Main\lib\net20\Rx.dll")|> element |> shouldEqual (DotNetFramework(FrameworkVersion.V2,Full)) - FrameworkIdentifier.DetectFromPath(@"..\Rx-Main\lib\net35\Rx.dll")|> element |> shouldEqual (DotNetFramework(FrameworkVersion.V3_5,Full)) - FrameworkIdentifier.DetectFromPath("../Rx-Main/lib/net35/Rx.dll")|> element |> shouldEqual (DotNetFramework(FrameworkVersion.V3_5,Full)) - FrameworkIdentifier.DetectFromPath(@"..\NUnit\lib\NUnit.dll")|> element |> shouldEqual (DotNetFramework(FrameworkVersion.V1,Full)) - FrameworkIdentifier.DetectFromPath("../NUnit/lib/NUnit.dll")|> element |> shouldEqual (DotNetFramework(FrameworkVersion.V1,Full)) + FrameworkIdentifier.DetectFromPath(@"..\RestSharp\lib\net4\RestSharp.dll")|> element |> shouldEqual (DotNetFramework(FrameworkVersion.V4)) + FrameworkIdentifier.DetectFromPath(@"..\Rx-Main\lib\net40\Rx.dll")|> element |> shouldEqual (DotNetFramework(FrameworkVersion.V4)) + FrameworkIdentifier.DetectFromPath(@"..\Rx-Main\lib\net45\Rx.dll")|> element |> shouldEqual (DotNetFramework(FrameworkVersion.V4_5)) + FrameworkIdentifier.DetectFromPath(@"..\Rx-Main\lib\net20\Rx.dll")|> element |> shouldEqual (DotNetFramework(FrameworkVersion.V2)) + FrameworkIdentifier.DetectFromPath(@"..\Rx-Main\lib\net35\Rx.dll")|> element |> shouldEqual (DotNetFramework(FrameworkVersion.V3_5)) + FrameworkIdentifier.DetectFromPath("../Rx-Main/lib/net35/Rx.dll")|> element |> shouldEqual (DotNetFramework(FrameworkVersion.V3_5)) + FrameworkIdentifier.DetectFromPath(@"..\NUnit\lib\NUnit.dll")|> element |> shouldEqual (DotNetFramework(FrameworkVersion.V1)) + FrameworkIdentifier.DetectFromPath("../NUnit/lib/NUnit.dll")|> element |> shouldEqual (DotNetFramework(FrameworkVersion.V1)) [] let ``should detect CLR version from path``() = - FrameworkIdentifier.DetectFromPath(@"..\Rx-log4net\lib\1.0\log4net.dll")|> element |> shouldEqual (DotNetFramework(FrameworkVersion.V1,Full)) - FrameworkIdentifier.DetectFromPath(@"..\Rx-log4net\lib\1.1\log4net.dll")|> element |> shouldEqual (DotNetFramework(FrameworkVersion.V1_1,Full)) - FrameworkIdentifier.DetectFromPath(@"..\Rx-log4net\lib\2.0\log4net.dll")|> element |> shouldEqual (DotNetFramework(FrameworkVersion.V2,Full)) + FrameworkIdentifier.DetectFromPath(@"..\Rx-log4net\lib\1.0\log4net.dll")|> element |> shouldEqual (DotNetFramework(FrameworkVersion.V1)) + FrameworkIdentifier.DetectFromPath(@"..\Rx-log4net\lib\1.1\log4net.dll")|> element |> shouldEqual (DotNetFramework(FrameworkVersion.V1_1)) + FrameworkIdentifier.DetectFromPath(@"..\Rx-log4net\lib\2.0\log4net.dll")|> element |> shouldEqual (DotNetFramework(FrameworkVersion.V2)) [] let ``should detect client framework version from path``() = - FrameworkIdentifier.DetectFromPath(@"..\packages\Castle.Core\lib\net40-client\Castle.Core.dll")|> element |> shouldEqual (DotNetFramework(FrameworkVersion.V4,Client)) + FrameworkIdentifier.DetectFromPath(@"..\packages\Castle.Core\lib\net40-client\Castle.Core.dll")|> element |> shouldEqual (DotNetFramework(FrameworkVersion.V4_Client)) [] let ``should detect net40-full as net40``() = - FrameworkIdentifier.DetectFromPath(@"..\packages\log4net\lib\net40-full\log4net.dll")|> element |> shouldEqual(DotNetFramework(FrameworkVersion.V4,Full)) - FrameworkIdentifier.DetectFromPath(@"..\packages\log4net\lib\net40\log4net.dll")|> element |> shouldEqual (DotNetFramework(FrameworkVersion.V4,Full)) + FrameworkIdentifier.DetectFromPath(@"..\packages\log4net\lib\net40-full\log4net.dll")|> element |> shouldEqual(DotNetFramework(FrameworkVersion.V4)) + FrameworkIdentifier.DetectFromPath(@"..\packages\log4net\lib\net40\log4net.dll")|> element |> shouldEqual (DotNetFramework(FrameworkVersion.V4)) [] let ``should detect net451``() = - FrameworkIdentifier.DetectFromPath(@"..\Rx-Main\lib\net451\Rx.dll")|> element |> shouldEqual (DotNetFramework(FrameworkVersion.V4_5_1,Full)) + FrameworkIdentifier.DetectFromPath(@"..\Rx-Main\lib\net451\Rx.dll")|> element |> shouldEqual (DotNetFramework(FrameworkVersion.V4_5_1)) [] let ``should detect Silverlight version from path``() = @@ -49,21 +49,21 @@ let ``should detect WindowsPhone version from path``() = [] let ``should detect framework version from uppercase path``() = - FrameworkIdentifier.DetectFromPath(@"..\packages\GitVersion.1.2.0\Lib\Net45\GitVersionCore.dll")|> element |> shouldEqual (DotNetFramework(FrameworkVersion.V4_5,Full)) + FrameworkIdentifier.DetectFromPath(@"..\packages\GitVersion.1.2.0\Lib\Net45\GitVersionCore.dll")|> element |> shouldEqual (DotNetFramework(FrameworkVersion.V4_5)) [] let ``should detect net45-full``() = - FrameworkIdentifier.DetectFromPath(@"..\packages\Ninject\lib\net45-full\Ninject.dll")|> element |> shouldEqual (DotNetFramework(FrameworkVersion.V4_5,Full)) + FrameworkIdentifier.DetectFromPath(@"..\packages\Ninject\lib\net45-full\Ninject.dll")|> element |> shouldEqual (DotNetFramework(FrameworkVersion.V4_5)) [] let ``should detect net``() = - FrameworkIdentifier.DetectFromPath(@"..\packages\RhinoMocks\lib\net\Rhino.Mocks.dll")|> element |> shouldEqual (DotNetFramework(FrameworkVersion.V2,Full)) + FrameworkIdentifier.DetectFromPath(@"..\packages\RhinoMocks\lib\net\Rhino.Mocks.dll")|> element |> shouldEqual (DotNetFramework(FrameworkVersion.V2)) [] let ``should detect 35, 40 and 45``() = - FrameworkIdentifier.DetectFromPath(@"..\packages\FSharpx.Core\lib\35\FSharp.Core.dll")|> element |> shouldEqual (DotNetFramework(FrameworkVersion.V3_5,Full)) - FrameworkIdentifier.DetectFromPath(@"..\packages\FSharpx.Core\lib\40\FSharp.Core.dll")|> element |> shouldEqual (DotNetFramework(FrameworkVersion.V4,Full)) - FrameworkIdentifier.DetectFromPath(@"..\packages\FSharpx.Core\lib\45\FSharp.Core.dll")|> element |> shouldEqual (DotNetFramework(FrameworkVersion.V4_5,Full)) + FrameworkIdentifier.DetectFromPath(@"..\packages\FSharpx.Core\lib\35\FSharp.Core.dll")|> element |> shouldEqual (DotNetFramework(FrameworkVersion.V3_5)) + FrameworkIdentifier.DetectFromPath(@"..\packages\FSharpx.Core\lib\40\FSharp.Core.dll")|> element |> shouldEqual (DotNetFramework(FrameworkVersion.V4)) + FrameworkIdentifier.DetectFromPath(@"..\packages\FSharpx.Core\lib\45\FSharp.Core.dll")|> element |> shouldEqual (DotNetFramework(FrameworkVersion.V4_5)) []