Skip to content

Commit

Permalink
fixed sample scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
OlegZee committed May 13, 2018
1 parent a167234 commit 13f565f
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 15 deletions.
8 changes: 4 additions & 4 deletions samples/book/intro.fsx
@@ -1,9 +1,9 @@
//#r @"../../packages/Xake/tools/Xake.Core.dll" // (1)
#r "../../core/bin/Debug/net46/Xake.dll"

#r "paket:
nuget Xake ~> 1.1 prerelease
nuget Xake.Dotnet ~> 1.1 prerelease //" // (1)

open Xake // (2)
open Xake.Tasks.Dotnet // (2.1)
open Xake.Dotnet // (2.1)

do xakeScript { // (3)

Expand Down
10 changes: 5 additions & 5 deletions samples/catch_errors.fsx
@@ -1,14 +1,14 @@
// xake build file
// #r @"../bin/Debug/Xake.Core.dll"
#r "../core/bin/Debug/net46/Xake.dll"
#r "paket: nuget Xake ~> 1.1 prerelease //"

open Xake

do xake {ExecOptions.Default with FileLog = "build.log"; Threads = 4 } {
do xakeScript {

phony "main" (action {
phony "main" (recipe {
do! trace Message "The exception thrown below will be silently ignored"
failwith "some error"
} |> WhenError ignore)

// TODO more examples and tricks

}
3 changes: 2 additions & 1 deletion samples/fake.cmd
@@ -1,5 +1,6 @@
@echo off
REM Install .NET Core (https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-install-script)
REM @powershell -NoProfile -ExecutionPolicy unrestricted -Command "&([scriptblock]::Create((Invoke-WebRequest -useb 'https://dot.net/v1/dotnet-install.ps1'))) -Channel Current"
REM SET PATH=%LOCALAPPDATA%\Microsoft\dotnet;%PATH%
dotnet restore dotnet-fake.csproj
dotnet restore dotnet-fake.csproj -v:quiet
dotnet fake run %*
8 changes: 3 additions & 5 deletions samples/rmdir.fsx
@@ -1,5 +1,4 @@
// #r "../bin/Xake.Core.dll"
#r "../core/bin/Debug/net46/Xake.dll"
#r "paket: nuget Xake ~> 1.1 prerelease //"

open Xake
open Xake.Tasks
Expand All @@ -10,11 +9,10 @@ do xakeScript {
let! opt = getCtxOptions()
do! need ["a/samplefile"; "a/b/samplefile1"]
do! rm {dir "a"}
// let dd = Path.parseDir "*"|> Fileset.listByMask opt.ProjectRoot
// do! trace Level.Command "dd: %A" dd
// TODO more samples to come
}

"a/samplefile" ..> writeText "hello world"
"a/b/samplefile1" ..> writeText "hello world1"
"a/b/samplefile1" ..> writeText "this is another file"
]
}

0 comments on commit 13f565f

Please sign in to comment.