Author: maartenc
Date: Mon Oct 20 15:45:13 2008
New Revision: 706440
URL: http://svn.apache.org/viewvc?rev=706440&view=rev
Log:
FIX: Correctly set ivy.resolved.configurations property when the conf string
includes a negation operator (IVY-951) (thanks to Patrick Woodworth)
Modified:
ant/ivy/core/trunk/CHANGES.txt
ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyResolve.java
ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyResolveTest.java
Modified: ant/ivy/core/trunk/CHANGES.txt
URL:
http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=706440&r1=706439&r2=706440&view=diff
==============================================================================
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Mon Oct 20 15:45:13 2008
@@ -109,6 +109,7 @@
- FIX: cachefileset produces an empty fileset when the cache refers to libs in
directories that only have the root directory in common (IVY-948) (thanks to
Chris Wood)
- FIX: Extra Attributes specified in the Dependency's Module Descriptor are
not available to resolvers (IVY-929) (thanks to Scott Hebert)
- FIX: Support for passing arbitrary arguments to the -main invoked class when
using the standalone mode is severely limited (IVY-952) (thanks to Patrick
Woodworth)
+- FIX: Correctly set ivy.resolved.configurations property when the conf string
includes a negation operator (IVY-951) (thanks to Patrick Woodworth)
2.0.0-rc1
=====================================
Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyResolve.java
URL:
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyResolve.java?rev=706440&r1=706439&r2=706440&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyResolve.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyResolve.java Mon Oct 20
15:45:13 2008
@@ -242,6 +242,7 @@
}
}
setResolved(report, resolveId, isKeep());
+ confs = report.getConfigurations();
if (isKeep()) {
ModuleDescriptor md = report.getModuleDescriptor();
@@ -264,15 +265,8 @@
getProject().setProperty("ivy.deps.changed",
hasChanged.toString());
settings.setVariable("ivy.deps.changed",
hasChanged.toString());
}
- 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",
mergeConfs(confs));
+ settings.setVariable("ivy.resolved.configurations",
mergeConfs(confs));
if (file != null) {
getProject().setProperty("ivy.resolved.file",
file.getAbsolutePath());
settings.setVariable("ivy.resolved.file",
file.getAbsolutePath());
@@ -297,16 +291,10 @@
settings.setVariable("ivy.deps.changed." + resolveId,
hasChanged.toString());
}
- if (conf.trim().equals("*")) {
-
getProject().setProperty("ivy.resolved.configurations." + resolveId,
- mergeConfs(md.getConfigurationsNames()));
- settings.setVariable("ivy.resolved.configurations." +
resolveId,
- mergeConfs(md.getConfigurationsNames()));
- } else {
- getProject()
- .setProperty("ivy.resolved.configurations." +
resolveId, conf);
- settings.setVariable("ivy.resolved.configurations." +
resolveId, conf);
- }
+ getProject().setProperty("ivy.resolved.configurations." +
resolveId,
+ mergeConfs(confs));
+ settings.setVariable("ivy.resolved.configurations." +
resolveId,
+ mergeConfs(confs));
if (file != null) {
getProject().setProperty("ivy.resolved.file." +
resolveId,
file.getAbsolutePath());
Modified: ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyResolveTest.java
URL:
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyResolveTest.java?rev=706440&r1=706439&r2=706440&view=diff
==============================================================================
--- ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyResolveTest.java
(original)
+++ ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyResolveTest.java Mon Oct
20 15:45:13 2008
@@ -397,6 +397,10 @@
ModuleRevisionId.newInstance("org1", "mod1.1", "2.0")).exists());
assertFalse(getIvyFileInCache(
ModuleRevisionId.newInstance("org1", "mod1.2", "2.0")).exists());
+
+ // test the properties
+ Project project = resolve.getProject();
+
assertFalse(project.getProperty("ivy.resolved.configurations").indexOf("default")
> -1);
}
public void testResolveWithAbsoluteFile() {