@@ -10,7 +10,6 @@ type ChangeReason =
1010 | NotChanged
1111 | Depends of Target
1212 | DependsMissingTarget of Target
13- | Refs of string list
1413 | FilesChanged of string list
1514 | Other of string
1615
@@ -25,10 +24,6 @@ let getExecTime ctx target =
2524 ( fun ch -> Storage.GetResult( target, ch)) |> ctx.Db.PostAndReply
2625 |> Option.fold ( fun _ r -> r.Steps |> List.sumBy ( fun s -> s.OwnTime)) 0 < ms>
2726
28- let targetName = function
29- | PhonyAction a -> a
30- | FileTarget file -> file.Name
31-
3227/// Gets single dependency state and reason of a change.
3328let getDepState getVar getFileList ( getChangedDeps : Target -> ChangeReason list ) = function
3429 | FileDep ( a: File, wrtime) when not (( File.exists a) && abs(( File.getLastWriteTime a - wrtime) .TotalMilliseconds) < TimeCompareToleranceMs) ->
@@ -111,8 +106,13 @@ let getChangeReasons ctx getTargetDeps target =
111106
112107// gets task duration and list of targets it depends on. No clue why one method does both.
113108let getDurationDeps ctx getDeps t =
114- let collectTargets = List.collect ( function | Depends t | DependsMissingTarget t -> [ t] | _ -> [])
115- getExecTime ctx t, getDeps t |> collectTargets
109+ let deps = getDeps t |> List.collect ( function | Depends t | DependsMissingTarget t -> [ t] | _ -> [])
110+ match deps with
111+ | [] -> 0 < ms>, []
112+ | _ -> ( getExecTime ctx t, deps)
113+ // |> fun (tt,dd) ->
114+ // printfn "For task %A duration:%A deps:%A" t tt dd
115+ // (tt,dd)
116116
117117/// Dumps all dependencies for particular target
118118let dumpDeps ( ctx : ExecContext ) ( target : Target list ) =
0 commit comments