You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by hi...@apache.org on 2010/09/04 13:15:12 UTC

svn commit: r992580 - in /ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse: cpcontainer/IvyClasspathResolver.java cpcontainer/IvyResolveJob.java resolve/IvyResolver.java

Author: hibou
Date: Sat Sep  4 11:15:12 2010
New Revision: 992580

URL: http://svn.apache.org/viewvc?rev=992580&view=rev
Log:
Actually set the classpath only after every resolve has been done. This will avoid having the classpathsetter job blocked by the resolve job, and so have a popup blocking the end user of doing anything.

Modified:
    ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathResolver.java
    ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyResolveJob.java
    ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/resolve/IvyResolver.java

Modified: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathResolver.java
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathResolver.java?rev=992580&r1=992579&r2=992580&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathResolver.java (original)
+++ ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathResolver.java Sat Sep  4 11:15:12 2010
@@ -42,6 +42,8 @@ public class IvyClasspathResolver extend
 
     private final IvyClasspathContainer ivycp;
 
+    private IClasspathEntry[] classpathEntries = null;
+
     public IvyClasspathResolver(IvyClasspathContainer ivycp, boolean usePreviousResolveIfExist) {
         super(ivycp.getConf().getIvyXmlPath(), ivycp.getConf().getConfs(), ivycp.getConf()
                 .getJavaProject().getProject());
@@ -63,9 +65,18 @@ public class IvyClasspathResolver extend
 
         warnIfDuplicates(ivy, mapper, resolveResult.getArtifactReports());
 
-        IClasspathEntry[] classpathEntries = mapper.map();
+        classpathEntries = mapper.map();
+    }
 
-        ivycp.updateClasspathEntries(classpathEntries);
+    /*
+     * Actually set the classpath only after every resolve has been done. This will avoid having the
+     * classpathsetter job blocked by this resolve job, and so have a popup blocking the end user of
+     * doing anything.
+     */
+    public void postBatchResolve() {
+        if (classpathEntries != null) {
+            ivycp.updateClasspathEntries(classpathEntries);
+        }
     }
 
     /**

Modified: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyResolveJob.java
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyResolveJob.java?rev=992580&r1=992579&r2=992580&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyResolveJob.java (original)
+++ ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyResolveJob.java Sat Sep  4 11:15:12 2010
@@ -174,6 +174,13 @@ public class IvyResolveJob extends Job {
             }
         }
 
+        // launch every post batch resolve
+        Iterator itRequests = toResolve.iterator();
+        while (itRequests.hasNext()) {
+            ResolveRequest request = (ResolveRequest) itRequests.next();
+            request.getResolver().postBatchResolve();
+        }
+
         if (errorsStatus.getChildren().length != 0) {
             return errorsStatus;
         }

Modified: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/resolve/IvyResolver.java
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/resolve/IvyResolver.java?rev=992580&r1=992579&r2=992580&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/resolve/IvyResolver.java (original)
+++ ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/resolve/IvyResolver.java Sat Sep  4 11:15:12 2010
@@ -45,6 +45,7 @@ import org.apache.ivy.util.filter.Artifa
 import org.apache.ivyde.eclipse.FakeProjectManager;
 import org.apache.ivyde.eclipse.IvyPlugin;
 import org.apache.ivyde.eclipse.cpcontainer.IvyClasspathUtil;
+import org.apache.ivyde.eclipse.cpcontainer.IvyResolveJob;
 import org.apache.ivyde.eclipse.cpcontainer.IvyResolveJobListener;
 import org.apache.ivyde.eclipse.cpcontainer.RefreshFolderJob;
 import org.eclipse.core.resources.IFolder;
@@ -313,6 +314,14 @@ public class IvyResolver {
         }
     }
 
+    /**
+     * This function will be called by the {@link IvyResolveJob} after all resolve has been
+     * accomplished. Note that this function will be called even if the resolve failed.
+     */
+    public void postBatchResolve() {
+        // by default do nothing
+    }
+
     public String toString() {
         return ivyXmlPath + confInput + " in " + project.getName();
     }