Search in sources :

Example 1 with CeylonBaseTool

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;
}
Also used : CeylonBaseTool(org.eclipse.ceylon.common.tool.CeylonBaseTool) CeylonConfig(org.eclipse.ceylon.common.config.CeylonConfig) File(java.io.File)

Aggregations

File (java.io.File)1 CeylonConfig (org.eclipse.ceylon.common.config.CeylonConfig)1 CeylonBaseTool (org.eclipse.ceylon.common.tool.CeylonBaseTool)1