use of org.walkmod.conf.ProjectConfigurationProvider in project walkmod-core by walkmod.
the class WalkModFacade method addProviderConfig.
/**
* Adds a new provider configuration into the configuration file
*
* @param providerCfg
* provider configuration to add.
* @param recursive
* if the provider config is added recursively to all the submodules.
* @throws Exception
* in case that the walkmod configuration file can't be read.
*/
public void addProviderConfig(ProviderConfig providerCfg, boolean recursive) throws Exception {
long startTime = System.currentTimeMillis();
Exception exception = null;
if (!cfg.exists()) {
init();
}
userDir = new File(System.getProperty("user.dir")).getAbsolutePath();
System.setProperty("user.dir", options.getExecutionDirectory().getAbsolutePath());
try {
ConfigurationManager manager = new ConfigurationManager(cfg, false);
ProjectConfigurationProvider cfgProvider = manager.getProjectConfigurationProvider();
cfgProvider.addProviderConfig(providerCfg, recursive);
} catch (Exception e) {
exception = e;
} finally {
System.setProperty("user.dir", userDir);
updateMsg(startTime, exception);
}
}
Aggregations