Skip to content

Commit

Permalink
Allow to restore dll from remote dependencies file - closes #1507
Browse files Browse the repository at this point in the history
  • Loading branch information
forki committed Mar 10, 2016
1 parent 0c5f137 commit 584761a
Show file tree
Hide file tree
Showing 10 changed files with 55 additions and 55 deletions.
33 changes: 6 additions & 27 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,19 @@
#### 2.51.12 - 10.03.2016
#### 2.52.0 - 10.03.2016
* Allow to restore dll from remote dependencies file - https://github.com/fsprojects/Paket/issues/1507
* Prevent paket holding locks on assemblies during binding redirects - https://github.com/fsprojects/Paket/pull/1492
* ProjectFile.save with forceTouch to only modify the last write time without content if unchanged - https://github.com/fsprojects/Paket/pull/1493
* BUGFIX: Don't accept "Unsupported0.0" as full framework - https://github.com/fsprojects/Paket/issues/1494
* BUGFIX: Revert 1487 - https://github.com/fsprojects/Paket/issues/1487

#### 2.51.11 - 09.03.2016
* BUGFIX: Fall back to v2 for VSTS - https://github.com/fsprojects/Paket/issues/1496

#### 2.51.10 - 09.03.2016
* BUGFIX: Fixed duplicate frameworks during auto-detection - https://github.com/fsprojects/Paket/issues/1500

#### 2.51.9 - 09.03.2016
* BUGFIX: Fixed conditional references created for group dependencies - https://github.com/fsprojects/Paket/issues/1505

#### 2.51.8 - 09.03.2016
* BUGFIX: Fixed parsing error in lock file parser - https://github.com/fsprojects/Paket/issues/1500

#### 2.51.7 - 08.03.2016
* USABILITY: only complain about missing references if there are references at all

#### 2.51.6 - 07.03.2016
* BUGFIX: Merge Chessie into PowerShell package - https://github.com/fsprojects/Paket/issues/1499

#### 2.51.5 - 07.03.2016
* BUGFIX: Make v3 API more robust

#### 2.51.4 - 01.03.2016
* BUGFIX: Do not install packages with same version from different groups twice - https://github.com/fsprojects/Paket/issues/1458

#### 2.51.3 - 01.03.2016
* BUGFIX: When adding framework specification to paket.dependencies .props include was moved to the bottom of csproj file - https://github.com/fsprojects/Paket/issues/1487

#### 2.51.2 - 01.03.2016
* BUGFIX: Allow to use LOCKEDVERSION with packages that are not in main group - https://github.com/fsprojects/Paket/issues/1483

#### 2.51.1 - 01.03.2016
* Prevent paket holding locks on assemblies during binding redirects - https://github.com/fsprojects/Paket/pull/1492
* ProjectFile.save with forceTouch to only modify the last write time without content if unchanged - https://github.com/fsprojects/Paket/pull/1493
* BUGFIX: Don't accept "Unsupported0.0" as full framework - https://github.com/fsprojects/Paket/issues/1494
* USABILITY: only complain about missing references if there are references at all

#### 2.51.0 - 29.02.2016
* Experimental Visual C++ support in binding redirects - https://github.com/fsprojects/Paket/issues/1467
Expand Down
11 changes: 10 additions & 1 deletion integrationtests/Paket.IntegrationTests/InstallSpecs.fs
Original file line number Diff line number Diff line change
Expand Up @@ -235,4 +235,13 @@ let ``#1500 without install error``() =

[<Test>]
let ``#1371 without download fail``() =
paket "install -f" "i001371-restore-error" |> ignore
paket "install -f" "i001371-restore-error" |> ignore

[<Test>]
let ``#1507 allows to download remote dependencies``() =
let scenario = "i001507-privateeye"

install scenario |> ignore

File.Exists (Path.Combine(scenarioTempPath scenario, "paket-files", "forki", "PrivateEye", "privateeye.fsx")) |> shouldEqual true
File.Exists (Path.Combine(scenarioTempPath scenario, "paket-files", "forki", "PrivateEye", "bin", "PrivateEye.Bridge.dll")) |> shouldEqual true
8 changes: 4 additions & 4 deletions src/Paket.Bootstrapper/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
[assembly: AssemblyTitleAttribute("Paket.Bootstrapper")]
[assembly: AssemblyProductAttribute("Paket")]
[assembly: AssemblyDescriptionAttribute("A package dependency manager for .NET with support for NuGet packages and GitHub repositories.")]
[assembly: AssemblyVersionAttribute("2.51.12")]
[assembly: AssemblyFileVersionAttribute("2.51.12")]
[assembly: AssemblyInformationalVersionAttribute("2.51.12")]
[assembly: AssemblyVersionAttribute("2.52.0")]
[assembly: AssemblyFileVersionAttribute("2.52.0")]
[assembly: AssemblyInformationalVersionAttribute("2.52.0")]
namespace System {
internal static class AssemblyVersionInformation {
internal const string Version = "2.51.12";
internal const string Version = "2.52.0";
}
}
8 changes: 4 additions & 4 deletions src/Paket.Core/AssemblyInfo.fs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ open System.Reflection
[<assembly: AssemblyProductAttribute("Paket")>]
[<assembly: AssemblyCompanyAttribute("Paket team")>]
[<assembly: AssemblyDescriptionAttribute("A package dependency manager for .NET with support for NuGet packages and GitHub repositories.")>]
[<assembly: AssemblyVersionAttribute("2.51.12")>]
[<assembly: AssemblyFileVersionAttribute("2.51.12")>]
[<assembly: AssemblyInformationalVersionAttribute("2.51.12")>]
[<assembly: AssemblyVersionAttribute("2.52.0")>]
[<assembly: AssemblyFileVersionAttribute("2.52.0")>]
[<assembly: AssemblyInformationalVersionAttribute("2.52.0")>]
do ()

module internal AssemblyVersionInformation =
let [<Literal>] Version = "2.51.12"
let [<Literal>] Version = "2.52.0"
12 changes: 8 additions & 4 deletions src/Paket.Core/DependenciesFile.fs
Original file line number Diff line number Diff line change
Expand Up @@ -528,10 +528,14 @@ type DependenciesFile(fileName,groups:Map<GroupName,DependenciesGroup>, textRepr
let resolveGroup groupName _ =
let group = this.GetGroup groupName

let resolveSourceFile (file:ResolvedSourceFile) : PackageRequirement list =
RemoteDownload.downloadDependenciesFile(force,Path.GetDirectoryName fileName, groupName, DependenciesFile.FromCode, file)
|> Async.RunSynchronously
|> fun df -> df.Groups.[Constants.MainDependencyGroup].Packages // We do not support groups in reference files yet
let resolveSourceFile (file:ResolvedSourceFile) : (PackageRequirement list * UnresolvedSourceFile list) =
let remoteDependenciesFile =
RemoteDownload.downloadDependenciesFile(force,Path.GetDirectoryName fileName, groupName, DependenciesFile.FromCode, file)
|> Async.RunSynchronously

// We do not support groups in reference files yet
let mainGroup = remoteDependenciesFile.Groups.[Constants.MainDependencyGroup]
mainGroup.Packages,mainGroup.RemoteFiles

let remoteFiles = ModuleResolver.Resolve(resolveSourceFile,getSha1,group.RemoteFiles)

Expand Down
18 changes: 13 additions & 5 deletions src/Paket.Core/ModuleResolver.fs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ type ResolvedSourceFile =

let private getCommit (file : UnresolvedSourceFile) = defaultArg file.Commit "master"

let resolve getDependencies getSha1 (file : UnresolvedSourceFile) : ResolvedSourceFile =
let rec resolve getDependencies getSha1 (file : UnresolvedSourceFile) : ResolvedSourceFile list =
let sha =
let commit = getCommit file
match file.Origin with
Expand All @@ -76,13 +76,19 @@ let resolve getDependencies getSha1 (file : UnresolvedSourceFile) : ResolvedSour
Dependencies = Set.empty
Name = file.Name
AuthKey = file.AuthKey }


let nugetDependencies,remoteDependencies = getDependencies resolved
let dependencies =
getDependencies resolved
nugetDependencies
|> List.map (fun (package:PackageRequirement) -> package.Name, package.VersionRequirement)
|> Set.ofList

{ resolved with Dependencies = dependencies }
let recursiveDeps =
remoteDependencies
|> List.map (resolve (fun _ -> [],[]) getSha1)
|> List.concat

[{ resolved with Dependencies = dependencies }] @ recursiveDeps

let private detectConflicts (remoteFiles : UnresolvedSourceFile list) : unit =
let conflicts =
Expand All @@ -107,4 +113,6 @@ let private detectConflicts (remoteFiles : UnresolvedSourceFile list) : unit =
let Resolve(getDependencies, getSha1, remoteFiles : UnresolvedSourceFile list) : ResolvedSourceFile list =
detectConflicts remoteFiles

remoteFiles |> List.map (resolve getDependencies getSha1)
remoteFiles
|> List.map (resolve getDependencies getSha1)
|> List.concat
8 changes: 4 additions & 4 deletions src/Paket.PowerShell/AssemblyInfo.fs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ open System.Reflection
[<assembly: AssemblyProductAttribute("Paket")>]
[<assembly: AssemblyCompanyAttribute("Paket team")>]
[<assembly: AssemblyDescriptionAttribute("A package dependency manager for .NET with support for NuGet packages and GitHub repositories.")>]
[<assembly: AssemblyVersionAttribute("2.51.12")>]
[<assembly: AssemblyFileVersionAttribute("2.51.12")>]
[<assembly: AssemblyInformationalVersionAttribute("2.51.12")>]
[<assembly: AssemblyVersionAttribute("2.52.0")>]
[<assembly: AssemblyFileVersionAttribute("2.52.0")>]
[<assembly: AssemblyInformationalVersionAttribute("2.52.0")>]
do ()

module internal AssemblyVersionInformation =
let [<Literal>] Version = "2.51.12"
let [<Literal>] Version = "2.52.0"
8 changes: 4 additions & 4 deletions src/Paket/AssemblyInfo.fs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ open System.Reflection
[<assembly: AssemblyProductAttribute("Paket")>]
[<assembly: AssemblyCompanyAttribute("Paket team")>]
[<assembly: AssemblyDescriptionAttribute("A package dependency manager for .NET with support for NuGet packages and GitHub repositories.")>]
[<assembly: AssemblyVersionAttribute("2.51.12")>]
[<assembly: AssemblyFileVersionAttribute("2.51.12")>]
[<assembly: AssemblyInformationalVersionAttribute("2.51.12")>]
[<assembly: AssemblyVersionAttribute("2.52.0")>]
[<assembly: AssemblyFileVersionAttribute("2.52.0")>]
[<assembly: AssemblyInformationalVersionAttribute("2.52.0")>]
do ()

module internal AssemblyVersionInformation =
let [<Literal>] Version = "2.51.12"
let [<Literal>] Version = "2.52.0"
2 changes: 1 addition & 1 deletion src/Paket/Paket.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<StartAction>Project</StartAction>
<StartProgram>paket.exe</StartProgram>
<StartArguments>update</StartArguments>
<StartWorkingDirectory>D:\code\Paket\integrationtests\scenarios\i001233-props-fw-files\temp</StartWorkingDirectory>
<StartWorkingDirectory>D:\code\Paket\integrationtests\scenarios\i001507-privateeye\temp</StartWorkingDirectory>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
Expand Down
2 changes: 1 addition & 1 deletion tests/Paket.Tests/Resolver/ConflictSourcesSpecs.fs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ let ``should resolve source files with correct sha``() =
VersionRequirement = VersionRequirement.NoRestriction }
let sha = "sha1"
let cfg = DependenciesFile.FromCode(config1)
let resolved = ModuleResolver.Resolve((fun _ -> [dep]), (fun _ _ _ _ _ -> sha), cfg.Groups.[Constants.MainDependencyGroup].RemoteFiles)
let resolved = ModuleResolver.Resolve((fun _ -> [dep],[]), (fun _ _ _ _ _ -> sha), cfg.Groups.[Constants.MainDependencyGroup].RemoteFiles)
resolved
|> shouldContain
{ Owner = "fsharp"
Expand Down

0 comments on commit 584761a

Please sign in to comment.