Skip to content

Commit

Permalink
Merge pull request #1403 from pms1969/fix-pdbs
Browse files Browse the repository at this point in the history
pdb's no longer being packaged in the non symbols package
  • Loading branch information
forki committed Jan 18, 2016
2 parents 6390e86 + a5a537d commit c410e75
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 9 deletions.
9 changes: 8 additions & 1 deletion src/Paket.Core/PackageMetaData.fs
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,15 @@ let findDependencies (dependencies : DependenciesFile) config platform (template
|> Array.map (fun f -> FileInfo f)
|> Array.filter (fun fi ->
let isSameFileName = (Path.GetFileNameWithoutExtension fi.Name) = name
let validExtensions = match template.Contents with
| CompleteInfo(core, optional) ->
if core.Symbols || optional.IncludePdbs then [".xml"; ".dll"; ".exe"; ".pdb"; ".mdb"]
else [".xml"; ".dll"; ".exe"; ".mdb"]
| ProjectInfo(core, optional) ->
if core.Symbols || optional.IncludePdbs then [".xml"; ".dll"; ".exe"; ".pdb"; ".mdb"]
else [".xml"; ".dll"; ".exe"; ".mdb"]
let isValidExtension =
[".xml"; ".dll"; ".exe"; ".pdb"; ".mdb"]
validExtensions
|> List.exists (String.equalsIgnoreCase fi.Extension)
isSameFileName && isValidExtension)
)
Expand Down
24 changes: 19 additions & 5 deletions src/Paket.Core/PackageProcess.fs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,15 @@ let private merge buildConfig buildPlatform versionFromAssembly specificVersions
| Valid completeCore -> { templateFile with Contents = CompleteInfo(completeCore, mergedOpt) }
| _ -> templateFile

let private convertToNormal (symbols : bool) templateFile =
match templateFile.Contents with
| CompleteInfo(core, optional) ->
let includePdbs = optional.IncludePdbs
{ templateFile with Contents = CompleteInfo(core, { optional with IncludePdbs = (if symbols then false else includePdbs) }) }
| ProjectInfo(core, optional) ->
let includePdbs = optional.IncludePdbs
{ templateFile with Contents = ProjectInfo(core, { optional with IncludePdbs = (if symbols then false else includePdbs) }) }

let private convertToSymbols (projectFile : ProjectFile) (includeReferencedProjects : bool) templateFile =
let sourceFiles =
let getTarget compileItem =
Expand Down Expand Up @@ -135,7 +144,7 @@ let Pack(workingDir,dependencies : DependenciesFile, packageOutputPath, buildCon
// add dependencies
let allTemplates =
let optWithSymbols projectFile templateFile =
seq { yield templateFile; if symbols then yield templateFile |> convertToSymbols projectFile includeReferencedProjects }
seq { yield (templateFile |> convertToNormal symbols); if symbols then yield templateFile |> convertToSymbols projectFile includeReferencedProjects }

let convertRemainingTemplate fileName =
let templateFile = TemplateFile.Load(fileName,lockFile,version,specificVersions)
Expand All @@ -153,11 +162,16 @@ let Pack(workingDir,dependencies : DependenciesFile, packageOutputPath, buildCon
| _ -> seq { yield templateFile }

projectTemplates
|> Map.map (fun _ (t, p) -> p,findDependencies dependencies buildConfig buildPlatform t p lockDependencies projectTemplates)
|> Map.toList
|> Seq.collect (fun (_,(p,t)) -> t |> optWithSymbols p)
|> Seq.append (allTemplateFiles |> Seq.collect convertRemainingTemplate)
|> Seq.toList
|> Seq.collect(fun (_,(t, p)) ->
seq {
for template in t |> optWithSymbols p do
yield template, p
}
)
|> Seq.map (fun (t, p) -> findDependencies dependencies buildConfig buildPlatform t p lockDependencies projectTemplates)
|> Seq.append (allTemplateFiles |> Seq.collect convertRemainingTemplate)
|> Seq.toList

let excludedTemplates =
match excludedTemplates with
Expand Down
14 changes: 11 additions & 3 deletions src/Paket.Core/TemplateFile.fs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ type OptionalPackagingInfo =
References : string list
FrameworkAssemblyReferences : string list
Files : (string * string) list
FilesExcluded : string list }
FilesExcluded : string list
IncludePdbs : bool}
static member Epmty : OptionalPackagingInfo =
{ Title = None
Owners = []
Expand All @@ -154,7 +155,8 @@ type OptionalPackagingInfo =
References = []
FrameworkAssemblyReferences = []
Files = []
FilesExcluded = [] }
FilesExcluded = []
IncludePdbs = false}

type CompleteInfo = CompleteCoreInfo * OptionalPackagingInfo

Expand Down Expand Up @@ -338,6 +340,11 @@ module internal TemplateFile =

let dependencies = getDependencies(fileName,lockFile,map,currentVersion,specificVersions)
let excludedDependencies = getExcludedDependencies(fileName,lockFile,map,currentVersion)

let includePdbs =
match get "include-pdbs" with
| Some x when String.equalsIgnoreCase x "true" -> true
| _ -> false

{ Title = get "title"
Owners = owners
Expand All @@ -356,7 +363,8 @@ module internal TemplateFile =
References = getReferences map
FrameworkAssemblyReferences = getFrameworkReferences map
Files = getFiles map
FilesExcluded = getFileExcludes map }
FilesExcluded = getFileExcludes map
IncludePdbs = includePdbs }

let Parse(file,lockFile,currentVersion,specificVersions,contentStream : Stream) =
trial {
Expand Down

0 comments on commit c410e75

Please sign in to comment.