use of org.apache.ivy.core.module.id.ModuleId in project ant-ivy by apache.
the class IvyFindRevision method doExecute.
public void doExecute() throws BuildException {
if (organisation == null) {
throw new BuildException("no organisation provided for ivy findrevision task");
}
if (module == null) {
throw new BuildException("no module name provided for ivy findrevision task");
}
if (revision == null) {
throw new BuildException("no revision provided for ivy findrevision task");
}
Ivy ivy = getIvyInstance();
IvySettings settings = ivy.getSettings();
if (branch == null) {
branch = settings.getDefaultBranch(new ModuleId(organisation, module));
}
ResolvedModuleRevision rmr = ivy.findModule(ModuleRevisionId.newInstance(organisation, module, branch, revision));
if (rmr != null) {
getProject().setProperty(property, rmr.getId().getRevision());
}
}
use of org.apache.ivy.core.module.id.ModuleId in project ant-ivy by apache.
the class IvyOverride method addOverride.
void addOverride(DefaultModuleDescriptor md, IvySettings settings) {
String matcherName = (matcher == null) ? PatternMatcher.EXACT : matcher;
String orgPattern = (org == null) ? PatternMatcher.ANY_EXPRESSION : org;
String modulePattern = (module == null) ? PatternMatcher.ANY_EXPRESSION : module;
md.addDependencyDescriptorMediator(new ModuleId(orgPattern, modulePattern), settings.getMatcher(matcherName), new OverrideDependencyDescriptorMediator(branch, rev));
}
use of org.apache.ivy.core.module.id.ModuleId in project ant-ivy by apache.
the class IvyConflict method addConflict.
void addConflict(DefaultModuleDescriptor md, IvySettings settings) {
String matcherName = (matcher == null) ? PatternMatcher.EXACT : matcher;
String orgPattern = (org == null) ? PatternMatcher.ANY_EXPRESSION : org;
String modulePattern = (module == null) ? PatternMatcher.ANY_EXPRESSION : module;
ConflictManager cm = null;
if (rev != null) {
cm = new FixedConflictManager(splitToArray(rev));
} else if (manager != null) {
cm = settings.getConflictManager(manager);
}
md.addConflictManager(new ModuleId(orgPattern, modulePattern), settings.getMatcher(matcherName), cm);
}
use of org.apache.ivy.core.module.id.ModuleId in project ant-ivy by apache.
the class IvyExclude method asRule.
DefaultExcludeRule asRule(IvySettings settings) {
String matcherName = (matcher == null) ? PatternMatcher.EXACT : matcher;
String orgPattern = (org == null) ? PatternMatcher.ANY_EXPRESSION : org;
String modulePattern = (module == null) ? PatternMatcher.ANY_EXPRESSION : module;
String artifactPattern = (artifact == null) ? PatternMatcher.ANY_EXPRESSION : artifact;
String typePattern = (type == null) ? PatternMatcher.ANY_EXPRESSION : type;
String extPattern = (ext == null) ? typePattern : ext;
ArtifactId aid = new ArtifactId(new ModuleId(orgPattern, modulePattern), artifactPattern, typePattern, extPattern);
return new DefaultExcludeRule(aid, settings.getMatcher(matcherName), null);
}
use of org.apache.ivy.core.module.id.ModuleId in project ant-ivy by apache.
the class IvyRepositoryReport method genreport.
private void genreport(ResolutionCacheManager cache, String organisation, String module) {
// first process the report with xslt
XSLTProcess xslt = new XSLTProcess();
xslt.setTaskName(getTaskName());
xslt.setProject(getProject());
xslt.init();
String resolveId = ResolveOptions.getDefaultResolveId(new ModuleId(organisation, module));
xslt.setIn(cache.getConfigurationResolveReportInCache(resolveId, "default"));
xslt.setOut(new File(getTodir(), outputname + "." + xslext));
xslt.setStyle(xslFile);
XSLTProcess.Param xslExt = xslt.createParam();
xslExt.setName("extension");
xslExt.setExpression(xslext);
// add the provided XSLT parameters
for (XSLTProcess.Param param : params) {
XSLTProcess.Param realParam = xslt.createParam();
realParam.setName(param.getName());
realParam.setExpression(param.getExpression());
}
xslt.execute();
}
Aggregations