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()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!drv->env.count("__json")) {
|
||||||
|
|
||||||
/* Write closure info to <fileName>. */
|
/* Write closure info to <fileName>. */
|
||||||
writeFile(tmpDir + "/" + fileName,
|
writeFile(tmpDir + "/" + fileName,
|
||||||
worker.store.makeValidityRegistration(paths, false, false));
|
worker.store.makeValidityRegistration(paths, false, false));
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
/* Write a more comprehensive JSON serialisation to
|
/* Write a more comprehensive JSON serialisation to
|
||||||
<fileName>.json. */
|
<fileName>. */
|
||||||
std::ostringstream str;
|
std::ostringstream str;
|
||||||
{
|
{
|
||||||
JSONPlaceholder jsonRoot(str, true);
|
JSONPlaceholder jsonRoot(str, true);
|
||||||
worker.store.pathInfoToJSON(jsonRoot, paths, false, true);
|
worker.store.pathInfoToJSON(jsonRoot, paths, false, true);
|
||||||
}
|
}
|
||||||
writeFile(tmpDir + "/" + fileName + ".json", str.str());
|
writeFile(tmpDir + "/" + fileName, str.str());
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue