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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ let mutable dotnetExePath = "dotnet"

let buildDir = "bin"
let buildDirNet461 = buildDir @@ "net461"
let buildDirNetCore = buildDir @@ "netcoreapp2.1"
let buildDirNetCore = buildDir @@ "netcoreapp3.1"
let buildDirBootstrapper = "bin_bootstrapper"
let buildDirBootstrapperNet461 = buildDirBootstrapper @@ "net461"
let buildDirBootstrapperNetCore = buildDirBootstrapper @@ "netcoreapp2.1"
let buildDirBootstrapperNetCore = buildDirBootstrapper @@ "netcoreapp3.1"
let tempDir = "temp"
let buildMergedDir = buildDir @@ "merged"
let paketFile = buildMergedDir @@ "paket.exe"
Expand Down Expand Up @@ -222,7 +222,7 @@ Target "Publish" (fun _ ->
DotNetCli.Publish (fun c ->
{ c with
Project = "src/Paket"
Framework = "netcoreapp2.1"
Framework = "netcoreapp3.1"
Output = FullName (currentDirectory </> buildDirNetCore)
ToolPath = dotnetExePath
})
Expand All @@ -237,7 +237,7 @@ Target "Publish" (fun _ ->
DotNetCli.Publish (fun c ->
{ c with
Project = "src/Paket.Bootstrapper"
Framework = "netcoreapp2.1"
Framework = "netcoreapp3.1"
Output = FullName (currentDirectory </> buildDirBootstrapperNetCore)
ToolPath = dotnetExePath
})
Expand Down
37 changes: 1 addition & 36 deletions integrationtests/Paket.IntegrationTests/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<dependentAssembly>
<Paket>True</Paket>
<assemblyIdentity name="FSharp.Core" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-65535.65535.65535.65535" newVersion="4.6.0.0" />
<bindingRedirect oldVersion="0.0.0.0-65535.65535.65535.65535" newVersion="5.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<Paket>True</Paket>
Expand All @@ -29,26 +29,6 @@
<assemblyIdentity name="System.ComponentModel.TypeConverter" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-65535.65535.65535.65535" newVersion="4.1.1.0" />
</dependentAssembly>
<dependentAssembly>
<Paket>True</Paket>
<assemblyIdentity name="System.Linq" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-65535.65535.65535.65535" newVersion="4.1.1.0" />
</dependentAssembly>
<dependentAssembly>
<Paket>True</Paket>
<assemblyIdentity name="System.Linq.Expressions" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-65535.65535.65535.65535" newVersion="4.1.1.0" />
</dependentAssembly>
<dependentAssembly>
<Paket>True</Paket>
<assemblyIdentity name="System.Linq.Queryable" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-65535.65535.65535.65535" newVersion="4.0.2.0" />
</dependentAssembly>
<dependentAssembly>
<Paket>True</Paket>
<assemblyIdentity name="System.Reflection.Emit.ILGeneration" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-65535.65535.65535.65535" newVersion="4.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<Paket>True</Paket>
<assemblyIdentity name="System.Runtime.Serialization.Formatters" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
Expand All @@ -59,21 +39,6 @@
<assemblyIdentity name="System.Runtime.Serialization.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-65535.65535.65535.65535" newVersion="4.1.2.0" />
</dependentAssembly>
<dependentAssembly>
<Paket>True</Paket>
<assemblyIdentity name="System.Threading" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-65535.65535.65535.65535" newVersion="4.0.12.0" />
</dependentAssembly>
<dependentAssembly>
<Paket>True</Paket>
<assemblyIdentity name="System.Threading.Thread" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-65535.65535.65535.65535" newVersion="4.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<Paket>True</Paket>
<assemblyIdentity name="System.Threading.ThreadPool" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-65535.65535.65535.65535" newVersion="4.0.11.0" />
</dependentAssembly>
<dependentAssembly>
<Paket>True</Paket>
<assemblyIdentity name="System.Xml.XmlDocument" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
Expand Down
22 changes: 5 additions & 17 deletions integrationtests/Paket.IntegrationTests/AutocompleteSpecs.fs
Original file line number Diff line number Diff line change
@@ -1,46 +1,34 @@
module Paket.IntegrationTests.AutocompleteSpecs

open Fake
open System
open NUnit.Framework
open FsUnit
open System
open System.IO
open System.Diagnostics
open System.IO.Compression
open Paket
open Paket.PackageSources

[<Test>]
let ``#1298 should autocomplete for dapper on local feed``() =
let ``#1298 should autocomplete for dapper on local feed``() =
let result = Dependencies.FindPackagesByName([PackageSource.LocalNuGet(Path.Combine(originalScenarioPath "i001219-props-files", "nuget_repo"),None)],"dapp")
result |> shouldContain "Dapper"
result |> shouldNotContain "dapper"

[<Test>]
let ``#1298 should autocomplete for fake on local feed``() =
let ``#1298 should autocomplete for fake on local feed``() =
let result = Dependencies.FindPackagesByName([PackageSource.LocalNuGet(Path.Combine(originalScenarioPath "i001219-props-files", "nuget_repo"),None)],"fake")
result |> shouldContain "FAKE.Core"
result |> shouldNotContain "Dapper"
result |> shouldNotContain "dapper"

[<Test>]
let ``#1298 should autocomplete versions for FAKE on NuGet3``() =
let ``#1298 should autocomplete versions for FAKE on NuGet3``() =
let result = Dependencies.FindPackageVersions("",[PackageSource.NuGetV3Source Constants.DefaultNuGetV3Stream],"fake")
result |> shouldContain "2.6.15"
result |> shouldContain "4.14.9"
result.Length |> shouldEqual 1000
result |> shouldNotContain "FAKE.Core"

[<Test>]
[<Ignore("it's only working on forki's machine")>]
let ``#1298 should autocomplete versions for msu on local teamcity``() =
let result = Dependencies.FindPackageVersions("",[PackageSource.NuGetV2Source "http://teamcity/guestAuth/app/nuget/v1/FeedService.svc/"],"msu.Addins")
result |> shouldNotContain "msu.Addins"
result |> shouldContain "03.03.7"

[<Test>]
let ``#1298 should autocomplete versions for dapper on local feed``() =
let ``#1298 should autocomplete versions for dapper on local feed``() =
let result = Dependencies.FindPackageVersions("",[PackageSource.LocalNuGet(DirectoryInfo(Path.Combine(originalScenarioPath "i001219-props-files", "nuget_repo")).FullName,None)],"Dapper")
result |> shouldEqual [|"1.42.0"; "1.40"|]

38 changes: 9 additions & 29 deletions integrationtests/Paket.IntegrationTests/BindingRedirect.fs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ open System.Text.RegularExpressions
open Paket

[<Test>]
let ``install should redirect required assemblies only``() =
let ``install should redirect required assemblies only``() =
use __ = paket "install --redirects --createnewbindingfiles" "i001187-binding-redirect" |> fst

let path = Path.Combine(scenarioTempPath "i001187-binding-redirect")
Expand Down Expand Up @@ -86,9 +86,9 @@ let ``#2408 should report wrong app.config parsing``() =
failwith "paket should fail"
with
| exn when exn.Message.Contains("Project1") && exn.Message.Contains("app.config") -> ()

[<Test>]
let ``#1218 install should replace paket's binding redirects with required only``() =
let ``#1218 install should replace paket's binding redirects with required only``() =
use __ = paket "install --redirects --createnewbindingfiles" "i001218-binding-redirect" |> fst

let path = Path.Combine(scenarioTempPath "i001218-binding-redirect")
Expand Down Expand Up @@ -166,25 +166,7 @@ let ``#1218 install should replace paket's binding redirects with required only`


[<Test>]
let ``#1270 force redirects``() =
use __ = paket "install --createnewbindingfiles" "i001270-force-redirects" |> fst
let path = Path.Combine(scenarioTempPath "i001270-force-redirects")
let configPath = Path.Combine(path, "MyClassLibrary", "MyClassLibrary", "app.config")

let ``FSharp.Core`` = """<assemblyIdentity name="FSharp.Core" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />"""
let AlphaFS = """<assemblyIdentity name="AlphaFS" publicKeyToken="4d31a58f7d7ad5c9" culture="neutral" />"""
let ``Newtonsoft.Json`` = """<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />"""
let ``Newtonsoft.Json.Schema`` = """<assemblyIdentity name="Newtonsoft.Json.Schema" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />"""

let config = File.ReadAllText(configPath)

config |> shouldContainText ``FSharp.Core``
config.Contains AlphaFS |> shouldEqual false
config.Contains ``Newtonsoft.Json`` |> shouldEqual false
config.Contains ``Newtonsoft.Json.Schema`` |> shouldEqual false

[<Test>]
let ``#1270 redirects from references``() =
let ``#1270 redirects from references``() =
use __ = paket "install --createnewbindingfiles" "i001270-force-redirects" |> fst
let path = Path.Combine(scenarioTempPath "i001270-force-redirects")
let configPath = Path.Combine(path, "MyClassLibrary", "MyClassLibrary2", "app.config")
Expand All @@ -202,7 +184,7 @@ let ``#1270 redirects from references``() =
config.Contains ``Newtonsoft.Json`` |> shouldEqual false

[<Test>]
let ``#1574 redirects GAC``() =
let ``#1574 redirects GAC``() =
use __ = paket "install --clean-redirects" "i001574-redirect-gac" |> fst
let path = Path.Combine(scenarioTempPath "i001574-redirect-gac")
let configPath = Path.Combine(path, "BindingRedirectPaketBug", "App.config")
Expand All @@ -220,26 +202,24 @@ let ``#1621 generates binding redirect when references project with another targ
use __ = install scenario |> fst
let ``NUnit`` = """<assemblyIdentity name="nunit.framework" publicKeyToken="2638cd05610744eb" culture="neutral" />"""
let ``NUnit correct version`` = "newVersion=\"3.0.5813.39031\""

let path = Path.Combine(scenarioTempPath scenario, "projectB")
let configPath = Path.Combine(path, "app.config")

let config = File.ReadAllText(configPath) |> normalizeLineEndings

config |> shouldContainText ``NUnit``
config |> shouldContainText ``NUnit correct version``

[<Test>]
let ``#1783 generates binding redirect when assembly with different version of main group``() =
let scenario = "i001783-different-versions"
use __ = install scenario |> fst
let ``FSharp.Core`` = """<assemblyIdentity name="FSharp.Core" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />"""
let ``Newtonsoft.Json`` = """<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />"""

let path = Path.Combine(scenarioTempPath scenario, "projectB")
let configPath = Path.Combine(path, "app.config")

let config = File.ReadAllText(configPath) |> normalizeLineEndings

config |> shouldContainText ``FSharp.Core``

config |> shouldContainText ``Newtonsoft.Json``
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,6 @@ let ``#140 windsor should resolve framework dependent dependencies``() =
|> getExplicitRestriction
|> shouldEqual (FrameworkRestriction.Between(DotNetFramework(FrameworkVersion.V3_5), DotNetFramework(FrameworkVersion.V4)))

[<Test; Ignore "slow test">]
let ``#1182 framework restrictions overwrite each other``() =
let cleanup, lockFile = update "i001182-framework-restrictions"
use __ = cleanup
let lockFile = lockFile.ToString()
lockFile.Contains("Microsoft.Data.OData (>= 5.6.2)") |> shouldEqual true
lockFile.Contains("framework: winv4.5") |> shouldEqual false

[<Test>]
#if NO_UNIT_PLATFORMATTRIBUTE
Expand All @@ -33,50 +26,50 @@ let ``#1182 framework restrictions overwrite each other``() =
[<Platform("Mono")>] // PATH TOO LONG on Windows...
[<Flaky>] // failure on assert
#endif
let ``#1190 paket add nuget should handle transitive dependencies``() =
let ``#1190 paket add nuget should handle transitive dependencies``() =
use __ = paket "add nuget xunit version 2.1.0" "i001190-transitive-dependencies-with-restr" |> fst
let lockFile = LockFile.LoadFrom(Path.Combine(scenarioTempPath "i001190-transitive-dependencies-with-restr","paket.lock"))
lockFile.Groups.[Constants.MainDependencyGroup].Resolution.[PackageName "xunit.abstractions"].Settings.FrameworkRestrictions
|> getExplicitRestriction
|> fun res -> res.ToString() |> shouldEqual "|| (>= dnx451) (>= dnxcore50) (>= portable-net45+win8+wp8+wpa81)"

[<Test>]
let ``#1190 paket add nuget should handle transitive dependencies with restrictions``() =
let ``#1190 paket add nuget should handle transitive dependencies with restrictions``() =
use __ = paket "add nuget xunit version 2.1.0" "i001190-transitive-deps" |> fst

let lockFile = LockFile.LoadFrom(Path.Combine(scenarioTempPath "i001190-transitive-deps","paket.lock"))
lockFile.Groups.[Constants.MainDependencyGroup].Resolution.[PackageName "xunit.abstractions"].Settings.FrameworkRestrictions
|> getExplicitRestriction
|> shouldEqual FrameworkRestriction.NoRestriction


[<Test>]
let ``#1197 framework dependencies are not restricting each other``() =
let ``#1197 framework dependencies are not restricting each other``() =
let cleanup, lockFile = update "i001197-too-strict-frameworks"
use __ = cleanup

lockFile.Groups.[Constants.MainDependencyGroup].Resolution.[PackageName "log4net"].Version
|> shouldBeGreaterThan (SemVer.Parse "0")


[<Test>]
let ``#1213 framework dependencies propagate``() =
let ``#1213 framework dependencies propagate``() =
let cleanup, lockFile = update "i001213-framework-propagation"
use __ = cleanup
lockFile.Groups.[Constants.MainDependencyGroup].Resolution.[PackageName "Newtonsoft.Json"].Settings.FrameworkRestrictions
|> getExplicitRestriction
|> shouldEqual FrameworkRestriction.NoRestriction

[<Test>]
let ``#1215 framework dependencies propagate``() =
let ``#1215 framework dependencies propagate``() =
let cleanup, lockFile = update "i001215-framework-propagation-no-restriction"
use __ = cleanup
lockFile.Groups.[Constants.MainDependencyGroup].Resolution.[PackageName "Microsoft.Bcl.Async"].Settings.FrameworkRestrictions
|> getExplicitRestriction
|> shouldEqual FrameworkRestriction.NoRestriction

[<Test>]
let ``#1232 framework dependencies propagate``() =
let ``#1232 framework dependencies propagate``() =
let cleanup, lockFile = update "i001232-sql-lite"
use __ = cleanup
let restriction =
Expand All @@ -90,7 +83,7 @@ let ``#1232 framework dependencies propagate``() =
|> shouldEqual true

[<Test>]
let ``#1494 detect platform 5.0``() =
let ``#1494 detect platform 5.0``() =
use __ = update "i001494-download" |> fst

()
Loading