public void BuildSucceeded(BuildInstance instance)
{
// build succeeded; create/update the history entry
var entry = new HistoryEntry();
entry.Byproducts = instance.Byproducts.Select(b => b.ToLower()).ToSet();
var node = instance.Pipeline;
while (node != null)
{
entry.StageTypes.Add(node.GetType());
entry.StageHashes.Add(node.Hash());
node = node.InputNode;
}
bool hashInputs = (instance.Env.InputChangeDetection & ChangeDetection.Hash) != 0;
foreach (var input in instance.Inputs)
entry.InputCache.Add(CreateFileEntry(input, hashInputs));
bool hashOutputs = (instance.Env.OutputChangeDetection & ChangeDetection.Hash) != 0;
entry.OutputCache.Add(CreateFileEntry(instance.OutputPath, hashOutputs));
foreach (var output in instance.Byproducts)
entry.OutputCache.Add(CreateFileEntry(output, hashOutputs));
// add dependent builds
entry.Dependencies.AddRange(instance.Dependencies);
// create entries for each dependent temp build
foreach (var build in instance.TempBuilds)
entry.TempDependencies.Add(CreateTempEntry(build));
history.AddOrUpdate(instance.OutputName.ToLower(), entry, (k, h) => entry);
}