Skip to content

Commit

Permalink
fixes #2765
Browse files Browse the repository at this point in the history
  • Loading branch information
forki committed Sep 14, 2017
1 parent 02150c5 commit ee807fe
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions src/Paket.Core/Packaging/PackageMetaData.fs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ let addFile (source : string) (target : string) (templateFile : TemplateFile) =
| IncompleteTemplate ->
failwith (sprintf "You should only try and add files to template files with complete metadata.%sFile: %s" Environment.NewLine templateFile.FileName)

let findDependencies (dependenciesFile : DependenciesFile) config platform (template : TemplateFile) (project : ProjectFile) lockDependencies minimumFromLockFile pinProjectReferences (projectWithTemplates : Map<string, TemplateFile * ProjectFile * bool>) includeReferencedProjects (version :SemVerInfo option) specificVersions (projDeps) =
let findDependencies (dependenciesFile : DependenciesFile) config platform (template : TemplateFile) (project : ProjectFile) lockDependencies minimumFromLockFile pinProjectReferences (projectWithTemplates : Map<string, TemplateFile * ProjectFile>) includeReferencedProjects (version :SemVerInfo option) specificVersions (projDeps) =
let includeReferencedProjects = template.IncludeReferencedProjects || includeReferencedProjects
let targetDir =
match project.OutputType with
Expand All @@ -185,7 +185,7 @@ let findDependencies (dependenciesFile : DependenciesFile) config platform (temp
|> List.filter (fun proj -> proj <> project)
|> List.fold (fun (deps, files) p ->
match Map.tryFind p.FileName projectWithTemplates with
| Some (packagedTemplate,packagedProject,true) -> (packagedTemplate,packagedProject) :: deps, files
| Some (packagedTemplate,packagedProject) -> (packagedTemplate,packagedProject) :: deps, files
| _ ->
let p =
match ProjectFile.TryLoad p.FileName with
Expand Down Expand Up @@ -300,7 +300,7 @@ let findDependencies (dependenciesFile : DependenciesFile) config platform (temp
[if includeReferencedProjects then
for proj in project.GetAllReferencedProjects(false,projDeps) |> Seq.filter ((<>) project) do
match Map.tryFind proj.FileName projectWithTemplates with
| Some ({ Contents = CompleteInfo(core, _) }, _, _) ->
| Some ({ Contents = CompleteInfo(core, _) }, _) ->
let versionConstraint =
match core.Version with
| Some v ->
Expand Down
12 changes: 6 additions & 6 deletions src/Paket.Core/Packaging/PackageProcess.fs
Original file line number Diff line number Diff line change
Expand Up @@ -169,16 +169,17 @@ let Pack(workingDir,dependenciesFile : DependenciesFile, packageOutputPath, buil
false
else true
| _ -> true)
|> Array.map (fun (projectFile,templateFile') ->
|> Array.choose (fun (projectFile,templateFile') ->
allTemplateFiles.Remove(templateFile'.FileName) |> ignore

let merged = merge buildConfig buildPlatform version specificVersions projectFile templateFile'
let willBePacked =
match templateFile with
| Some file -> normalizePath (Path.GetFullPath file) = normalizePath (Path.GetFullPath merged.FileName)
| Some file -> normalizePath (Path.GetFullPath file) = normalizePath (Path.GetFullPath templateFile'.FileName)
| None -> true
if not willBePacked then None else
let merged = merge buildConfig buildPlatform version specificVersions projectFile templateFile'

Path.GetFullPath projectFile.FileName |> normalizePath,(merged,projectFile,willBePacked))
Some(Path.GetFullPath projectFile.FileName |> normalizePath,(merged,projectFile)))
|> Map.ofArray

// add dependencies
Expand Down Expand Up @@ -206,9 +207,8 @@ let Pack(workingDir,dependenciesFile : DependenciesFile, packageOutputPath, buil

let remaining = allTemplateFiles |> Seq.collect convertRemainingTemplate |> Seq.toList
projectTemplates
|> Map.filter (fun _ (_,_,willBePacked) -> willBePacked)
|> Map.toList
|> Seq.collect(fun (_,(t, p, _)) ->
|> Seq.collect(fun (_,(t, p)) ->
seq {
for template in optWithSymbols p t do
yield template, p
Expand Down
4 changes: 2 additions & 2 deletions src/Paket/Paket.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
<StartAction>Project</StartAction>
<StartArguments>install</StartArguments>
<StartWorkingDirectory>C:\temp\Gu.Reactive</StartWorkingDirectory>
<StartArguments>restore --project "D:\temp\paket-constrain-framework\paket-constrain-framework.fsproj"</StartArguments>
<StartArguments>pack output "../build" --version 0.1.0.0 --template ./ProjectA/paket.template -v</StartArguments>
<StartWorkingDirectory>C:\proj\Paket</StartWorkingDirectory>
<StartWorkingDirectory>D:\temp\paket-constrain-framework</StartWorkingDirectory>
<StartWorkingDirectory>C:\temp\paket-template-repro</StartWorkingDirectory>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<Optimize>true</Optimize>
Expand Down

0 comments on commit ee807fe

Please sign in to comment.