Skip to content

Commit

Permalink
expose TemplateFile types and Dependencies member
Browse files Browse the repository at this point in the history
  • Loading branch information
krgn committed Nov 8, 2015
1 parent b8152a7 commit cb21e34
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
8 changes: 8 additions & 0 deletions src/Paket.Core/PublicAPI.fs
Original file line number Diff line number Diff line change
Expand Up @@ -470,3 +470,11 @@ type Dependencies(dependenciesFileName: string) =
failwithf "Could not push package %s. Please specify a NuGet API key via environment variable \"nugetkey\"." packageFileName
let maxTrials = defaultArg maxTrials 5
RemoteUpload.Push maxTrials urlWithEndpoint apiKey packageFileName

// lists all `TemplateFile`s in the current solution
member this.ListTemplateFiles() : TemplateFile list =
let lockFile = getLockFile()
ProjectFile.FindAllProjects(this.RootPath)
|> Array.choose (fun p -> ProjectFile.FindTemplatesFile(FileInfo(p.FileName)))
|> Array.map (fun path -> TemplateFile.Load(path, lockFile, None))
|> Array.toList
12 changes: 6 additions & 6 deletions src/Paket.Core/TemplateFile.fs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ module private TemplateParser =
Map = Map.empty
}

type internal CompleteCoreInfo =
type CompleteCoreInfo =
{ Id : string
Version : SemVerInfo option
Authors : string list
Expand All @@ -100,7 +100,7 @@ type internal CompleteCoreInfo =
| None -> failwithf "No version given for %s" this.Id
member this.NuspecFileName = this.Id + ".nuspec"

type internal ProjectCoreInfo =
type ProjectCoreInfo =
{ Id : string option
Version : SemVerInfo option
Authors : string list option
Expand All @@ -111,7 +111,7 @@ type internal ProjectCoreInfo =
Version = None
Description = None }

type internal OptionalPackagingInfo =
type OptionalPackagingInfo =
{ Title : string option
Owners : string list
ReleaseNotes : string option
Expand Down Expand Up @@ -150,13 +150,13 @@ type internal OptionalPackagingInfo =
Files = []
FilesExcluded = [] }

type internal CompleteInfo = CompleteCoreInfo * OptionalPackagingInfo
type CompleteInfo = CompleteCoreInfo * OptionalPackagingInfo

type internal TemplateFileContents =
type TemplateFileContents =
| CompleteInfo of CompleteInfo
| ProjectInfo of ProjectCoreInfo * OptionalPackagingInfo

type internal TemplateFile =
type TemplateFile =
{ FileName : string
Contents : TemplateFileContents }

Expand Down

0 comments on commit cb21e34

Please sign in to comment.