You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ivy-commits@incubator.apache.org by xa...@apache.org on 2007/06/26 19:34:09 UTC
svn commit: r550916 [2/2] -
/incubator/ivy/core/trunk/src/java/org/apache/ivy/ant/
Modified: incubator/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyReport.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyReport.java?view=diff&rev=550916&r1=550915&r2=550916
==============================================================================
--- incubator/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyReport.java (original)
+++ incubator/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyReport.java Tue Jun 26 12:34:08 2007
@@ -42,166 +42,172 @@
* This ant task let users generates reports (html, xml, graphml, ...) from the last resolve done.
*/
public class IvyReport extends IvyTask {
- private File _todir;
+ private File todir;
- private String _organisation;
+ private String organisation;
- private String _module;
+ private String module;
- private String _conf;
+ private String conf;
- private File _cache;
+ private File cache;
- private boolean _graph = true;
+ private boolean graph = true;
- private boolean _dot = false;
+ private boolean dot = false;
- private boolean _xml = false;
+ private boolean xml = false;
- private boolean _xsl = true;
+ private boolean xsl = true;
- private String _xslFile;
+ private String xslFile;
- private String _outputpattern;
+ private String outputpattern;
- private String _xslext = "html";
+ private String xslext = "html";
- private List _params = new ArrayList();
+ private List params = new ArrayList();
- private String _resolveId;
+ private String resolveId;
public File getTodir() {
- return _todir;
+ return todir;
}
public void setTodir(File todir) {
- _todir = todir;
+ this.todir = todir;
}
public File getCache() {
- return _cache;
+ return cache;
}
public void setCache(File cache) {
- _cache = cache;
+ this.cache = cache;
}
public String getConf() {
- return _conf;
+ return conf;
}
public void setConf(String conf) {
- _conf = conf;
+ this.conf = conf;
}
public String getModule() {
- return _module;
+ return module;
}
public void setModule(String module) {
- _module = module;
+ this.module = module;
}
public String getOrganisation() {
- return _organisation;
+ return organisation;
}
public void setOrganisation(String organisation) {
- _organisation = organisation;
+ this.organisation = organisation;
}
public boolean isGraph() {
- return _graph;
+ return graph;
}
public void setGraph(boolean graph) {
- _graph = graph;
+ this.graph = graph;
}
public String getXslfile() {
- return _xslFile;
+ return xslFile;
}
public void setXslfile(String xslFile) {
- _xslFile = xslFile;
+ this.xslFile = xslFile;
}
public String getOutputpattern() {
- return _outputpattern;
+ return outputpattern;
}
public void setOutputpattern(String outputpattern) {
- _outputpattern = outputpattern;
+ this.outputpattern = outputpattern;
}
public String getResolveId() {
- return _resolveId;
+ return resolveId;
}
public void setResolveId(String resolveId) {
- _resolveId = resolveId;
+ this.resolveId = resolveId;
}
public void doExecute() throws BuildException {
Ivy ivy = getIvyInstance();
IvySettings settings = ivy.getSettings();
- _organisation = getProperty(_organisation, settings, "ivy.organisation", _resolveId);
- _module = getProperty(_module, settings, "ivy.module", _resolveId);
- if (_cache == null) {
- _cache = settings.getDefaultCache();
- }
- _conf = getProperty(_conf, settings, "ivy.resolved.configurations", _resolveId);
- if ("*".equals(_conf)) {
- _conf = getProperty(settings, "ivy.resolved.configurations", _resolveId);
+ organisation = getProperty(organisation, settings, "ivy.organisation", resolveId);
+ module = getProperty(module, settings, "ivy.module", resolveId);
+ if (cache == null) {
+ cache = settings.getDefaultCache();
+ }
+ conf = getProperty(conf, settings, "ivy.resolved.configurations", resolveId);
+ if ("*".equals(conf)) {
+ conf = getProperty(settings, "ivy.resolved.configurations", resolveId);
}
- if (_conf == null) {
+ if (conf == null) {
throw new BuildException(
- "no conf provided for ivy report task: It can either be set explicitely via the attribute 'conf' or via 'ivy.resolved.configurations' property or a prior call to <resolve/>");
+ "no conf provided for ivy report task: "
+ + "It can either be set explicitely via the attribute 'conf' or"
+ + "via 'ivy.resolved.configurations' property or a prior call to <resolve/>");
}
- if (_todir == null) {
+ if (todir == null) {
String t = getProperty(settings, "ivy.report.todir");
if (t != null) {
- _todir = new File(t);
+ todir = new File(t);
}
}
- _outputpattern = getProperty(_outputpattern, settings, "ivy.report.output.pattern");
- if (_todir != null && _todir.exists()) {
- _todir.mkdirs();
+ outputpattern = getProperty(outputpattern, settings, "ivy.report.output.pattern");
+ if (todir != null && todir.exists()) {
+ todir.mkdirs();
}
- if (_outputpattern == null) {
- _outputpattern = "[organisation]-[module]-[conf].[ext]";
+ if (outputpattern == null) {
+ outputpattern = "[organisation]-[module]-[conf].[ext]";
}
- if (_todir != null && _todir.exists() && !_todir.isDirectory()) {
+ if (todir != null && todir.exists() && !todir.isDirectory()) {
throw new BuildException("destination directory should be a directory !");
}
- if (_organisation == null) {
+ if (organisation == null) {
throw new BuildException(
- "no organisation provided for ivy report task: It can either be set explicitely via the attribute 'organisation' or via 'ivy.organisation' property or a prior call to <resolve/>");
+ "no organisation provided for ivy report task: "
+ + "It can either be set explicitely via the attribute 'organisation' or "
+ + "via 'ivy.organisation' property or a prior call to <resolve/>");
}
- if (_module == null) {
+ if (module == null) {
throw new BuildException(
- "no module name provided for ivy report task: It can either be set explicitely via the attribute 'module' or via 'ivy.module' property or a prior call to <resolve/>");
+ "no module name provided for ivy report task: "
+ + "It can either be set explicitely via the attribute 'module' or "
+ + "via 'ivy.module' property or a prior call to <resolve/>");
}
- if (_resolveId == null) {
- _resolveId = ResolveOptions.getDefaultResolveId(new ModuleId(_organisation, _module));
+ if (resolveId == null) {
+ resolveId = ResolveOptions.getDefaultResolveId(new ModuleId(organisation, module));
}
try {
- String[] confs = splitConfs(_conf);
- if (_xsl) {
- genreport(_cache, _organisation, _module, confs);
+ String[] confs = splitConfs(conf);
+ if (xsl) {
+ genreport(cache, organisation, module, confs);
}
- if (_xml) {
- genxml(_cache, _organisation, _module, confs);
+ if (xml) {
+ genxml(cache, organisation, module, confs);
}
- if (_graph) {
- genStyled(_cache, _organisation, _module, confs, getStylePath(_cache,
+ if (graph) {
+ genStyled(cache, organisation, module, confs, getStylePath(cache,
"ivy-report-graph.xsl"), "graphml");
}
- if (_dot) {
- genStyled(_cache, _organisation, _module, confs, getStylePath(_cache,
+ if (dot) {
+ genStyled(cache, organisation, module, confs, getStylePath(cache,
"ivy-report-dot.xsl"), "dot");
}
} catch (IOException e) {
@@ -211,16 +217,16 @@
private void genxml(File cache, String organisation, String module, String[] confs)
throws IOException {
- CacheManager cacheMgr = getIvyInstance().getCacheManager(_cache);
+ CacheManager cacheMgr = getIvyInstance().getCacheManager(cache);
for (int i = 0; i < confs.length; i++) {
- File xml = cacheMgr.getConfigurationResolveReportInCache(_resolveId, confs[i]);
+ File xml = cacheMgr.getConfigurationResolveReportInCache(resolveId, confs[i]);
File out;
- if (_todir != null) {
- out = new File(_todir, IvyPatternHelper.substitute(_outputpattern, organisation,
+ if (todir != null) {
+ out = new File(todir, IvyPatternHelper.substitute(outputpattern, organisation,
module, "", "", "", "xml", confs[i]));
} else {
- out = new File(IvyPatternHelper.substitute(_outputpattern, organisation, module,
+ out = new File(IvyPatternHelper.substitute(outputpattern, organisation, module,
"", "", "", "xml", confs[i]));
}
@@ -230,13 +236,13 @@
private void genreport(File cache, String organisation, String module, String[] confs)
throws IOException {
- genStyled(cache, organisation, module, confs, getReportStylePath(cache), _xslext);
+ genStyled(cache, organisation, module, confs, getReportStylePath(cache), xslext);
// copy the css if required
- if (_todir != null && _xslFile == null) {
- File css = new File(_todir, "ivy-report.css");
+ if (todir != null && xslFile == null) {
+ File css = new File(todir, "ivy-report.css");
if (!css.exists()) {
- Message.debug("copying report css to " + _todir);
+ Message.debug("copying report css to " + todir);
FileUtil.copy(XmlReportOutputter.class.getResourceAsStream("ivy-report.css"), css,
null);
}
@@ -246,8 +252,8 @@
}
private String getReportStylePath(File cache) throws IOException {
- if (_xslFile != null) {
- return _xslFile;
+ if (xslFile != null) {
+ return xslFile;
}
// style should be a file (and not an url)
// so we have to copy it from classpath to cache
@@ -260,8 +266,8 @@
String style, String ext) throws IOException {
// process the report with xslt to generate dot file
File out;
- if (_todir != null) {
- out = _todir;
+ if (todir != null) {
+ out = todir;
} else {
out = new File(".");
}
@@ -279,12 +285,12 @@
CacheManager cacheMgr = getIvyInstance().getCacheManager(cache);
for (int i = 0; i < confs.length; i++) {
- File reportFile = cacheMgr.getConfigurationResolveReportInCache(_resolveId, confs[i]);
+ File reportFile = cacheMgr.getConfigurationResolveReportInCache(resolveId, confs[i]);
xslt.setIncludes(reportFile.getName());
FileNameMapper reportMapper = new GlobPatternMapper();
reportMapper.setFrom(reportFile.getName());
- reportMapper.setTo(IvyPatternHelper.substitute(_outputpattern, organisation, module,
+ reportMapper.setTo(IvyPatternHelper.substitute(outputpattern, organisation, module,
"", "", "", ext, confs[i]));
mapper.add(reportMapper);
}
@@ -292,13 +298,13 @@
XSLTProcess.Param param = xslt.createParam();
param.setName("confs");
- param.setExpression(_conf);
+ param.setExpression(conf);
param = xslt.createParam();
param.setName("extension");
- param.setExpression(_xslext);
+ param.setExpression(xslext);
// add the provided XSLT parameters
- for (Iterator it = _params.iterator(); it.hasNext();) {
+ for (Iterator it = params.iterator(); it.hasNext();) {
param = (XSLTProcess.Param) it.next();
XSLTProcess.Param realParam = xslt.createParam();
realParam.setName(param.getName());
@@ -317,41 +323,41 @@
}
public boolean isXml() {
- return _xml;
+ return xml;
}
public void setXml(boolean xml) {
- _xml = xml;
+ this.xml = xml;
}
public boolean isXsl() {
- return _xsl;
+ return xsl;
}
public void setXsl(boolean xsl) {
- _xsl = xsl;
+ this.xsl = xsl;
}
public String getXslext() {
- return _xslext;
+ return xslext;
}
public void setXslext(String xslext) {
- _xslext = xslext;
+ this.xslext = xslext;
}
public XSLTProcess.Param createParam() {
XSLTProcess.Param result = new XSLTProcess.Param();
- _params.add(result);
+ params.add(result);
return result;
}
public boolean isDot() {
- return _dot;
+ return dot;
}
public void setDot(boolean dot) {
- _dot = dot;
+ this.dot = dot;
}
}
Modified: incubator/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyRepositoryReport.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyRepositoryReport.java?view=diff&rev=550916&r1=550915&r2=550916
==============================================================================
--- incubator/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyRepositoryReport.java (original)
+++ incubator/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyRepositoryReport.java Tue Jun 26 12:34:08 2007
@@ -42,87 +42,89 @@
* specified using organisation/module and matcher.
*/
public class IvyRepositoryReport extends IvyTask {
- private String _organisation = "*";
+ private String organisation = "*";
- private String _module;
+ private String module;
- private String _branch;
+ private String branch;
- private String _revision = "latest.integration";
+ private String revision = "latest.integration";
- private File _cache;
+ private File cache;
- private String _matcher = PatternMatcher.EXACT_OR_REGEXP;
+ private String matcher = PatternMatcher.EXACT_OR_REGEXP;
- private File _todir = new File(".");
+ private File todir = new File(".");
- private boolean _graph = false;
+ private boolean graph = false;
- private boolean _dot = false;
+ private boolean dot = false;
- private boolean _xml = true;
+ private boolean xml = true;
- private boolean _xsl = false;
+ private boolean xsl = false;
- private String _xslFile;
+ private String xslFile;
- private String _outputname = "ivy-repository-report";
+ private String outputname = "ivy-repository-report";
- private String _xslext = "html";
+ private String xslext = "html";
- private List _params = new ArrayList();
+ private List params = new ArrayList();
public void doExecute() throws BuildException {
Ivy ivy = getIvyInstance();
IvySettings settings = ivy.getSettings();
- if (_cache == null) {
- _cache = settings.getDefaultCache();
+ if (cache == null) {
+ cache = settings.getDefaultCache();
}
- if (_xsl && _xslFile == null) {
+ if (xsl && xslFile == null) {
throw new BuildException("xsl file is mandatory when using xsl generation");
}
- if (_module == null && PatternMatcher.EXACT.equals(_matcher)) {
+ if (module == null && PatternMatcher.EXACT.equals(matcher)) {
throw new BuildException(
- "no module name provided for ivy repository graph task: It can either be set explicitely via the attribute 'module' or via 'ivy.module' property or a prior call to <resolve/>");
- } else if (_module == null && !PatternMatcher.EXACT.equals(_matcher)) {
- _module = PatternMatcher.ANY_EXPRESSION;
+ "no module name provided for ivy repository graph task: "
+ + "It can either be set explicitely via the attribute 'module' or "
+ + "via 'ivy.module' property or a prior call to <resolve/>");
+ } else if (module == null && !PatternMatcher.EXACT.equals(matcher)) {
+ module = PatternMatcher.ANY_EXPRESSION;
}
- ModuleRevisionId mrid = ModuleRevisionId.newInstance(_organisation, _module, _revision);
+ ModuleRevisionId mrid = ModuleRevisionId.newInstance(organisation, module, revision);
try {
- ModuleId[] mids = ivy.listModules(new ModuleId(_organisation, _module), settings
- .getMatcher(_matcher));
+ ModuleId[] mids = ivy.listModules(new ModuleId(organisation, module), settings
+ .getMatcher(matcher));
ModuleRevisionId[] mrids = new ModuleRevisionId[mids.length];
for (int i = 0; i < mrids.length; i++) {
- if (_branch != null) {
- mrids[i] = new ModuleRevisionId(mids[i], _branch, _revision);
+ if (branch != null) {
+ mrids[i] = new ModuleRevisionId(mids[i], branch, revision);
} else {
- mrids[i] = new ModuleRevisionId(mids[i], _revision);
+ mrids[i] = new ModuleRevisionId(mids[i], revision);
}
}
DefaultModuleDescriptor md = DefaultModuleDescriptor.newCallerInstance(mrids, true,
false);
String resolveId = ResolveOptions.getDefaultResolveId(md);
ResolveReport report = ivy.resolve(md, new ResolveOptions().setResolveId(resolveId)
- .setCache(CacheManager.getInstance(settings, _cache)).setValidate(
+ .setCache(CacheManager.getInstance(settings, cache)).setValidate(
doValidate(settings)));
- CacheManager cacheMgr = getIvyInstance().getCacheManager(_cache);
- new XmlReportOutputter().output(report, _cache);
- if (_graph) {
+ CacheManager cacheMgr = getIvyInstance().getCacheManager(cache);
+ new XmlReportOutputter().output(report, cache);
+ if (graph) {
gengraph(cacheMgr, md.getModuleRevisionId().getOrganisation(), md
.getModuleRevisionId().getName());
}
- if (_dot) {
+ if (dot) {
gendot(cacheMgr, md.getModuleRevisionId().getOrganisation(), md
.getModuleRevisionId().getName());
}
- if (_xml) {
+ if (xml) {
FileUtil.copy(cacheMgr.getConfigurationResolveReportInCache(resolveId, "default"),
- new File(_todir, _outputname + ".xml"), null);
+ new File(todir, outputname + ".xml"), null);
}
- if (_xsl) {
+ if (xsl) {
genreport(cacheMgr, md.getModuleRevisionId().getOrganisation(), md
.getModuleRevisionId().getName());
}
@@ -141,16 +143,16 @@
String resolveId = ResolveOptions.getDefaultResolveId(new ModuleId(organisation, module));
xslt.setIn(cache.getConfigurationResolveReportInCache(resolveId, "default"));
- xslt.setOut(new File(_todir, _outputname + "." + _xslext));
+ xslt.setOut(new File(todir, outputname + "." + xslext));
- xslt.setStyle(_xslFile);
+ xslt.setStyle(xslFile);
XSLTProcess.Param param = xslt.createParam();
param.setName("extension");
- param.setExpression(_xslext);
+ param.setExpression(xslext);
// add the provided XSLT parameters
- for (Iterator it = _params.iterator(); it.hasNext();) {
+ for (Iterator it = params.iterator(); it.hasNext();) {
param = (XSLTProcess.Param) it.next();
XSLTProcess.Param realParam = xslt.createParam();
realParam.setName(param.getName());
@@ -196,127 +198,127 @@
String resolveId = ResolveOptions.getDefaultResolveId(new ModuleId(organisation, module));
xslt.setIn(cache.getConfigurationResolveReportInCache(resolveId, "default"));
- xslt.setOut(new File(_todir, _outputname + "." + ext));
+ xslt.setOut(new File(todir, outputname + "." + ext));
xslt.setBasedir(cache.getCache());
xslt.setStyle(style);
xslt.execute();
}
public File getTodir() {
- return _todir;
+ return todir;
}
public void setTodir(File todir) {
- _todir = todir;
+ this.todir = todir;
}
public boolean isGraph() {
- return _graph;
+ return graph;
}
public void setGraph(boolean graph) {
- _graph = graph;
+ this.graph = graph;
}
public String getXslfile() {
- return _xslFile;
+ return xslFile;
}
public void setXslfile(String xslFile) {
- _xslFile = xslFile;
+ this.xslFile = xslFile;
}
public boolean isXml() {
- return _xml;
+ return xml;
}
public void setXml(boolean xml) {
- _xml = xml;
+ this.xml = xml;
}
public boolean isXsl() {
- return _xsl;
+ return xsl;
}
public void setXsl(boolean xsl) {
- _xsl = xsl;
+ this.xsl = xsl;
}
public String getXslext() {
- return _xslext;
+ return xslext;
}
public void setXslext(String xslext) {
- _xslext = xslext;
+ this.xslext = xslext;
}
public XSLTProcess.Param createParam() {
XSLTProcess.Param result = new XSLTProcess.Param();
- _params.add(result);
+ params.add(result);
return result;
}
public String getOutputname() {
- return _outputname;
+ return outputname;
}
public void setOutputname(String outputpattern) {
- _outputname = outputpattern;
+ outputname = outputpattern;
}
public File getCache() {
- return _cache;
+ return cache;
}
public void setCache(File cache) {
- _cache = cache;
+ this.cache = cache;
}
public String getMatcher() {
- return _matcher;
+ return matcher;
}
public void setMatcher(String matcher) {
- _matcher = matcher;
+ this.matcher = matcher;
}
public String getModule() {
- return _module;
+ return module;
}
public void setModule(String module) {
- _module = module;
+ this.module = module;
}
public String getOrganisation() {
- return _organisation;
+ return organisation;
}
public void setOrganisation(String organisation) {
- _organisation = organisation;
+ this.organisation = organisation;
}
public String getRevision() {
- return _revision;
+ return revision;
}
public void setRevision(String revision) {
- _revision = revision;
+ this.revision = revision;
}
public String getBranch() {
- return _branch;
+ return branch;
}
public void setBranch(String branch) {
- _branch = branch;
+ this.branch = branch;
}
public boolean isDot() {
- return _dot;
+ return dot;
}
public void setDot(boolean dot) {
- _dot = dot;
+ this.dot = dot;
}
}
Modified: incubator/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyResolve.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyResolve.java?view=diff&rev=550916&r1=550915&r2=550916
==============================================================================
--- incubator/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyResolve.java (original)
+++ incubator/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyResolve.java Tue Jun 26 12:34:08 2007
@@ -37,94 +37,94 @@
* This task allow to call the Ivy dependency resolution from ant.
*/
public class IvyResolve extends IvyTask {
- private File _file = null;
+ private File file = null;
- private String _conf = null;
+ private String conf = null;
- private File _cache = null;
+ private File cache = null;
- private String _organisation = null;
+ private String organisation = null;
- private String _module = null;
+ private String module = null;
- private String _revision = null;
+ private String revision = null;
- private String _pubdate = null;
+ private String pubdate = null;
- private boolean _inline = false;
+ private boolean inline = false;
- private boolean _haltOnFailure = true;
+ private boolean haltOnFailure = true;
- private boolean _useCacheOnly = false;
+ private boolean useCacheOnly = false;
- private String _type = null;
+ private String type = null;
- private boolean _transitive = true;
+ private boolean transitive = true;
- private boolean _changing = false;
+ private boolean changing = false;
- private Boolean _keep = null;
+ private Boolean keep = null;
- private String _failureProperty = null;
+ private String failureProperty = null;
- private boolean _useOrigin = false;
+ private boolean useOrigin = false;
- private String _resolveId = null;
+ private String resolveId = null;
public boolean isUseOrigin() {
- return _useOrigin;
+ return useOrigin;
}
public void setUseOrigin(boolean useOrigin) {
- _useOrigin = useOrigin;
+ this.useOrigin = useOrigin;
}
public String getDate() {
- return _pubdate;
+ return pubdate;
}
public void setDate(String pubdate) {
- _pubdate = pubdate;
+ this.pubdate = pubdate;
}
public String getRevision() {
- return _revision;
+ return revision;
}
public void setRevision(String revision) {
- _revision = revision;
+ this.revision = revision;
}
public File getCache() {
- return _cache;
+ return cache;
}
public void setCache(File cache) {
- _cache = cache;
+ this.cache = cache;
}
public String getConf() {
- return _conf;
+ return conf;
}
public void setConf(String conf) {
- _conf = conf;
+ this.conf = conf;
}
public File getFile() {
- return _file;
+ return file;
}
public void setFile(File file) {
- _file = file;
+ this.file = file;
}
public boolean isHaltonfailure() {
- return _haltOnFailure;
+ return haltOnFailure;
}
public void setHaltonfailure(boolean haltOnFailure) {
- _haltOnFailure = haltOnFailure;
+ this.haltOnFailure = haltOnFailure;
}
public void setShowprogress(boolean show) {
@@ -132,19 +132,19 @@
}
public boolean isUseCacheOnly() {
- return _useCacheOnly;
+ return useCacheOnly;
}
public void setUseCacheOnly(boolean useCacheOnly) {
- _useCacheOnly = useCacheOnly;
+ this.useCacheOnly = useCacheOnly;
}
public String getType() {
- return _type;
+ return type;
}
public void setType(String type) {
- _type = type;
+ this.type = type;
}
/**
@@ -157,64 +157,64 @@
}
public void setFailureProperty(String failureProperty) {
- _failureProperty = failureProperty;
+ this.failureProperty = failureProperty;
}
public String getFailureProperty() {
- return _failureProperty;
+ return failureProperty;
}
public void doExecute() throws BuildException {
Ivy ivy = getIvyInstance();
IvySettings settings = ivy.getSettings();
try {
- _conf = getProperty(_conf, settings, "ivy.configurations");
- _type = getProperty(_type, settings, "ivy.resolve.default.type.filter");
- if (_cache == null) {
- _cache = settings.getDefaultCache();
+ conf = getProperty(conf, settings, "ivy.configurations");
+ type = getProperty(type, settings, "ivy.resolve.default.type.filter");
+ if (cache == null) {
+ cache = settings.getDefaultCache();
}
- String[] confs = splitConfs(_conf);
+ String[] confs = splitConfs(conf);
ResolveReport report;
if (isInline()) {
- if (_organisation == null) {
+ if (organisation == null) {
throw new BuildException("'organisation' is required when using inline mode");
}
- if (_module == null) {
+ if (module == null) {
throw new BuildException("'module' is required when using inline mode");
}
- if (_file != null) {
+ if (file != null) {
throw new BuildException("'file' not allowed when using inline mode");
}
- if (_revision == null) {
- _revision = "latest.integration";
+ if (revision == null) {
+ revision = "latest.integration";
}
report = ivy.resolve(ModuleRevisionId
- .newInstance(_organisation, _module, _revision), getResolveOptions(confs,
- settings), _changing);
+ .newInstance(organisation, module, revision), getResolveOptions(confs,
+ settings), changing);
} else {
- if (_organisation != null) {
+ if (organisation != null) {
throw new BuildException(
"'organisation' not allowed when not using 'org' attribute");
}
- if (_module != null) {
+ if (module != null) {
throw new BuildException("'module' not allowed when not using 'org' attribute");
}
- if (_file == null) {
- _file = getProject().resolveFile(getProperty(settings, "ivy.dep.file"));
+ if (file == null) {
+ file = getProject().resolveFile(getProperty(settings, "ivy.dep.file"));
}
- report = ivy.resolve(_file.toURL(), getResolveOptions(confs, settings));
+ report = ivy.resolve(file.toURL(), getResolveOptions(confs, settings));
}
if (report.hasError()) {
- if (_failureProperty != null) {
- getProject().setProperty(_failureProperty, "true");
+ if (failureProperty != null) {
+ getProject().setProperty(failureProperty, "true");
}
if (isHaltonfailure()) {
throw new BuildException("resolve failed - see output for details");
}
}
- setResolved(report, _resolveId, isKeep());
+ setResolved(report, resolveId, isKeep());
if (isKeep()) {
ModuleDescriptor md = report.getModuleDescriptor();
@@ -223,66 +223,66 @@
// call to the other
getProject().setProperty("ivy.organisation",
md.getModuleRevisionId().getOrganisation());
- settings
- .setVariable("ivy.organisation", md.getModuleRevisionId().getOrganisation());
+ settings.setVariable(
+ "ivy.organisation", md.getModuleRevisionId().getOrganisation());
getProject().setProperty("ivy.module", md.getModuleRevisionId().getName());
settings.setVariable("ivy.module", md.getModuleRevisionId().getName());
getProject().setProperty("ivy.revision",
md.getResolvedModuleRevisionId().getRevision());
- settings
- .setVariable("ivy.revision", md.getResolvedModuleRevisionId().getRevision());
+ settings.setVariable(
+ "ivy.revision", md.getResolvedModuleRevisionId().getRevision());
boolean hasChanged = report.hasChanged();
getProject().setProperty("ivy.deps.changed", String.valueOf(hasChanged));
settings.setVariable("ivy.deps.changed", String.valueOf(hasChanged));
- if (_conf.trim().equals("*")) {
+ if (conf.trim().equals("*")) {
getProject().setProperty("ivy.resolved.configurations",
mergeConfs(md.getConfigurationsNames()));
settings.setVariable("ivy.resolved.configurations", mergeConfs(md
.getConfigurationsNames()));
} else {
- getProject().setProperty("ivy.resolved.configurations", _conf);
- settings.setVariable("ivy.resolved.configurations", _conf);
+ getProject().setProperty("ivy.resolved.configurations", conf);
+ settings.setVariable("ivy.resolved.configurations", conf);
}
- if (_file != null) {
- getProject().setProperty("ivy.resolved.file", _file.getAbsolutePath());
- settings.setVariable("ivy.resolved.file", _file.getAbsolutePath());
+ if (file != null) {
+ getProject().setProperty("ivy.resolved.file", file.getAbsolutePath());
+ settings.setVariable("ivy.resolved.file", file.getAbsolutePath());
}
- if (_resolveId != null) {
- getProject().setProperty("ivy.organisation." + _resolveId,
+ if (resolveId != null) {
+ getProject().setProperty("ivy.organisation." + resolveId,
md.getModuleRevisionId().getOrganisation());
- settings.setVariable("ivy.organisation." + _resolveId, md.getModuleRevisionId()
+ settings.setVariable("ivy.organisation." + resolveId, md.getModuleRevisionId()
.getOrganisation());
- getProject().setProperty("ivy.module." + _resolveId,
+ getProject().setProperty("ivy.module." + resolveId,
md.getModuleRevisionId().getName());
- settings.setVariable("ivy.module." + _resolveId, md.getModuleRevisionId()
+ settings.setVariable("ivy.module." + resolveId, md.getModuleRevisionId()
.getName());
- getProject().setProperty("ivy.revision." + _resolveId,
+ getProject().setProperty("ivy.revision." + resolveId,
md.getResolvedModuleRevisionId().getRevision());
- settings.setVariable("ivy.revision." + _resolveId, md
+ settings.setVariable("ivy.revision." + resolveId, md
.getResolvedModuleRevisionId().getRevision());
- getProject().setProperty("ivy.deps.changed." + _resolveId,
+ getProject().setProperty("ivy.deps.changed." + resolveId,
String.valueOf(hasChanged));
- settings.setVariable("ivy.deps.changed." + _resolveId, String
+ settings.setVariable("ivy.deps.changed." + resolveId, String
.valueOf(hasChanged));
- if (_conf.trim().equals("*")) {
- getProject().setProperty("ivy.resolved.configurations." + _resolveId,
+ if (conf.trim().equals("*")) {
+ getProject().setProperty("ivy.resolved.configurations." + resolveId,
mergeConfs(md.getConfigurationsNames()));
- settings.setVariable("ivy.resolved.configurations." + _resolveId,
+ settings.setVariable("ivy.resolved.configurations." + resolveId,
mergeConfs(md.getConfigurationsNames()));
} else {
getProject()
- .setProperty("ivy.resolved.configurations." + _resolveId, _conf);
- settings.setVariable("ivy.resolved.configurations." + _resolveId, _conf);
+ .setProperty("ivy.resolved.configurations." + resolveId, conf);
+ settings.setVariable("ivy.resolved.configurations." + resolveId, conf);
}
- getProject().setProperty("ivy.resolved.file." + _resolveId,
- _file.getAbsolutePath());
+ getProject().setProperty("ivy.resolved.file." + resolveId,
+ file.getAbsolutePath());
settings
- .setVariable("ivy.resolved.file." + _resolveId, _file.getAbsolutePath());
+ .setVariable("ivy.resolved.file." + resolveId, file.getAbsolutePath());
}
}
} catch (MalformedURLException e) {
throw new BuildException(
- "unable to convert given ivy file to url: " + _file + ": " + e, e);
+ "unable to convert given ivy file to url: " + file + ": " + e, e);
} catch (ParseException e) {
log(e.getMessage(), Project.MSG_ERR);
throw new BuildException("syntax errors in ivy file: " + e, e);
@@ -293,65 +293,65 @@
private ResolveOptions getResolveOptions(String[] confs, IvySettings settings) {
return new ResolveOptions().setConfs(confs).setValidate(doValidate(settings))
- .setArtifactFilter(FilterHelper.getArtifactTypeFilter(_type))
- .setRevision(_revision).setCache(CacheManager.getInstance(settings, _cache))
- .setDate(getPubDate(_pubdate, null)).setUseCacheOnly(_useCacheOnly).setUseOrigin(
- _useOrigin).setTransitive(_transitive).setResolveId(_resolveId);
+ .setArtifactFilter(FilterHelper.getArtifactTypeFilter(type))
+ .setRevision(revision).setCache(CacheManager.getInstance(settings, cache))
+ .setDate(getPubDate(pubdate, null)).setUseCacheOnly(useCacheOnly).setUseOrigin(
+ useOrigin).setTransitive(transitive).setResolveId(resolveId);
}
public String getModule() {
- return _module;
+ return module;
}
public void setModule(String module) {
- _module = module;
+ this.module = module;
}
public String getOrganisation() {
- return _organisation;
+ return organisation;
}
public void setOrganisation(String organisation) {
- _organisation = organisation;
+ this.organisation = organisation;
}
public boolean isTransitive() {
- return _transitive;
+ return transitive;
}
public void setTransitive(boolean transitive) {
- _transitive = transitive;
+ this.transitive = transitive;
}
public boolean isChanging() {
- return _changing;
+ return changing;
}
public void setChanging(boolean changing) {
- _changing = changing;
+ this.changing = changing;
}
public boolean isKeep() {
- return _keep == null ? _organisation == null : _keep.booleanValue();
+ return keep == null ? organisation == null : keep.booleanValue();
}
public void setKeep(boolean keep) {
- _keep = Boolean.valueOf(keep);
+ this.keep = Boolean.valueOf(keep);
}
public boolean isInline() {
- return _inline;
+ return inline;
}
public void setInline(boolean inline) {
- _inline = inline;
+ this.inline = inline;
}
public String getResolveId() {
- return _resolveId;
+ return resolveId;
}
public void setResolveId(String resolveId) {
- _resolveId = resolveId;
+ this.resolveId = resolveId;
}
}
Modified: incubator/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyTask.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyTask.java?view=diff&rev=550916&r1=550915&r2=550916
==============================================================================
--- incubator/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyTask.java (original)
+++ incubator/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyTask.java Tue Jun 26 12:34:08 2007
@@ -82,7 +82,9 @@
if (!(antIvyEngine instanceof IvyAntSettings)) {
throw new BuildException(
antIvyEngineRef.getRefId()
- + " has been defined in a different classloader. Please use the same loader when defining your task, or redeclare your ivy:settings in this classloader",
+ + " has been defined in a different classloader. "
+ + "Please use the same loader when defining your task, or "
+ + "redeclare your ivy:settings in this classloader",
getLocation());
}
} else {