Skip to content

Instantly share code, notes, and snippets.

@MiloszKrajewski
Last active April 2, 2017 21:22
Show Gist options
  • Save MiloszKrajewski/2ae6fbd7b1f694794139c7a23690da46 to your computer and use it in GitHub Desktop.
Save MiloszKrajewski/2ae6fbd7b1f694794139c7a23690da46 to your computer and use it in GitHub Desktop.
F#ake batch file / bootstrapper
#r ".fake/FakeLib.dll"
open Fake
let build = MSBuild "" "Build" [ ("Configuration", "Release"); ("Platform", "Any CPU") ] >> ignore
Target "Clear" (fun _ ->
!! "**/bin/" ++ "**/obj/" |> DeleteDirs
)
Target "Purge" (fun _ ->
DeleteDir "packages"
)
Target "Build" (fun _ ->
!! "*.sln" |> build
)
Target "Restore" (fun _ -> RestorePackages ())
"Clear" ==> "Purge"
RunTargetOrDefault "Build"
@echo off
setlocal
set fake=%~dp0\.fake\fake.exe
if not exist %fake% (
pushd %~dp0
rmdir /q /s %temp%\nuget\fake 2> nul
nuget install -out %temp%\nuget -excludeversion fake
xcopy %temp%\nuget\fake\tools\* .\.fake\
popd
)
%fake% %*
endlocal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment