From 57a4455b3875cef3c8004fd7c6879d9a2a2a2ce9 Mon Sep 17 00:00:00 2001 From: Steffen Forkmann Date: Thu, 12 Mar 2015 21:34:51 +0100 Subject: [PATCH] Relative file copy in paket pack for ** --- RELEASE_NOTES.md | 22 +++++----------------- src/Paket.Core/TemplateFile.fs | 8 +++++++- src/Paket.Core/Utils.fs | 2 +- src/Paket/Paket.fsproj | 4 ++-- 4 files changed, 15 insertions(+), 21 deletions(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index b7d8f29f3d..3545004802 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,24 +1,12 @@ -#### 0.33.15 - 12.03.2015 +#### 0.34.0 - 12.03.2015 +* `paket pack` pretty-prints it's nuspec - https://github.com/fsprojects/Paket/issues/691 +* Paket packs .MDBs docs into the nupkg - https://github.com/fsprojects/Paket/issues/693 +* paket pack / paket.template support wildcard patterns - https://github.com/fsprojects/Paket/issues/690 +* Allow empty lines in `paket.template` and report file name if parser fails - https://github.com/fsprojects/Paket/issues/692 * BUGFIX: paket.template - file type respects dir without slash at the end - https://github.com/fsprojects/Paket/issues/698 - -#### 0.33.13 - 11.03.2015 * BUGFIX: paket-files folder is alwaays relative to `paket.dependencies` - https://github.com/fsprojects/Paket/issues/564 - -#### 0.33.12 - 11.03.2015 -* Allow empty lines in `paket.template` and report file name if parser fails - https://github.com/fsprojects/Paket/issues/692 - -#### 0.33.6 - 11.03.2015 -* paket pack / paket.template support wildcard patterns - https://github.com/fsprojects/Paket/issues/690 - -#### 0.33.4 - 11.03.2015 * BUGFIX: `paket install` respects manual paket nodes - https://github.com/fsprojects/Paket/issues/679 -#### 0.33.3 - 11.03.2015 -* `paket pack` pretty-prints it's nuspec - https://github.com/fsprojects/Paket/issues/691 - -#### 0.33.1 - 11.03.2015 -* Paket packs .MDBs docs into the nupkg - https://github.com/fsprojects/Paket/issues/693 - #### 0.33.0 - 10.03.2015 * Paket packs XML docs into the nupkg - https://github.com/fsprojects/Paket/issues/689 * BUGFIX: Install settings from `paket.dependencies` should override package settings - https://github.com/fsprojects/Paket/issues/688 diff --git a/src/Paket.Core/TemplateFile.fs b/src/Paket.Core/TemplateFile.fs index baf913e998..d1bfd80060 100644 --- a/src/Paket.Core/TemplateFile.fs +++ b/src/Paket.Core/TemplateFile.fs @@ -326,7 +326,13 @@ module internal TemplateFile = let files = [ for source, target in optionalInfo.Files do for file in Fake.Globbing.search root source do - yield file, target ] + if source.Contains("**") then + let sourceRoot = FileInfo(Path.Combine(root,source.Substring(0,source.IndexOf("**")))).FullName |> normalizePath + let fullFile = FileInfo(file).Directory.FullName |> normalizePath + let newTarget = Path.Combine(target,fullFile.Replace(sourceRoot,"").TrimStart(Path.DirectorySeparatorChar)) + yield file, newTarget + else + yield file, target ] CompleteInfo(core, { optionalInfo with Files = files }) | _ -> contents } diff --git a/src/Paket.Core/Utils.fs b/src/Paket.Core/Utils.fs index 26154ea982..90dbcf9d08 100644 --- a/src/Paket.Core/Utils.fs +++ b/src/Paket.Core/Utils.fs @@ -204,7 +204,7 @@ let askYesNo question = getAnswer() -let inline normalizePath(path:string) = path.Replace("\\",Path.DirectorySeparatorChar.ToString()).Replace("/",Path.DirectorySeparatorChar.ToString()) +let inline normalizePath(path:string) = path.Replace("\\",Path.DirectorySeparatorChar.ToString()).Replace("/",Path.DirectorySeparatorChar.ToString()).TrimEnd(Path.DirectorySeparatorChar) /// Gets all files with the given pattern let inline FindAllFiles(folder, pattern) = DirectoryInfo(folder).GetFiles(pattern, SearchOption.AllDirectories) diff --git a/src/Paket/Paket.fsproj b/src/Paket/Paket.fsproj index 3ae8404f2f..9e792e1cc6 100644 --- a/src/Paket/Paket.fsproj +++ b/src/Paket/Paket.fsproj @@ -41,8 +41,8 @@ 3 - update - D:\code\Paket09x\.paket + pack output ./temp version "0.7.0" releaseNotes "BREAKING API: Use optional parameters and allow speechifying FSI evaluator - https://github.com/fsprojects/FsReveal/pull/51" + D:\code\FsRevealDevelop\ 11