FAKE

A DSL for build tasks and more
The power of F# - anywhere - anytime

Learn more

Bootstrapping

Every project has different needs. Therefore, FAKE supports several ways to bootstrap the build process. From an assumed installation - for example via chocolatey - to automatically updated bootstrapping scripts.

Start now

Migration

Still using FAKE 4? No, your current build scripts will not break, but the development of new features for FAKE 4 and the old way of using FAKE are no longer supported.

Migrate now

A simple build script

This is a simple build script in FAKE. Build scripts can contain multiple targets which can do different things like building your app or publishing it. They are written in F# and can contain references to third party libraries by including them directly or via Paket.
					
						#r "paket:
						nuget Fake.Core.Target //"
						#load "./.fake/build.fsx/intellisense.fsx"

						open Fake.Core

						// Default target
						Target.create "Default" (fun _ ->
							Trace.trace "Hello World from FAKE"
						)

						// start build
						Target.runOrDefault "Default"
					
				

Target dependencies

Targets in your build script might have dependencies on other targets like cleaning up your output folder before building your app. FAKE supports specifying dependencies between your targets. While it might look a bit strange at first, just read it from the bottom to the top.
					
							#r "paket:
							nuget Fake.IO.FileSystem
							nuget Fake.Core.Target //"
							#load "./.fake/build.fsx/intellisense.fsx"

							open Fake.Core
							open Fake.IO

							// Properties
							let buildDir = "./build/"

							// Targets
							Target.create "Clean" (fun _ ->
								Shell.cleanDir buildDir
							)

							Target.create "Default" (fun _ ->
								Trace.trace "Hello World from FAKE"
							)

							// Dependencies
							open Fake.Core.TargetOperators

							"Clean"
								==> "Default"

							// start build
							Target.runOrDefault "Default"
					
				

Globbing

In order to search for files deep down in your folder structure, FAKE supports globbing. The following build script can search for project files in a given folder path and compile them using MSBuild. To give you even more power, FAKE can exclude and include additional files.
					
							#r "paket:
							nuget Fake.IO.FileSystem
							nuget Fake.DotNet.MSBuild
							nuget Fake.Core.Target //"
							#load "./.fake/build.fsx/intellisense.fsx"

							open Fake.IO
							open Fake.IO.Globbing.Operators //enables !! and globbing
							open Fake.DotNet
							open Fake.Core

							// Properties
							let buildDir = "./build/"

							// Targets
							Target.create "Clean" (fun _ ->
								Shell.cleanDir buildDir
							)

							Target.create "BuildApp" (fun _ ->
								!! "src/app/**/*.csproj"
								++ "src/*/*.target"
								-- "src/*/*.vbproj"
								|> MSBuild.runRelease id buildDir "Build"
								|> Trace.logItems "AppBuild-Output: "
							)

							Target.create "Default" (fun _ ->
								Trace.trace "Hello World from FAKE"
							)

							open Fake.Core.TargetOperators

							"Clean"
								==> "BuildApp"
								==> "Default"

							// start build
							Target.runOrDefault "Default"