exportReferencesGraph: Only export in JSON format when in structured mode
This prevents breaking compatibility with builders that read "closure.*", since they would accidentally pick up the new JSON files.
This commit is contained in:
parent
7a65b2470e
commit
1351b0df87
1 changed files with 16 additions and 10 deletions
|
@ -2276,18 +2276,24 @@ void DerivationGoal::doExportReferencesGraph()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Write closure info to <fileName>. */
|
if (!drv->env.count("__json")) {
|
||||||
writeFile(tmpDir + "/" + fileName,
|
|
||||||
worker.store.makeValidityRegistration(paths, false, false));
|
/* Write closure info to <fileName>. */
|
||||||
|
writeFile(tmpDir + "/" + fileName,
|
||||||
|
worker.store.makeValidityRegistration(paths, false, false));
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
/* Write a more comprehensive JSON serialisation to
|
||||||
|
<fileName>. */
|
||||||
|
std::ostringstream str;
|
||||||
|
{
|
||||||
|
JSONPlaceholder jsonRoot(str, true);
|
||||||
|
worker.store.pathInfoToJSON(jsonRoot, paths, false, true);
|
||||||
|
}
|
||||||
|
writeFile(tmpDir + "/" + fileName, str.str());
|
||||||
|
|
||||||
/* Write a more comprehensive JSON serialisation to
|
|
||||||
<fileName>.json. */
|
|
||||||
std::ostringstream str;
|
|
||||||
{
|
|
||||||
JSONPlaceholder jsonRoot(str, true);
|
|
||||||
worker.store.pathInfoToJSON(jsonRoot, paths, false, true);
|
|
||||||
}
|
}
|
||||||
writeFile(tmpDir + "/" + fileName + ".json", str.str());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue