From 0cba748797e5832bf67af6346fcc252cbe932b4f Mon Sep 17 00:00:00 2001 From: Matthias Dittrich Date: Thu, 17 May 2018 17:13:39 +0200 Subject: [PATCH] consider soft targets --- src/app/Fake.Core.Target/Target.fs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/app/Fake.Core.Target/Target.fs b/src/app/Fake.Core.Target/Target.fs index 4b36130afe7..1d6556e5ed2 100644 --- a/src/app/Fake.Core.Target/Target.fs +++ b/src/app/Fake.Core.Target/Target.fs @@ -511,6 +511,8 @@ module Target = let body (inbox:MailboxProcessor) = 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 = [] @@ -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