Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FAKE template domain specific language choice #2177

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions help/markdown/fake-template.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ Specifies your prefered way to define the nuget packages used in your build:
- `inline` - Defines build dependencies inside the build script
- `none` - Use this if you already have a `paket.dependencies` in your folder

### --dsl
Specifies your prefered way to define build tasks inside your build script:

- `fake` (default) - Uses the default FAKE domain specific language
- `blackfox` - Uses the BlackFox domain specific language
florianbader marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- `blackfox` - Uses the BlackFox domain specific language
- `buildtask` - Uses a string free domain specific language, called [BuildTask](https:/vbfox/FoxSharp/blob/master/src/BlackFox.Fake.BuildTask/Readme.md)


### --tool-path
Specifies the folder for the fake-cli tool. This parameter is only applicable when `tool` is used for bootstrapping. Defaults to `.fake`.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,20 @@
}
]
},
"dsl": {
"type": "parameter",
"dataType": "choice",
"defaultValue": "fake",
"choices": [{
"choice": "fake",
"description": "Uses the default FAKE domain specific language"
},
{
"choice": "blackfox",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"choice": "blackfox",
"choice": "buildtask",

"description": "Uses the BlackFox domain specific language"
}
]
},
"tool-path": {
"type": "parameter",
"description": "Folder for the FAKE dotnet sdk global tool. This parameter is only applicable when 'tool' is used for bootstrapping",
Expand All @@ -65,7 +79,8 @@
},
"sources": [{
"exclude": "**/.template.config/**/*",
"modifiers": [{
"modifiers": [
{
"exclude": "**/fake.tool.*",
"condition": "(bootstrap != \"tool\")"
},
Expand All @@ -88,6 +103,28 @@
{
"exclude": "**/paket.dependencies",
"condition": "(dependencies != \"file\")"
},
{
"exclude": "**/fake.tool.*",
"condition": "(bootstrap != \"tool\")"
},
{
"exclude": "**/build.fake.*",
"condition": "(dsl != \"fake\")"
},
{
"rename": {
"build.fake.fsx": "build.fsx"
}
},
{
"exclude": "**/build.blackfox.*",
"condition": "(dsl != \"blackfox\")"
},
{
"rename": {
"build.blackfox.fsx": "build.fsx"
}
}
]
}],
Expand Down
34 changes: 34 additions & 0 deletions src/template/fake-template/Content/build.blackfox.fsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
//#if (dependencies == "inline" && dsl == "fake")
florianbader marked this conversation as resolved.
Show resolved Hide resolved
#r "paket:
nuget Fake.DotNet.Cli
nuget Fake.IO.FileSystem
nuget Fake.Core.Target //"
//#elseif (dependencies == "inline" && dsl == "blackfox")
#r "paket:
nuget Fake.DotNet.Cli
nuget Fake.IO.FileSystem
nuget Fake.Core.Target
nuget BlackFox.Fake.BuildTask //"
//#endif
#load ".fake/(build.fsx)/intellisense.fsx"
open Fake.Core
open Fake.DotNet
open Fake.IO
open Fake.IO.FileSystemOperators
open Fake.IO.Globbing.Operators
open BlackFox.Fake

let clean = BuildTask.create "Clean" [] {
!! "src/**/bin"
++ "src/**/obj"
|> Shell.cleanDirs
}

let build = BuildTask.create "Build" [clean.IfNeeded] {
!! "src/**/*.*proj"
|> Seq.iter (DotNet.build id)
}

let _all = BuildTask.createEmpty "All" [clean; build]

BuildTask.runOrDefault _all
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
//#if (dependencies == "inline")
//#if (dependencies == "inline" && dsl == "fake")
florianbader marked this conversation as resolved.
Show resolved Hide resolved
#r "paket:
nuget Fake.DotNet.Cli
nuget Fake.IO.FileSystem
nuget Fake.Core.Target //"
//#elseif (dependencies == "inline" && dsl == "blackfox")
#r "paket:
nuget Fake.DotNet.Cli
nuget Fake.IO.FileSystem
nuget Fake.Core.Target
nuget BlackFox.Fake.BuildTask //"
//#endif
#load ".fake/(build.fsx)/intellisense.fsx"
open Fake.Core
Expand Down
5 changes: 4 additions & 1 deletion src/template/fake-template/Content/paket.dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@ group Build
source https://api.nuget.org/v3/index.json
nuget Fake.DotNet.Cli
nuget Fake.IO.FileSystem
nuget Fake.Core.Target
nuget Fake.Core.Target
//#if (dsl == "blackfox")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
//#if (dsl == "blackfox")
//#if (dsl == "buildtask")

nuget BlackFox.Fake.BuildTask
//#endif