mirror of https://github.com/apache/ant-ivy
FIX IVY-49: doing a retrieve after several resolves now retrieves data from the last resolve by default
git-svn-id: https://svn.apache.org/repos/asf/incubator/ivy/trunk@484001 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
36a1784d52
commit
f5a532d606
|
|
@ -6,6 +6,8 @@
|
|||
- new type filtering in cachepath task
|
||||
- new cachefileset task: builds an ant fileset of artifacts in cache
|
||||
- publish task now uses srcivypattern for ivy files finding and for delivery
|
||||
- FIX: resolve now store resolved file id in ivy variables, so that multiple resolve calls
|
||||
can be followed by multiple retrieve, each retrieve will use the last resolve info (IVY-49)
|
||||
- FIX: IllegalStateException on retrieve done from command line
|
||||
- FIX: checks ivy files data consistency with asked info (org, module name and revision)
|
||||
- FIX: use AUTH configuration for configuration file
|
||||
|
|
|
|||
|
|
@ -87,14 +87,23 @@ public class IvyResolve extends IvyTask {
|
|||
}
|
||||
ModuleDescriptor md = report.getModuleDescriptor();
|
||||
setResolved(md);
|
||||
|
||||
// put resolved infos in ant properties and ivy variables
|
||||
// putting them in ivy variables is important to be able to change from one resolve call to the other
|
||||
getProject().setProperty("ivy.organisation", md.getModuleRevisionId().getOrganisation());
|
||||
ivy.setVariable("ivy.organisation", md.getModuleRevisionId().getOrganisation());
|
||||
getProject().setProperty("ivy.module", md.getModuleRevisionId().getName());
|
||||
ivy.setVariable("ivy.module", md.getModuleRevisionId().getName());
|
||||
getProject().setProperty("ivy.revision", md.getResolvedModuleRevisionId().getRevision());
|
||||
ivy.setVariable("ivy.revision", md.getResolvedModuleRevisionId().getRevision());
|
||||
if (_conf.trim().equals("*")) {
|
||||
getProject().setProperty("ivy.resolved.configurations", mergeConfs(md.getConfigurationsNames()));
|
||||
ivy.setVariable("ivy.resolved.configurations", mergeConfs(md.getConfigurationsNames()));
|
||||
} else {
|
||||
getProject().setProperty("ivy.resolved.configurations", _conf);
|
||||
ivy.setVariable("ivy.resolved.configurations", _conf);
|
||||
}
|
||||
|
||||
} catch (MalformedURLException e) {
|
||||
throw new BuildException("unable to convert given ivy file to url: "+_file, e);
|
||||
} catch (ParseException e) {
|
||||
|
|
|
|||
|
|
@ -57,6 +57,18 @@ public class IvyResolveTest extends TestCase {
|
|||
assertTrue(getIvy().getArchiveFileInCache(_cache, "org1", "mod1.2", "2.0", "mod1.2", "jar", "jar").exists());
|
||||
}
|
||||
|
||||
public void testDouble() throws Exception {
|
||||
_resolve.setFile(new File("test/java/fr/jayasoft/ivy/ant/ivy-simple.xml"));
|
||||
_resolve.execute();
|
||||
|
||||
assertEquals("resolve-simple", getIvy().getVariable("ivy.module"));
|
||||
|
||||
_resolve.setFile(new File("test/java/fr/jayasoft/ivy/ant/ivy-double.xml"));
|
||||
_resolve.execute();
|
||||
|
||||
assertEquals("resolve-double", getIvy().getVariable("ivy.module"));
|
||||
}
|
||||
|
||||
public void testFailure() throws Exception {
|
||||
try {
|
||||
_resolve.setFile(new File("test/java/fr/jayasoft/ivy/ant/ivy-failure.xml"));
|
||||
|
|
|
|||
|
|
@ -0,0 +1,10 @@
|
|||
<ivy-module version="1.0">
|
||||
<info organisation="jayasoft"
|
||||
module="resolve-double"
|
||||
revision="1.0"
|
||||
status="release"
|
||||
/>
|
||||
<dependencies>
|
||||
<dependency org="org1" name="mod1.2" rev="2.0"/>
|
||||
</dependencies>
|
||||
</ivy-module>
|
||||
Loading…
Reference in New Issue