Function execution order

1 view
Skip to first unread message

Ryan Taylor

unread,
Aug 9, 2013, 12:22:09 PM8/9/13
to fshar...@googlegroups.com
I have a build.fsx file that looks like this

// include Fake lib
#r @"Tools\FAKE\tools\FakeLib.dll"

open Fake

let GitClean =
    trace "Git clean"
    ExecProcess (fun info ->
       info.FileName <- "git"
       info.Arguments <- "clean -dxf -e *.suo -e *.nupkg -e *.user --dry-run"
    ) (System.TimeSpan.FromMinutes 1.0)

// Clean - implement to clean previous build output
Target "Clean" ( fun _ ->
    trace "Clean"
)

Run "Clean"

When I build this, I notice "Git clean" in the output despite the fact that I did not call GitClean in the "Clean" task.

Why is this and what am I doing wrong?

Thanks,
Ryan

Steffen Forkmann

unread,
Aug 12, 2013, 9:57:06 AM8/12/13
to fshar...@googlegroups.com

Hi,

 

let GitClean is a constant not a function.

 

Try “let GitClean()”

 

Cheers,

Steffen

--
Sie haben diese Nachricht erhalten, weil Sie der Google Groups-Gruppe FAKE - F# Make beigetreten sind.
Um Ihr Abonnement für diese Gruppe zu beenden und keine E-Mails mehr von dieser Gruppe zu erhalten, senden Sie eine Email an fsharpMake+...@googlegroups.com.
Weitere Optionen: https://groups.google.com/groups/opt_out
 
 

Morgan Persson

unread,
Aug 12, 2013, 9:51:40 AM8/12/13
to fshar...@googlegroups.com
GitClean is a value so it gets evaluated.
If you dont want to evaluate GitClean immediatly define it as
let GitClean () =
    // code here
and then you can evaluate it with "gitClean()"
/Morgan



--

Ryan Taylor

unread,
Aug 29, 2013, 8:33:17 AM8/29/13
to fshar...@googlegroups.com
Okay, thanks for the clarification!

Thanks,
Ryan
Reply all
Reply to author
Forward
0 new messages