if(!xspOnly)
dest = getDir(destDir, "destination");
File work = getDir(workDir, "working");
File context = getDir(contextDir, "context");
File conf = getConfigurationFile(context);
DefaultContext appContext = new DefaultContext();
appContext.put(Constants.CONTEXT_CLASS_LOADER, Main.class.getClassLoader());
CommandlineContext clContext = new CommandlineContext(contextDir);
clContext.setLogger(log);
appContext.put(Constants.CONTEXT_ENVIRONMENT_CONTEXT, clContext);
DefaultLogKitManager logKitManager = null;
if(logKit != null) {
final FileInputStream fis = new FileInputStream(logKit);
final DefaultConfigurationBuilder builder = new DefaultConfigurationBuilder();
final Configuration logKitConf = builder.build(fis);
logKitManager = new DefaultLogKitManager(Hierarchy.getDefaultHierarchy());
logKitManager.setLogger(log);
final DefaultContext subcontext = new DefaultContext(appContext);
subcontext.put("context-root", contextDir);
logKitManager.contextualize(subcontext);
logKitManager.configure(logKitConf);
logKitManager = logKitManager;
if (logger != null) {
log = logKitManager.getLogger(logger);