ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xav...@apache.org
Subject svn commit: r729881 - in /ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse: CHANGES.txt src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainerConfiguration.java src/java/org/apache/ivyde/eclipse/cpcontainer/IvydeContainerPage.java
Date Mon, 29 Dec 2008 12:20:49 GMT
Author: xavier
Date: Mon Dec 29 04:20:49 2008
New Revision: 729881

URL: http://svn.apache.org/viewvc?rev=729881&view=rev
Log:
- FIX: project://[projectname]/ scheme for settings only work with java projects, not simple
projects (IVYDE-145)
- default to '*' when no module configuration is selected for a classpath container, instead
of resulting in a empty and invisble cp container

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

Modified: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/CHANGES.txt
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/CHANGES.txt?rev=729881&r1=729880&r2=729881&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/CHANGES.txt (original)
+++ ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/CHANGES.txt Mon Dec 29 04:20:49 2008
@@ -6,6 +6,7 @@
 - FIX: When migrating from ivyde alpha to ivyde beta eclipse is throwing NPE at startup (IVYDE-136)
(thanks to Daniel Becheanu)
 - FIX: The retrieve configuration doesn't support '*' as accepted types (IVYDE-137) (thanks
to Daniel Becheanu)
 - FIX: NPE when a project:/// path is used and path does not exist (IVYDE-144)
+- FIX: project://[projectname]/ scheme for settings only work with java projects, not simple
projects (IVYDE-145)
 
   version 2.0.0 beta1
 ==========================

Modified: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainerConfiguration.java
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainerConfiguration.java?rev=729881&r1=729880&r2=729881&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainerConfiguration.java
(original)
+++ ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainerConfiguration.java
Mon Dec 29 04:20:49 2008
@@ -27,6 +27,7 @@
 import java.text.ParseException;
 import java.util.Arrays;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.List;
 
 import org.apache.ivy.Ivy;
@@ -164,6 +165,9 @@
         // load some configuration that can be loaded
         ivyXmlPath = path.removeFirstSegments(1).removeLastSegments(1).toString();
         confs = IvyClasspathUtil.split(path.lastSegment());
+        if (confs.isEmpty()) {
+            confs = Collections.singletonList("*");
+        }
         // the last part of the configuration coming from the preferences cannot be loaded
due to
         // the bug described in IVYDE-70, so the configuration is let as the default one
     }
@@ -196,6 +200,9 @@
                 ivyXmlPath = value;
             } else if (parameter[0].equals("confs")) {
                 confs = IvyClasspathUtil.split(value);
+                if (confs.isEmpty()) {
+                    confs = Collections.singletonList("*");
+                }
             } else if (parameter[0].equals("ivySettingsPath")) {
                 ivySettingsPath = readOldIvySettings(value);
             } else if (parameter[0].equals("doRetrieve")) {
@@ -441,7 +448,7 @@
                 IFile f = javaProject.getProject().getFile(path);
                 if (!f.exists()) {
                     IvyDEException ex = new IvyDEException("Ivy settings file not found",
-                        "The Ivy settings file '" + ivySettingsPath + "' cannot be found
("
+                        "The Ivy settings file '" + settingsPath + "' cannot be found ("
                                 + this.toString() + ")", null);
                     setConfStatus(ex);
                     throw ex;
@@ -449,32 +456,24 @@
                 File file = f.getLocation().toFile();
                 return getIvy(file);
             } else {
-                try {
-                    IJavaProject[] javaProjects = JavaCore.create(
-                        ResourcesPlugin.getWorkspace().getRoot()).getJavaProjects();
-                    int i;
-                    for (i = 0; i < javaProjects.length; i++) {
-                        if (javaProjects[i].getProject().getName().equals(projectName)) {
-                            break;
-                        }
-                    }
-                    if (i == javaProjects.length) {
-                        IvyDEException ex = new IvyDEException("Project '" + projectName
-                                + "' not found", "The project name '" + projectName + "'
from '"
-                                + settingsPath + "' was not found (" + this.toString() +
")", null);
-                        setConfStatus(ex);
-                        throw ex;
-                    }
-                    IFile f = javaProjects[i].getProject().getFile(path);
-                    File file = new File(f.getLocation().toOSString());
-                    return getIvy(file);
-                } catch (JavaModelException e) {
-                    IvyDEException ex = new IvyDEException("The workspace is broken",
-                            "The projects in the workspace could not be listed when resolving
the settings ("
-                                    + this.toString() + ")", null);
+                IResource p = ResourcesPlugin.getWorkspace().getRoot().findMember(projectName);
+                if (p == null) {
+                    IvyDEException ex = new IvyDEException("Project '" + projectName
+                        + "' not found", "The project name '" + projectName + "' from '"
+                        + settingsPath + "' was not found (" + this.toString() + ")", null);
                     setConfStatus(ex);
                     throw ex;
                 }
+                IFile f = p.getProject().getFile(path);
+                if (!f.exists()) {
+                    IvyDEException ex = new IvyDEException("Ivy settings file not found",
+                        "The Ivy settings file '" + path + "' cannot be found in project
'" 
+                        + projectName + "'", null);
+                    setConfStatus(ex);
+                    throw ex;
+                }
+                File file = new File(f.getLocation().toOSString());
+                return getIvy(file);
             }
         }
         // before returning the found ivy, try to refresh it if the settings changed

Modified: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvydeContainerPage.java
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvydeContainerPage.java?rev=729881&r1=729880&r2=729881&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvydeContainerPage.java
(original)
+++ ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvydeContainerPage.java
Mon Dec 29 04:20:49 2008
@@ -17,6 +17,8 @@
  */
 package org.apache.ivyde.eclipse.cpcontainer;
 
+import java.util.Collections;
+
 import org.apache.ivy.core.module.descriptor.ModuleDescriptor;
 import org.apache.ivyde.eclipse.IvyDEException;
 import org.apache.ivyde.eclipse.IvyPlugin;
@@ -122,6 +124,10 @@
 
     public boolean finish() {
         conf.confs = confTableViewer.getSelectedConfigurations();
+        if (conf.confs.isEmpty()) {
+            conf.confs = Collections.singletonList("*");
+        }
+
         if (settingsProjectSpecificButton.getSelection()) {
             conf.ivySettingsPath = settingsText.getSettingsPath();
             conf.acceptedTypes = acceptedSuffixesTypesComposite.getAcceptedTypes();



Mime
View raw message