Skip to content

Commit

Permalink
Small cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
forki committed May 13, 2017
1 parent d73c881 commit 6e08462
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
4 changes: 3 additions & 1 deletion src/Paket.Core/Installation/DependencyChangeDetection.fs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ let findNuGetChangesInDependenciesFile(dependenciesFile:DependenciesFile,lockFil
| _ -> yield groupName, name, [PackageNotFoundInDependenciesFile] // Removed
]
|> List.filter (fun (_,_, changes) -> changes.Length > 0)
|> List.map (fun (g,p, changes) -> lockFile.GetAllNormalizedDependenciesOf(g,p,lockFile.FileName) |> Seq.map (fun (a,b) -> a,b,changes))
|> List.map (fun (g,p, changes) ->
lockFile.GetAllNormalizedDependenciesOf(g,p,lockFile.FileName)
|> Seq.map (fun (a,b) -> a,b,changes))
|> Seq.concat
|> Set.ofSeq

Expand Down
4 changes: 3 additions & 1 deletion src/Paket.Core/Installation/RestoreProcess.fs
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,9 @@ let Restore(dependenciesFileName,projectFile,force,group,referencesFileNames,ign
if hasAnyChanges then
checkResponse "paket.dependencies and paket.lock are out of sync in %s.%sPlease run 'paket install' or 'paket update' to recompute the paket.lock file." lockFileName.Directory.FullName Environment.NewLine
for (group, package, changes) in nugetChanges do
traceWarnfn "Changes %A were detected in %s/%s" changes (group.ToString()) (package.ToString())
traceWarnfn "Changes were detected for %s/%s" (group.ToString()) (package.ToString())
for change in changes do
traceWarnfn " - %A" change

let groups =
match group with
Expand Down
16 changes: 7 additions & 9 deletions src/Paket.Core/PaketConfigFiles/LockFile.fs
Original file line number Diff line number Diff line change
Expand Up @@ -644,24 +644,22 @@ type LockFile (fileName:string, groups: Map<GroupName,LockFileGroup>) =
member __.GetTransitiveDependencies(groupName) =
let collectDependenciesForGroup group =
let fromNuGets =
group.Resolution
|> Seq.map (fun d -> d.Value.Dependencies |> Seq.map (fun (n,_,_) -> n))
|> Seq.concat
group.Resolution
|> Seq.collect (fun d ->
d.Value.Dependencies
|> Seq.map (fun (n,_,_) -> n))
|> Set.ofSeq

let fromSourceFiles =
group.RemoteFiles
|> Seq.map (fun d -> d.Dependencies |> Seq.map fst)
|> Seq.concat
|> Seq.collect (fun d -> d.Dependencies |> Seq.map fst)
|> Set.ofSeq

Set.union fromNuGets fromSourceFiles

let group = groups.TryFind groupName
match group with

match groups.TryFind groupName with
| None -> Set.empty
| Some group -> collectDependenciesForGroup group


member this.GetTopLevelDependencies(groupName) =
match groups |> Map.tryFind groupName with
Expand Down
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>
<StartAction>Project</StartAction>
<StartArguments>restore --target-framework netstandard1.3 --project "C:\temp\PaketRepro\PaketRepro\PaketRepro.csproj"</StartArguments>
<StartArguments>restore</StartArguments>
<StartWorkingDirectory>C:\temp\PaketRepro</StartWorkingDirectory>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
Expand Down

0 comments on commit 6e08462

Please sign in to comment.