use of org.eclipse.ceylon.common.tool.CeylonBaseTool in project ceylon by eclipse.
the class CeylonTool method setupConfig.
// Here we set up the global configuration for this thread
// if (and only if) the setup deviates from the default
// (meaning `cwd` was set for the given tool)
private CeylonConfig setupConfig(Tool tool) throws IOException {
if (tool instanceof CeylonBaseTool) {
CeylonBaseTool cbt = (CeylonBaseTool) tool;
File cwd = cbt.getCwd();
if (cwd != null && cwd.isDirectory()) {
CeylonConfig config = CeylonConfigFinder.loadDefaultConfig(cwd);
return CeylonConfig.set(config);
}
if (getCwd() != null) {
// If the main tool's `cwd` options is set it
// always overrides the one in the given tool
cbt.setCwd(getCwd());
}
}
return null;
}
Aggregations