Skip to content

Commit

Permalink
Pack with concrete template file should work for type project - fixes #…
Browse files Browse the repository at this point in the history
  • Loading branch information
forki committed Jan 20, 2016
1 parent 577d8cb commit e9cdeeb
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 7 deletions.
3 changes: 3 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#### 2.46.2 - 20.01.2016
* BUGFIX: Pack with concrete template file should work for type project - https://github.com/fsprojects/Paket/issues/1414

#### 2.46.1 - 19.01.2016
* BUGFIX: Don't use symbol packages when using filesystem source with symbol package - https://github.com/fsprojects/Paket/issues/1413

Expand Down
4 changes: 2 additions & 2 deletions integrationtests/Paket.IntegrationTests/PackSpecs.fs
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ let ``#1375 pack with projectUrl commandline``() =
[<Test>]
let ``#1376 fail template``() =
let outPath = Path.Combine(scenarioTempPath "i001376-pack-template","out")
let templatePath = Path.Combine(scenarioTempPath "i001376-pack-template","PaketBug\paket.csproj.template")
let templatePath = Path.Combine(scenarioTempPath "i001376-pack-template","PaketBug\paket.template")
paket ("pack -v output \"" + outPath + "\" templatefile " + templatePath) "i001376-pack-template" |> ignore
let fileInfo = FileInfo(Path.Combine(outPath, "PaketBug.1.0.0.0.nupkg"))
let (expectedFileSize: int64) = int64(1542)
Assert.False(fileInfo.Length = expectedFileSize)
fileInfo.Length |> shouldBeGreaterThan expectedFileSize

File.Delete(Path.Combine(scenarioTempPath "i001376-pack-template","PaketBug","paket.template"))
10 changes: 7 additions & 3 deletions src/Paket.Core/PackageProcess.fs
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,7 @@ let Pack(workingDir,dependencies : DependenciesFile, packageOutputPath, buildCon

// load up project files and grab meta data
let projectTemplates =
match templateFile with
| Some template -> Map.empty
| None ->
let getAllProjectsFiles workingDir =
ProjectFile.FindAllProjects workingDir
|> Array.choose (fun projectFile ->
match ProjectFile.FindTemplatesFile(FileInfo(projectFile.FileName)) with
Expand All @@ -141,6 +139,12 @@ let Pack(workingDir,dependencies : DependenciesFile, packageOutputPath, buildCon
Path.GetFullPath projectFile.FileName |> normalizePath,(merged,projectFile))
|> Map.ofArray

match templateFile with
| Some template ->
getAllProjectsFiles (FileInfo(template).Directory.FullName)
|> Map.filter (fun p (t,_) -> normalizePath t.FileName = normalizePath template)
| None -> getAllProjectsFiles workingDir

// add dependencies
let allTemplates =
let optWithSymbols projectFile templateFile =
Expand Down
4 changes: 2 additions & 2 deletions src/Paket/Paket.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<StartArguments>pack output D:\code\paketbug\output</StartArguments>
<StartArguments>install</StartArguments>
<StartArguments>restore</StartArguments>
<StartArguments>update</StartArguments>
<StartArguments>pack -v output "D:\code\Paket\integrationtests\scenarios\i001376-pack-template\temp\out" templatefile "D:\code\Paket\integrationtests\scenarios\i001376-pack-template\temp\PaketBug\paket.template"</StartArguments>
<StartAction>Project</StartAction>
<StartProgram>paket.exe</StartProgram>
<StartWorkingDirectory>c:\code\Paketkopie</StartWorkingDirectory>
Expand All @@ -48,7 +48,7 @@
<StartWorkingDirectory>d:\code\paketrepro</StartWorkingDirectory>
<StartWorkingDirectory>D:\code\Paket\integrationtests\scenarios\i001270-net461\temp</StartWorkingDirectory>
<StartWorkingDirectory>C:\code\restore</StartWorkingDirectory>
<StartWorkingDirectory>D:\code\Paket\integrationtests\scenarios\i001387-nugetv3\temp</StartWorkingDirectory>
<StartWorkingDirectory>D:\code\Paket\integrationtests\scenarios\i001376-pack-template\temp</StartWorkingDirectory>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
Expand Down

0 comments on commit e9cdeeb

Please sign in to comment.