ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hi...@apache.org
Subject svn commit: r1407819 - in /ant/ivy/ivyde/trunk: doc/release-notes.html org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/resolve/IvyResolveJob.java
Date Sat, 10 Nov 2012 14:19:22 GMT
Author: hibou
Date: Sat Nov 10 14:19:21 2012
New Revision: 1407819

URL: http://svn.apache.org/viewvc?rev=1407819&view=rev
Log:
IVYDE-293:
- fix the map referencing the resolve request: there can be sevral resolve request per module
descriptor

Modified:
    ant/ivy/ivyde/trunk/doc/release-notes.html
    ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/resolve/IvyResolveJob.java

Modified: ant/ivy/ivyde/trunk/doc/release-notes.html
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/doc/release-notes.html?rev=1407819&r1=1407818&r2=1407819&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/doc/release-notes.html (original)
+++ ant/ivy/ivyde/trunk/doc/release-notes.html Sat Nov 10 14:19:21 2012
@@ -146,6 +146,7 @@ List of changes since <a href="/ivy/ivyd
     <li>FIX: Resolution failure when workspace has project &amp; artifact sub-element
exists (IVYDE-296, IVYDE-319)</li>
     <li>FIX: IvyDE classpath containers become empty on eclipse/MyEclipse startup (IVYDE-317)</li>
     <li>FIX: IvyDE doesn't update .classpath anymore; sometimes some containers could
not get initialized (IVYDE-299)</li>
+	<li>FIX: Only one resolve is done when several are sharing the same ivy.xml and the
workspace resolver is enabled (IVYDE-293)</li>
 </ul>
     <!-- samples
 <ul>

Modified: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/resolve/IvyResolveJob.java
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/resolve/IvyResolveJob.java?rev=1407819&r1=1407818&r2=1407819&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/resolve/IvyResolveJob.java
(original)
+++ ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/resolve/IvyResolveJob.java
Sat Nov 10 14:19:21 2012
@@ -107,7 +107,7 @@ public class IvyResolveJob extends Job {
 
         monitor.beginTask("Loading ivy descriptors", MONITOR_LENGTH);
 
-        Map/* <ModuleDescriptor, ResolveRequest> */inworkspaceModules = new LinkedHashMap();
+        Map/* <ModuleDescriptor, List<ResolveRequest>> */inworkspaceModules =
new LinkedHashMap();
         List/* <ResolveRequest> */otherModules = new ArrayList();
         Map/* <ResolveRequest, Ivy> */ivys = new HashMap();
         Map/* <ResolveRequest, ModuleDescriptor> */mds = new HashMap();
@@ -174,7 +174,12 @@ public class IvyResolveJob extends Job {
                 cachedIvy.setErrorMarker(null);
                 mds.put(request, md);
                 if (request.isInWorkspace()) {
-                    inworkspaceModules.put(md, request);
+                    List requests = (List) inworkspaceModules.get(md);
+                    if (requests == null) {
+                        requests = new ArrayList();
+                        inworkspaceModules.put(md, requests);
+                    }
+                    requests.add(request);
                 } else {
                     otherModules.add(request);
                 }
@@ -194,7 +199,8 @@ public class IvyResolveJob extends Job {
             // we resolve them in the correct order
 
             // The version matcher used will be the one configured for the first project
-            ResolveRequest request = (ResolveRequest) inworkspaceModules.values().iterator().next();
+            ResolveRequest request = (ResolveRequest) ((List) inworkspaceModules.values()
+                    .iterator().next()).get(0);
             VersionMatcher versionMatcher = ((Ivy) ivys.get(request)).getSettings()
                     .getVersionMatcher();
 
@@ -207,14 +213,20 @@ public class IvyResolveJob extends Job {
 
             Iterator it = sortedModuleDescriptors.iterator();
             while (it.hasNext()) {
-                request = (ResolveRequest) inworkspaceModules.get(it.next());
-                Ivy ivy = (Ivy) ivys.get(request);
-                ModuleDescriptor md = (ModuleDescriptor) mds.get(request);
-                boolean canceled = launchResolveThread(request, monitor, step, errorsStatus,
ivy,
-                    md);
-                if (canceled) {
-                    IvyDEMessage.warn("Resolve job canceled");
-                    return Status.CANCEL_STATUS;
+                ModuleDescriptor module = (ModuleDescriptor) it.next();
+                List requests = (List) inworkspaceModules.get(module);
+                IvyDEMessage.info(requests.size() + " container(s) of module " + module
+                        + " to resolve in workspace");
+                for (int i = 0; i < requests.size(); i++) {
+                    request = (ResolveRequest) requests.get(i);
+                    Ivy ivy = (Ivy) ivys.get(request);
+                    ModuleDescriptor md = (ModuleDescriptor) mds.get(request);
+                    boolean canceled = launchResolveThread(request, monitor, step, errorsStatus,
+                        ivy, md);
+                    if (canceled) {
+                        IvyDEMessage.warn("Resolve job canceled");
+                        return Status.CANCEL_STATUS;
+                    }
                 }
             }
         }



Mime
View raw message