Created
February 18, 2025 21:36
-
-
Save 1eyewonder/1352b7c9cd0873d468be9ff39d8b3342 to your computer and use it in GitHub Desktop.
Script to detect why something is rebuilding
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#r "nuget: MSBuild.StructuredLogger" | |
open Microsoft.Build.Logging.StructuredLogger | |
let build = Serialization.Read @"C:\Users\path-here\msbuild-editorconfig.binlog" | |
let (|Message|_|) (b : BaseNode) = | |
match b with | |
| :? Message as m -> Some m | |
| _ -> None | |
let causations = build.FindChildrenRecursive<Target>(fun t -> t.Name = "CoreCompile" && t.Children |> Seq.exists(function Message m -> m.ToString().Contains "is newer than" | _ -> false) ) | |
causations | |
|> Seq.sortBy(fun t -> t.StartTime) | |
|> Seq.iter (fun t -> | |
printfn $"{t.Project} {t.Name}" | |
t.Children | |
|> Seq.iter(fun x -> printfn " %A" <| x) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment