ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hi...@apache.org
Subject svn commit: r697019 - in /ant/ivy/ivyde/trunk: org.apache.ivyde.eclipse/ org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/ test/ivy-base-dir/ test/ivy-base-dir/settings/ test/ivy-base-dir/src/
Date Fri, 19 Sep 2008 09:46:02 GMT
Author: hibou
Date: Fri Sep 19 02:46:01 2008
New Revision: 697019

URL: http://svn.apache.org/viewvc?rev=697019&view=rev
Log:
IVYDE-52:
- now the ivy base dir is set to the eclipse project location
- test project added, and it is correctly resolved

Added:
    ant/ivy/ivyde/trunk/test/ivy-base-dir/   (with props)
    ant/ivy/ivyde/trunk/test/ivy-base-dir/.classpath
    ant/ivy/ivyde/trunk/test/ivy-base-dir/.project
    ant/ivy/ivyde/trunk/test/ivy-base-dir/ivy.xml   (with props)
    ant/ivy/ivyde/trunk/test/ivy-base-dir/settings/
    ant/ivy/ivyde/trunk/test/ivy-base-dir/settings/ivysettings.xml   (with props)
    ant/ivy/ivyde/trunk/test/ivy-base-dir/src/
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

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=697019&r1=697018&r2=697019&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/CHANGES.txt (original)
+++ ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/CHANGES.txt Fri Sep 19 02:46:01 2008
@@ -9,6 +9,7 @@
 - NEW: Handle a project: scheme for the path of the ivysettings.xml (IVYDE-94)
 - NEW: Need CleanCache task in context menu (IVYDE-114)
 
+- IMPROVE: Set current working dir to eclipse project location (IVYDE-52)
 - IMPROVE: Make the classpath entries order configuration UI more intuitive (IVYDE-104)
 - IMPROVE: Retrieve after resolve feature does not clean target directory first (IVYDE-105)
 

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=697019&r1=697018&r2=697019&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
Fri Sep 19 02:46:01 2008
@@ -31,6 +31,7 @@
 
 import org.apache.ivy.Ivy;
 import org.apache.ivy.core.module.descriptor.ModuleDescriptor;
+import org.apache.ivy.core.settings.IvySettings;
 import org.apache.ivy.plugins.parser.ModuleDescriptorParserRegistry;
 import org.apache.ivy.util.Message;
 import org.apache.ivyde.eclipse.IvyDEException;
@@ -373,9 +374,12 @@
         if (settingsPath == null || settingsPath.trim().length() == 0) {
             // no settings specified, so take the default one
             if (ivy == null) {
-                ivy = new Ivy();
+                IvySettings ivySettings = new IvySettings();
+                if (javaProject != null) {
+                    ivySettings.setBaseDir(javaProject.getProject().getLocation().toFile());
+                }
                 try {
-                    ivy.configureDefault();
+                    ivySettings.loadDefault();
                 } catch (ParseException e) {
                     IvyDEException ex = new IvyDEException(
                             "Parsing error of the default Ivy settings",
@@ -391,6 +395,7 @@
                     setConfStatus(ex);
                     throw ex;
                 }
+                ivy = Ivy.newInstance(ivySettings);
             }
             setConfStatus(null);
             return ivy;
@@ -402,7 +407,7 @@
             String path = settingsPath.substring(pathIndex + 1);
             if (projectName.equals("")) {
                 IFile f = javaProject.getProject().getFile(path);
-                File file = new File(f.getLocation().toOSString());
+                File file = f.getLocation().toFile();
                 return getIvy(file);
             } else {
                 try {
@@ -425,8 +430,11 @@
                     File file = new File(f.getLocation().toOSString());
                     return getIvy(file);
                 } catch (JavaModelException e) {
-                    // TODO Auto-generated catch block
-                    e.printStackTrace();
+                    IvyDEException ex = new IvyDEException("The workspace is broken",
+                            "The projects in the workspace could not be listed when resolving
the settings ("
+                                    + this.toString() + ")", null);
+                    setConfStatus(ex);
+                    throw ex;
                 }
             }
         }
@@ -447,9 +455,12 @@
         } else {
             // an URL but not a file
             if (ivy == null || ivySettingsLastModified == -1) {
-                ivy = new Ivy();
+                IvySettings ivySettings = new IvySettings();
+                if (javaProject != null) {
+                    ivySettings.setBaseDir(javaProject.getProject().getLocation().toFile());
+                }
                 try {
-                    ivy.configure(url);
+                    ivySettings.load(url);
                     ivySettingsLastModified = 0;
                 } catch (ParseException e) {
                     IvyDEException ex = new IvyDEException("Parsing error of the Ivy settings",
@@ -464,6 +475,7 @@
                     setConfStatus(ex);
                     throw ex;
                 }
+                ivy = Ivy.newInstance(ivySettings);
             }
         }
         setConfStatus(null);
@@ -480,14 +492,17 @@
         }
 
         if (file.lastModified() != ivySettingsLastModified) {
-            ivy = new Ivy();
+            IvySettings ivySettings = new IvySettings();
+            if (javaProject != null) {
+                ivySettings.setBaseDir(javaProject.getProject().getLocation().toFile());
+            }
             if (ivySettingsLastModified == -1) {
                 Message.info("\n\n");
             } else {
                 Message.info("\n\nIVYDE: ivysettings has changed, configuring ivy again\n");
             }
             try {
-                ivy.configure(file);
+                ivySettings.load(file);
             } catch (ParseException e) {
                 IvyDEException ex = new IvyDEException("Parsing error of the Ivy settings",
                         "The ivy settings file '" + ivySettingsPath + "' could not be parsed
("
@@ -501,6 +516,7 @@
                 setConfStatus(ex);
                 throw ex;
             }
+            ivy = Ivy.newInstance(ivySettings);
             ivySettingsLastModified = file.lastModified();
         }
 

Propchange: ant/ivy/ivyde/trunk/test/ivy-base-dir/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Sep 19 02:46:01 2008
@@ -0,0 +1,2 @@
+bin
+

Added: ant/ivy/ivyde/trunk/test/ivy-base-dir/.classpath
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/test/ivy-base-dir/.classpath?rev=697019&view=auto
==============================================================================
--- ant/ivy/ivyde/trunk/test/ivy-base-dir/.classpath (added)
+++ ant/ivy/ivyde/trunk/test/ivy-base-dir/.classpath Fri Sep 19 02:46:01 2008
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+	<classpathentry kind="con" path="org.apache.ivyde.eclipse.cpcontainer.IVYDE_CONTAINER/?ivyXmlPath=ivy.xml&amp;confs=*&amp;ivySettingsPath=project%3A%2F%2F%2Fsettings%2Fivysettings.xml&amp;acceptedTypes=jar&amp;sourceTypes=source&amp;javadocTypes=javadoc&amp;sourceSuffixes=-source%2C-sources%2C-src&amp;javadocSuffixes=-javadoc%2C-javadocs%2C-doc%2C-docs&amp;doRetrieve=false&amp;retrievePattern=lib%2F%5Bconf%5D%2F%5Bartifact%5D.%5Bext%5D&amp;retrieveSync=false&amp;alphaOrder=false&amp;resolveInWorkspace=false"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>

Added: ant/ivy/ivyde/trunk/test/ivy-base-dir/.project
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/test/ivy-base-dir/.project?rev=697019&view=auto
==============================================================================
--- ant/ivy/ivyde/trunk/test/ivy-base-dir/.project (added)
+++ ant/ivy/ivyde/trunk/test/ivy-base-dir/.project Fri Sep 19 02:46:01 2008
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>ivydetest-ivy-base-dir</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>

Added: ant/ivy/ivyde/trunk/test/ivy-base-dir/ivy.xml
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/test/ivy-base-dir/ivy.xml?rev=697019&view=auto
==============================================================================
--- ant/ivy/ivyde/trunk/test/ivy-base-dir/ivy.xml (added)
+++ ant/ivy/ivyde/trunk/test/ivy-base-dir/ivy.xml Fri Sep 19 02:46:01 2008
@@ -0,0 +1,30 @@
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.    
+-->
+<ivy-module version="1.0"> 
+	<info organisation="org.apache.ivyde" module="ivytest-ivy-base-dir">
+		<description>
+		</description>
+	</info>
+	<configurations>
+		<conf name="default" />
+	</configurations>
+	<dependencies>
+		<dependency org="myorg" name="mymodule" rev="1.1" conf="default" />
+	</dependencies>
+</ivy-module>

Propchange: ant/ivy/ivyde/trunk/test/ivy-base-dir/ivy.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ant/ivy/ivyde/trunk/test/ivy-base-dir/ivy.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision Author HeadURL Id

Propchange: ant/ivy/ivyde/trunk/test/ivy-base-dir/ivy.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: ant/ivy/ivyde/trunk/test/ivy-base-dir/settings/ivysettings.xml
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/test/ivy-base-dir/settings/ivysettings.xml?rev=697019&view=auto
==============================================================================
--- ant/ivy/ivyde/trunk/test/ivy-base-dir/settings/ivysettings.xml (added)
+++ ant/ivy/ivyde/trunk/test/ivy-base-dir/settings/ivysettings.xml Fri Sep 19 02:46:01 2008
@@ -0,0 +1,10 @@
+<ivysettings>
+    <caches defaultCacheDir="${ivy.basedir}/../cache-fakerepo" useOrigin="false" />
+    <settings defaultResolver="fakerepo" checkUpToDate="false" />
+    <resolvers>
+        <filesystem name="fakerepo">
+            <ivy pattern="${ivy.basedir}/../fakerepo/[organisation]/[module]/ivy-[revision].xml"/>
+            <artifact pattern="${ivy.basedir}/../fakerepo/[organisation]/[module]/[type]s/[artifact]-[revision].[ext]"/>
+        </filesystem>
+    </resolvers>
+</ivysettings>

Propchange: ant/ivy/ivyde/trunk/test/ivy-base-dir/settings/ivysettings.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ant/ivy/ivyde/trunk/test/ivy-base-dir/settings/ivysettings.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision Author HeadURL Id

Propchange: ant/ivy/ivyde/trunk/test/ivy-base-dir/settings/ivysettings.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml



Mime
View raw message