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

Better unknow target handling & build.cmd #954

Merged
merged 3 commits into from
Sep 22, 2015
Merged
Show file tree
Hide file tree
Changes from all 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
7 changes: 4 additions & 3 deletions build.cmd
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@echo off
SETLOCAL

cls

Expand All @@ -12,8 +13,8 @@ if errorlevel 1 (
exit /b %errorlevel%
)

SET TARGET="Default"
SET TARGET=Default

IF NOT [%1]==[] (set TARGET="%1")
IF NOT [%1]==[] (SET TARGET=%~1)

"packages\FAKE\tools\Fake.exe" "build.fsx" "target=%TARGET%"
"packages\FAKE\tools\Fake.exe" "build.fsx" "target="%TARGET%""
8 changes: 4 additions & 4 deletions src/app/FakeLib/TargetHelper.fs
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ let runFinalTargets() =
let watch = new System.Diagnostics.Stopwatch()
watch.Start()
tracefn "Starting FinalTarget: %s" name
TargetDict.[toLower name].Function()
(getTarget name).Function()
addExecutedTarget name watch.Elapsed
with
| exn -> targetError name exn)
Expand All @@ -318,7 +318,7 @@ let runBuildFailureTargets() =
let watch = new System.Diagnostics.Stopwatch()
watch.Start()
tracefn "Starting BuildFailureTarget: %s" name
TargetDict.[toLower name].Function()
(getTarget name).Function()
addExecutedTarget name watch.Elapsed
with
| exn -> targetError name exn)
Expand All @@ -335,15 +335,15 @@ let PrintTargets() =
let private withDependencyType (depType:DependencyType) targets =
targets |> List.map (fun t -> depType, t)

// Helper function for visiting targets in a dependency tree. Retutrns a set containing the names of the all the
// Helper function for visiting targets in a dependency tree. Returns a set containing the names of the all the
// visited targets, and a list containing the targets visited ordered such that dependencies of a target appear earlier
// in the list than the target.
let private visitDependencies fVisit targetName =
let visit fGetDependencies fVisit targetName =
let visited = new HashSet<_>()
let ordered = new List<_>()
let rec visitDependenciesAux level (depType,targetName) =
let target = TargetDict.[toLower targetName]
let target = getTarget targetName
let isVisited = visited.Contains targetName
visited.Add targetName |> ignore
fVisit (target, depType, level, isVisited)
Expand Down