Skip to content

Commit

Permalink
* Fix FakeLib.fsproj
Browse files Browse the repository at this point in the history
* Added WithLogParams and WithBuildParams
  • Loading branch information
kblohm committed Apr 15, 2018
1 parent 71c8923 commit a4f6783
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 2,719 deletions.
58 changes: 27 additions & 31 deletions Fake.sln
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Core.CommandLine.UnitT
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Documentation.DocFx", "src\app\Fake.Documentation.DocFx\Fake.Documentation.DocFx.fsproj", "{77E0066D-A04D-445B-B036-9008A40F8A44}"
EndProject
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Fake.Api.HockeyApp", "src/app/Fake.Api.HockeyApp/Fake.Api.HockeyApp.fsproj", "{B636A082-4DB4-439D-8A37-E5214BDC00A3}"
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Api.HockeyApp", "src\app\Fake.Api.HockeyApp\Fake.Api.HockeyApp.fsproj", "{B636A082-4DB4-439D-8A37-E5214BDC00A3}"
EndProject
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Fake.JavaScript.Yarn", "src/app/Fake.JavaScript.Yarn/Fake.JavaScript.Yarn.fsproj", "{DE7579F2-C20F-4C35-BC04-C10362912243}"
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.JavaScript.Yarn", "src\app\Fake.JavaScript.Yarn\Fake.JavaScript.Yarn.fsproj", "{DE7579F2-C20F-4C35-BC04-C10362912243}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -668,34 +668,6 @@ Global
{8561A35A-C2A4-43C7-A938-CB35A7747121}.Debug|x86.Build.0 = Debug|Any CPU
{8561A35A-C2A4-43C7-A938-CB35A7747121}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8561A35A-C2A4-43C7-A938-CB35A7747121}.Release|Any CPU.Build.0 = Release|Any CPU
{8561A35A-C2A4-43C7-A938-CB35A7747121}.Release|x64.ActiveCfg = Release|x64
{8561A35A-C2A4-43C7-A938-CB35A7747121}.Release|x64.Build.0 = Release|x64
{8561A35A-C2A4-43C7-A938-CB35A7747121}.Release|x86.ActiveCfg = Release|x86
{8561A35A-C2A4-43C7-A938-CB35A7747121}.Release|x86.Build.0 = Release|x86
{B636A082-4DB4-439D-8A37-E5214BDC00A3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B636A082-4DB4-439D-8A37-E5214BDC00A3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B636A082-4DB4-439D-8A37-E5214BDC00A3}.Debug|x64.ActiveCfg = Debug|x64
{B636A082-4DB4-439D-8A37-E5214BDC00A3}.Debug|x64.Build.0 = Debug|x64
{B636A082-4DB4-439D-8A37-E5214BDC00A3}.Debug|x86.ActiveCfg = Debug|x86
{B636A082-4DB4-439D-8A37-E5214BDC00A3}.Debug|x86.Build.0 = Debug|x86
{B636A082-4DB4-439D-8A37-E5214BDC00A3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B636A082-4DB4-439D-8A37-E5214BDC00A3}.Release|Any CPU.Build.0 = Release|Any CPU
{B636A082-4DB4-439D-8A37-E5214BDC00A3}.Release|x64.ActiveCfg = Release|x64
{B636A082-4DB4-439D-8A37-E5214BDC00A3}.Release|x64.Build.0 = Release|x64
{B636A082-4DB4-439D-8A37-E5214BDC00A3}.Release|x86.ActiveCfg = Release|x86
{B636A082-4DB4-439D-8A37-E5214BDC00A3}.Release|x86.Build.0 = Release|x86
{DE7579F2-C20F-4C35-BC04-C10362912243}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DE7579F2-C20F-4C35-BC04-C10362912243}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DE7579F2-C20F-4C35-BC04-C10362912243}.Debug|x64.ActiveCfg = Debug|x64
{DE7579F2-C20F-4C35-BC04-C10362912243}.Debug|x64.Build.0 = Debug|x64
{DE7579F2-C20F-4C35-BC04-C10362912243}.Debug|x86.ActiveCfg = Debug|x86
{DE7579F2-C20F-4C35-BC04-C10362912243}.Debug|x86.Build.0 = Debug|x86
{DE7579F2-C20F-4C35-BC04-C10362912243}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DE7579F2-C20F-4C35-BC04-C10362912243}.Release|Any CPU.Build.0 = Release|Any CPU
{DE7579F2-C20F-4C35-BC04-C10362912243}.Release|x64.ActiveCfg = Release|x64
{DE7579F2-C20F-4C35-BC04-C10362912243}.Release|x64.Build.0 = Release|x64
{DE7579F2-C20F-4C35-BC04-C10362912243}.Release|x86.ActiveCfg = Release|x86
{DE7579F2-C20F-4C35-BC04-C10362912243}.Release|x86.Build.0 = Release|x86
{8561A35A-C2A4-43C7-A938-CB35A7747121}.Release|x64.ActiveCfg = Release|Any CPU
{8561A35A-C2A4-43C7-A938-CB35A7747121}.Release|x64.Build.0 = Release|Any CPU
{8561A35A-C2A4-43C7-A938-CB35A7747121}.Release|x86.ActiveCfg = Release|Any CPU
Expand All @@ -712,6 +684,30 @@ Global
{77E0066D-A04D-445B-B036-9008A40F8A44}.Release|x64.Build.0 = Release|Any CPU
{77E0066D-A04D-445B-B036-9008A40F8A44}.Release|x86.ActiveCfg = Release|Any CPU
{77E0066D-A04D-445B-B036-9008A40F8A44}.Release|x86.Build.0 = Release|Any CPU
{B636A082-4DB4-439D-8A37-E5214BDC00A3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B636A082-4DB4-439D-8A37-E5214BDC00A3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B636A082-4DB4-439D-8A37-E5214BDC00A3}.Debug|x64.ActiveCfg = Debug|Any CPU
{B636A082-4DB4-439D-8A37-E5214BDC00A3}.Debug|x64.Build.0 = Debug|Any CPU
{B636A082-4DB4-439D-8A37-E5214BDC00A3}.Debug|x86.ActiveCfg = Debug|Any CPU
{B636A082-4DB4-439D-8A37-E5214BDC00A3}.Debug|x86.Build.0 = Debug|Any CPU
{B636A082-4DB4-439D-8A37-E5214BDC00A3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B636A082-4DB4-439D-8A37-E5214BDC00A3}.Release|Any CPU.Build.0 = Release|Any CPU
{B636A082-4DB4-439D-8A37-E5214BDC00A3}.Release|x64.ActiveCfg = Release|Any CPU
{B636A082-4DB4-439D-8A37-E5214BDC00A3}.Release|x64.Build.0 = Release|Any CPU
{B636A082-4DB4-439D-8A37-E5214BDC00A3}.Release|x86.ActiveCfg = Release|Any CPU
{B636A082-4DB4-439D-8A37-E5214BDC00A3}.Release|x86.Build.0 = Release|Any CPU
{DE7579F2-C20F-4C35-BC04-C10362912243}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DE7579F2-C20F-4C35-BC04-C10362912243}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DE7579F2-C20F-4C35-BC04-C10362912243}.Debug|x64.ActiveCfg = Debug|Any CPU
{DE7579F2-C20F-4C35-BC04-C10362912243}.Debug|x64.Build.0 = Debug|Any CPU
{DE7579F2-C20F-4C35-BC04-C10362912243}.Debug|x86.ActiveCfg = Debug|Any CPU
{DE7579F2-C20F-4C35-BC04-C10362912243}.Debug|x86.Build.0 = Debug|Any CPU
{DE7579F2-C20F-4C35-BC04-C10362912243}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DE7579F2-C20F-4C35-BC04-C10362912243}.Release|Any CPU.Build.0 = Release|Any CPU
{DE7579F2-C20F-4C35-BC04-C10362912243}.Release|x64.ActiveCfg = Release|Any CPU
{DE7579F2-C20F-4C35-BC04-C10362912243}.Release|x64.Build.0 = Release|Any CPU
{DE7579F2-C20F-4C35-BC04-C10362912243}.Release|x86.ActiveCfg = Release|Any CPU
{DE7579F2-C20F-4C35-BC04-C10362912243}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -765,9 +761,9 @@ Global
{CA6EB1B3-EB3A-4063-8A6C-DE099A53A8B1} = {901F162F-8925-4390-89C5-9EE2C343F744}
{E09B72E4-D890-46A8-8D14-7367C2E23E9D} = {539D7B9A-18A1-4D79-86AB-C8B48090CA84}
{8561A35A-C2A4-43C7-A938-CB35A7747121} = {E09B72E4-D890-46A8-8D14-7367C2E23E9D}
{77E0066D-A04D-445B-B036-9008A40F8A44} = {7BFFAE76-DEE9-417A-A79B-6A6644C4553A}
{B636A082-4DB4-439D-8A37-E5214BDC00A3} = {901F162F-8925-4390-89C5-9EE2C343F744}
{DE7579F2-C20F-4C35-BC04-C10362912243} = {901F162F-8925-4390-89C5-9EE2C343F744}
{77E0066D-A04D-445B-B036-9008A40F8A44} = {7BFFAE76-DEE9-417A-A79B-6A6644C4553A}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {058A0C5E-2216-4306-8AFB-0AE28320C26A}
Expand Down
50 changes: 33 additions & 17 deletions src/app/Fake.Documentation.DocFx/DocFx.fs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ type LogLevel = | Diagnostic
| Warning
| Error
/// Parameters for logging
type LogParams = {
type LogParams =
{
/// Specify the file name to save processing log.
LogFilePath : string

Expand Down Expand Up @@ -149,7 +150,8 @@ let private parseLogParams p =
stringParam ("correlationId", p.CorrelationId) ]

/// Build-Command parameters
type BuildParams = {
type BuildParams =
{
/// The tool path - FAKE tries to find docfx.exe automatically in any sub folder.
ToolPath : string

Expand Down Expand Up @@ -267,6 +269,9 @@ type BuildParams = {
/// Specify Logging parameter
LogParams : LogParams
}
/// Changes the "LogParams" according to the given function
member inline x.WithLogParams f =
{ x with LogParams = f x.LogParams }

/// Build default parameters
let defaultBuildParams =
Expand Down Expand Up @@ -375,7 +380,8 @@ let build setParams =
|> run p.ToolPath p.Timeout

/// Pdf-Command parameters
type PdfParams = {
type PdfParams =
{
/// The tool path - FAKE tries to find docfx.exe automatically in any sub folder.
ToolPath : string

Expand Down Expand Up @@ -416,7 +422,13 @@ type PdfParams = {
BasePath : string
/// Specify build parameters.
BuildParams : BuildParams
}
}
/// Changes the "BuildParams" according to the given function
member inline x.WithBuildParams f =
{ x with BuildParams = f x.BuildParams }
/// Changes the "LogParams" according to the given function
member inline x.WithLogParams f =
x.WithBuildParams (fun b -> b.WithLogParams f)

/// Pdf default parameters
let defaultPdfParams =
Expand Down Expand Up @@ -462,24 +474,24 @@ let private serializePdfParams p =
/// ## Sample
///
/// DocFx.pdf (fun p ->
/// let buildParams =
/// { p.BuildParams with
/// OutputFolder = "build" @@ "docs"
/// ConfigFile = "docs" @@ "docfx.json"
/// }
/// { p with
/// BuildParams = buildParams
/// Name = "Docs.pdf"
/// })
/// DocFs.pdf (fun p ->
/// { p.WithBuildParams (fun b ->
/// {b with
/// OutputFolder = "build" @@ "docs"
/// ConfigFile = "docs" @@ "docfx.json"})
/// with
/// Name = "Docs.pdf" })

let pdf setParams =
let p = defaultPdfParams |> setParams
p
|> serializePdfParams
|> sprintf "pdf %s %s" p.BuildParams.ConfigFile
|> run p.ToolPath p.Timeout




/// ExportTemplate-Command parameters
type ExportTemplateParams = {

Expand Down Expand Up @@ -635,7 +647,8 @@ let serve setParams =
|> run p.ToolPath p.Timeout

/// Metadata-Command parameters
type MetadataParams = {
type MetadataParams =
{
/// The tool path - FAKE tries to find docfx.exe automatically in any sub folder.
ToolPath : string

Expand Down Expand Up @@ -675,7 +688,10 @@ type MetadataParams = {
/// Specify Logging parameter
LogParams : LogParams

}
}
/// Changes the "LogParams" according to the given function
member inline x.WithLogParams f =
{ x with LogParams = f x.LogParams }

let defaultMetadataParams =
{
Expand Down
Loading

0 comments on commit a4f6783

Please sign in to comment.