From 70f036c990bba36875ba8bd0c2fa2b908fef36fe Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Tue, 3 Mar 2015 12:01:34 +0000 Subject: [PATCH 1/2] use project name rather than the package id to identify project to pack --- src/Paket.Core/PackageProcess.fs | 2 +- src/Paket.Core/ProjectFile.fs | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Paket.Core/PackageProcess.fs b/src/Paket.Core/PackageProcess.fs index ce40ec99dd..55d01e7f4f 100644 --- a/src/Paket.Core/PackageProcess.fs +++ b/src/Paket.Core/PackageProcess.fs @@ -83,7 +83,7 @@ let Pack(dependencies : DependenciesFile, packageOutputPath, buildConfig, versio let id = match merged.Contents with - | CompleteInfo (c, _) -> c.Id + | CompleteInfo _ -> projectFile.NameWithoutExtension | x -> failwithf "unexpected failure while merging meta data: %A" x id,(merged,projectFile)) diff --git a/src/Paket.Core/ProjectFile.fs b/src/Paket.Core/ProjectFile.fs index 034d45d595..ccc5b8f8f4 100644 --- a/src/Paket.Core/ProjectFile.fs +++ b/src/Paket.Core/ProjectFile.fs @@ -43,6 +43,8 @@ type ProjectFile = member this.Name = FileInfo(this.FileName).Name + member this.NameWithoutExtension = Path.GetFileNameWithoutExtension this.Name + member this.GetCustomReferenceAndFrameworkNodes() = this.FindNodes false "Reference" /// Finds all project files From 23679da10f3a429c237b2a85be62cf81ed897063 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Tue, 3 Mar 2015 12:03:06 +0000 Subject: [PATCH 2/2] refactor to use ProjectFile.NameWithoutExtension in add/remove project --- src/Paket.Core/AddProcess.fs | 5 +---- src/Paket.Core/RemoveProcess.fs | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/Paket.Core/AddProcess.fs b/src/Paket.Core/AddProcess.fs index 38bded67db..faec2fb52b 100644 --- a/src/Paket.Core/AddProcess.fs +++ b/src/Paket.Core/AddProcess.fs @@ -35,10 +35,7 @@ let AddToProject(dependenciesFileName, package, version, force, hard, projectNam let addToSpecifiedProject (projects : ProjectFile seq) package = let project = - projects - |> Seq.tryFind (fun p -> - let name = Path.GetFileNameWithoutExtension p.Name - name = projectName || p.Name = projectName) + projects |> Seq.tryFind (fun p -> p.NameWithoutExtension = projectName || p.Name = projectName) match project with | Some p -> diff --git a/src/Paket.Core/RemoveProcess.fs b/src/Paket.Core/RemoveProcess.fs index 0c30e97048..080bd11277 100644 --- a/src/Paket.Core/RemoveProcess.fs +++ b/src/Paket.Core/RemoveProcess.fs @@ -53,10 +53,7 @@ let RemoveFromProject(dependenciesFileName, package:PackageName, force, hard, pr let removeFromSpecifiedProject (projects : ProjectFile seq) = let project = - projects - |> Seq.tryFind (fun p -> - let name = Path.GetFileNameWithoutExtension p.Name - name = projectName || p.Name = projectName) + projects |> Seq.tryFind (fun p -> p.NameWithoutExtension = projectName || p.Name = projectName) match project with | Some p ->