ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hi...@apache.org
Subject svn commit: r991913 - in /ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse: ./ cpcontainer/ retrieve/ workspaceresolver/
Date Thu, 02 Sep 2010 12:33:05 GMT
Author: hibou
Date: Thu Sep  2 12:33:05 2010
New Revision: 991913

URL: http://svn.apache.org/viewvc?rev=991913&view=rev
Log:
Make the workspace resolver a little bit less dependant of the JDT

Modified:
    ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/CachedIvy.java
    ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainerState.java
    ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/retrieve/StandaloneRetrieveSetupState.java
    ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/workspaceresolver/WorkspaceIvySettings.java
    ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/workspaceresolver/WorkspaceResolver.java

Modified: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/CachedIvy.java
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/CachedIvy.java?rev=991913&r1=991912&r2=991913&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/CachedIvy.java
(original)
+++ ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/CachedIvy.java
Thu Sep  2 12:33:05 2010
@@ -44,7 +44,6 @@ import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Path;
 import org.eclipse.core.runtime.Status;
-import org.eclipse.jdt.core.IJavaProject;
 import org.osgi.framework.BundleContext;
 
 /**
@@ -91,8 +90,6 @@ public abstract class CachedIvy {
 
     protected abstract Collection getPropertyFiles() throws IvyDEException;
 
-    protected abstract IJavaProject getJavaProject();
-
     protected abstract boolean isResolveInWorkspace();
 
     public Ivy getCachedIvy() {
@@ -232,7 +229,7 @@ public abstract class CachedIvy {
     private IvySettings createIvySettings() throws IvyDEException {
         IvySettings ivySettings;
         if (isResolveInWorkspace()) {
-            ivySettings = new WorkspaceIvySettings(getJavaProject());
+            ivySettings = new WorkspaceIvySettings(getProject());
             DefaultRepositoryCacheManager cacheManager = new DefaultRepositoryCacheManager();
             BundleContext bundleContext = IvyPlugin.getDefault().getBundleContext();
             cacheManager.setBasedir(bundleContext.getDataFile("ivyde-workspace-resolver-cache"));

Modified: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainerState.java
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainerState.java?rev=991913&r1=991912&r2=991913&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainerState.java
(original)
+++ ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainerState.java
Thu Sep  2 12:33:05 2010
@@ -22,7 +22,6 @@ import java.util.Collection;
 import org.apache.ivyde.eclipse.CachedIvy;
 import org.apache.ivyde.eclipse.IvyDEException;
 import org.eclipse.core.resources.IProject;
-import org.eclipse.jdt.core.IJavaProject;
 
 /**
  * This class is a front end to the container configuration. It computes the configuration
status,
@@ -49,10 +48,6 @@ public class IvyClasspathContainerState 
         return conf.getIvyXmlPath();
     }
 
-    protected IJavaProject getJavaProject() {
-        return conf.getJavaProject();
-    }
-
     protected IProject getProject() {
         return conf.getJavaProject().getProject();
     }

Modified: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/retrieve/StandaloneRetrieveSetupState.java
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/retrieve/StandaloneRetrieveSetupState.java?rev=991913&r1=991912&r2=991913&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/retrieve/StandaloneRetrieveSetupState.java
(original)
+++ ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/retrieve/StandaloneRetrieveSetupState.java
Thu Sep  2 12:33:05 2010
@@ -22,7 +22,6 @@ import java.util.Collection;
 import org.apache.ivyde.eclipse.CachedIvy;
 import org.apache.ivyde.eclipse.IvyDEException;
 import org.eclipse.core.resources.IProject;
-import org.eclipse.jdt.core.IJavaProject;
 
 public class StandaloneRetrieveSetupState extends CachedIvy {
 
@@ -40,10 +39,6 @@ public class StandaloneRetrieveSetupStat
         return setup.getIvyXmlPath();
     }
 
-    protected IJavaProject getJavaProject() {
-        return null;
-    }
-
     protected IProject getProject() {
         return setup.getProject();
     }

Modified: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/workspaceresolver/WorkspaceIvySettings.java
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/workspaceresolver/WorkspaceIvySettings.java?rev=991913&r1=991912&r2=991913&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/workspaceresolver/WorkspaceIvySettings.java
(original)
+++ ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/workspaceresolver/WorkspaceIvySettings.java
Thu Sep  2 12:33:05 2010
@@ -21,14 +21,14 @@ import org.apache.ivy.core.module.id.Mod
 import org.apache.ivy.core.settings.IvySettings;
 import org.apache.ivy.plugins.resolver.ChainResolver;
 import org.apache.ivy.plugins.resolver.DependencyResolver;
-import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.core.resources.IProject;
 
 public class WorkspaceIvySettings extends IvySettings {
 
-    private final IJavaProject javaProject;
+    private final IProject project;
 
-    public WorkspaceIvySettings(IJavaProject javaProject) {
-        this.javaProject = javaProject;
+    public WorkspaceIvySettings(IProject project) {
+        this.project = project;
         setDefaultLatestStrategy(new IvyDEStrategy());
     }
 
@@ -44,11 +44,12 @@ public class WorkspaceIvySettings extend
         if (resolver == null) {
             return resolver;
         }
+        String projectName = project == null ? "<null>" : project.getName();
         ChainResolver chain = new ChainResolver();
-        chain.setName(javaProject.getElementName() + "-ivyde-workspace-chain-resolver");
+        chain.setName(projectName + "-ivyde-workspace-chain-resolver");
         chain.setSettings(this);
         chain.setReturnFirst(true);
-        chain.add(new WorkspaceResolver(javaProject, this));
+        chain.add(new WorkspaceResolver(project, this));
         chain.add(resolver);
         return chain;
         

Modified: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/workspaceresolver/WorkspaceResolver.java
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/workspaceresolver/WorkspaceResolver.java?rev=991913&r1=991912&r2=991913&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/workspaceresolver/WorkspaceResolver.java
(original)
+++ ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/workspaceresolver/WorkspaceResolver.java
Thu Sep  2 12:33:05 2010
@@ -48,10 +48,10 @@ import org.apache.ivy.plugins.resolver.A
 import org.apache.ivy.plugins.resolver.util.ResolvedResource;
 import org.apache.ivy.plugins.version.VersionMatcher;
 import org.apache.ivy.util.Message;
-import org.apache.ivyde.eclipse.IvyDEException;
 import org.apache.ivyde.eclipse.IvyPlugin;
 import org.apache.ivyde.eclipse.cpcontainer.IvyClasspathContainer;
 import org.apache.ivyde.eclipse.cpcontainer.IvyClasspathUtil;
+import org.eclipse.core.resources.IProject;
 import org.eclipse.core.resources.ResourcesPlugin;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.jdt.core.IJavaProject;
@@ -103,25 +103,23 @@ public class WorkspaceResolver extends A
 
     public static final String CACHE_NAME = "__ivyde-workspace-resolver-cache";
 
-    private final IJavaProject resolvingJavaProject;
-
     private IJavaProject[] projects;
 
     private boolean ignoreBranchOnWorkspaceProjects;
 
     private boolean ignoreVersionOnWorkspaceProjects;
 
-    public WorkspaceResolver(IJavaProject javaProject, IvySettings ivySettings) {
-        this.resolvingJavaProject = javaProject;
-        setName(javaProject.getElementName() + "-ivyde-workspace-resolver");
+    public WorkspaceResolver(IProject project, IvySettings ivySettings) {
+        String projectName = project == null ? "<null>" : project.getName();
+        setName(projectName + "-ivyde-workspace-resolver");
         setSettings(ivySettings);
         setCache(CACHE_NAME);
 
         try {
             projects = JavaCore.create(ResourcesPlugin.getWorkspace().getRoot()).getJavaProjects();
         } catch (JavaModelException e) {
-            IvyPlugin.log(IStatus.ERROR, "JDT Error while resolving in workspace for "
-                    + resolvingJavaProject.getElementName(), e);
+            IvyPlugin.log(IStatus.ERROR, "JDT Error while resolving in workspace for the
project "
+                    + projectName, e);
         }
 
         ignoreBranchOnWorkspaceProjects = IvyPlugin.getPreferenceStoreHelper()



Mime
View raw message