ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hi...@apache.org
Subject svn commit: r987402 - in /ant/ivy/ivyde/trunk: CHANGES.txt org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyResolveJobThread.java
Date Fri, 20 Aug 2010 08:31:29 GMT
Author: hibou
Date: Fri Aug 20 08:31:28 2010
New Revision: 987402

URL: http://svn.apache.org/viewvc?rev=987402&view=rev
Log:
IVYDE-27: let IvyDE refresh the folder containing the retrieved artifacts (thanks to Clint
Burghduff)

Modified:
    ant/ivy/ivyde/trunk/CHANGES.txt
    ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyResolveJobThread.java

Modified: ant/ivy/ivyde/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/CHANGES.txt?rev=987402&r1=987401&r2=987402&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/CHANGES.txt (original)
+++ ant/ivy/ivyde/trunk/CHANGES.txt Fri Aug 20 08:31:28 2010
@@ -1,5 +1,10 @@
-				IvyDE 
-				============================================
+                                   IvyDE 
+                ============================================
+
+  version 2.2.0
+==========================
+
+- IMPROVE: let IvyDE refresh workspace after a resolve (IVYDE-27) (thanks to Clint Burghduff)
 
   version 2.1.0
 ==========================

Modified: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyResolveJobThread.java
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyResolveJobThread.java?rev=987402&r1=987401&r2=987402&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyResolveJobThread.java
(original)
+++ ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyResolveJobThread.java
Fri Aug 20 08:31:28 2010
@@ -31,6 +31,7 @@ import java.util.Map;
 import java.util.Set;
 
 import org.apache.ivy.Ivy;
+import org.apache.ivy.core.IvyPatternHelper;
 import org.apache.ivy.core.module.descriptor.DefaultDependencyDescriptor;
 import org.apache.ivy.core.module.descriptor.ModuleDescriptor;
 import org.apache.ivy.core.module.id.ModuleRevisionId;
@@ -48,6 +49,9 @@ import org.apache.ivy.util.Message;
 import org.apache.ivy.util.filter.ArtifactTypeFilter;
 import org.apache.ivyde.eclipse.FakeProjectManager;
 import org.apache.ivyde.eclipse.IvyPlugin;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.MultiStatus;
@@ -337,7 +341,20 @@ public class IvyResolveJobThread extends
             c.setArtifactFilter(new ArtifactTypeFilter(IvyClasspathUtil
                     .split(inheritedRetrieveTypes)));
         }
-        ivy.retrieve(md.getModuleRevisionId(), pattern, c);
+        int numberOfItemsRetrieved = ivy.retrieve(md.getModuleRevisionId(), pattern, c);
+        try {
+            if (numberOfItemsRetrieved > 0 ){
+                // Only refresh if we actually retrieved a file.
+                monitor.setTaskName("refreshing after retrieve for pattern: " + pattern);
+                String refreshPath = IvyPatternHelper.getTokenRoot(conf.getInheritedRetrievePattern());
+                IFolder folder = conf.getJavaProject().getProject().getFolder(refreshPath);
+                folder.refreshLocal(IResource.DEPTH_INFINITE, monitor);
+            }
+        } catch (CoreException e) {
+            // we shouldn't get any conflict in resource changes notifications, the job running
+            // this thread should be started with proper exclude rules
+            throw new RuntimeException("Refresh after resolve is conflicting with another
job", e);
+        }
     }
 
     private Map/* <ModuleRevisionId, Artifact[]> */getArtifactsByDependency(ResolveReport
r) {



Mime
View raw message