Skip to content

Commit

Permalink
consider soft targets
Browse files Browse the repository at this point in the history
  • Loading branch information
matthid committed May 17, 2018
1 parent 3898b50 commit 0cba748
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/app/Fake.Core.Target/Target.fs
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,8 @@ module Target =
let body (inbox:MailboxProcessor<RunnerHelper>) = async {
let targetCount =
order |> Seq.sumBy (fun t -> t.Length)
let resolution = Set.ofSeq(order |> Seq.concat |> Seq.map (fun t -> t.Name))
let inResolution (t:string) = resolution.Contains t
let mutable ctx = ctx
let mutable waitList = []
let mutable runningTasks = []
Expand All @@ -537,10 +539,11 @@ module Target =
waitList <- []
reply.Reply (ctx, async.Return None)
else

let isRunnable (t:Target) =
not (known.ContainsKey t.Name) && // not already finised
not (runningTasks |> Seq.exists (fun r -> r.Name = t.Name)) && // not already running
t.Dependencies // all dependencies finished
t.Dependencies @ List.filter inResolution t.SoftDependencies // all dependencies finished
|> Seq.forall (fun d -> known.ContainsKey d)
let runnable =
order
Expand Down

0 comments on commit 0cba748

Please sign in to comment.