Skip to content

Commit

Permalink
Pack deps without template - fixes #1429
Browse files Browse the repository at this point in the history
  • Loading branch information
forki committed Jan 25, 2016
1 parent e20488e commit 7f0c378
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 13 deletions.
18 changes: 6 additions & 12 deletions src/Paket.Core/PackageMetaData.fs
Original file line number Diff line number Diff line change
Expand Up @@ -136,18 +136,11 @@ let findDependencies (dependencies : DependenciesFile) config platform (template
| None -> PreReleaseStatus.No
| _ -> PreReleaseStatus.All

let getProjects =
seq {
if includeReferencedProjects then
yield! project.GetAllInterProjectDependenciesWithoutProjectTemplates
else
yield project
}

let deps, files =
getProjects
|> Seq.filter (fun proj -> proj <> project)
|> Seq.fold (fun (deps, files) p ->
project.GetAllInterProjectDependenciesWithProjectTemplates |> Seq.toList
|> List.filter (fun proj -> proj <> project)
|> List.fold (fun (deps, files) p ->
match Map.tryFind p.FileName map with
| Some packagedRef -> packagedRef :: deps, files
| None ->
Expand All @@ -161,8 +154,9 @@ let findDependencies (dependencies : DependenciesFile) config platform (template
// Add the assembly + pdb + dll from this project
let templateWithOutput =
let additionalFiles =
let assemblyNames = getProjects
|> Seq.map (fun proj -> proj.GetAssemblyName())
let assemblyNames =
if includeReferencedProjects then project.GetAllInterProjectDependenciesWithoutProjectTemplates |> Seq.toList else [ project ]
|> List.map (fun proj -> proj.GetAssemblyName())

assemblyNames
|> Seq.collect (fun assemblyFileName ->
Expand Down
14 changes: 13 additions & 1 deletion src/Paket.Core/ProjectFile.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1140,6 +1140,17 @@ module ProjectFile =
| None -> true
)

let projectsWithTemplates this projects =
projects
|> Seq.filter(fun proj ->
if proj = this then true
else
let templateFilename = findTemplatesFile (FileInfo proj.FileName)
match templateFilename with
| Some tfn -> TemplateFile.IsProjectType tfn
| None -> false
)


let getOutputDirectory buildConfiguration buildPlatform (project:ProjectFile) =
let platforms =
Expand Down Expand Up @@ -1281,8 +1292,9 @@ type ProjectFile with

member this.GetRecursiveInterProjectDependencies = ProjectFile.getAllReferencedProjects this

member this.GetAllInterProjectDependenciesWithoutProjectTemplates = ProjectFile.getAllReferencedProjects this |> ProjectFile.projectsWithoutTemplates this
member this.GetAllInterProjectDependenciesWithoutProjectTemplates = ProjectFile.getAllReferencedProjects this |> ProjectFile.projectsWithoutTemplates this

member this.GetAllInterProjectDependenciesWithProjectTemplates = ProjectFile.getAllReferencedProjects this |> ProjectFile.projectsWithTemplates this

member this.ReplaceNuGetPackagesFile () = ProjectFile.removeNuGetTargetsEntries this

Expand Down

0 comments on commit 7f0c378

Please sign in to comment.