Author: hibou
Date: Sun Nov 15 19:20:52 2009
New Revision: 836397

URL: http://svn.apache.org/viewvc?rev=836397&view=rev
Log:
IVYDE-211 : handle the Eclipse's linked folders when computing of absolute path 
of the ivy.xml

Added:
    ant/ivy/ivyde/trunk/test/linked-folder/
    ant/ivy/ivyde/trunk/test/linked-folder/.classpath
    ant/ivy/ivyde/trunk/test/linked-folder/.project
    ant/ivy/ivyde/trunk/test/linked-folder/ivysettings.xml   (with props)
    ant/ivy/ivyde/trunk/test/linked-folder/linked/
    ant/ivy/ivyde/trunk/test/linked-folder/linked/ivy.xml   (with props)
Modified:
    
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainerState.java
    ant/ivy/ivyde/trunk/test/README.txt

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=836397&r1=836396&r2=836397&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
 Sun Nov 15 19:20:52 2009
@@ -40,6 +40,7 @@
 import org.apache.ivyde.eclipse.IvyPlugin;
 import org.apache.ivyde.eclipse.workspaceresolver.WorkspaceIvySettings;
 import org.apache.ivyde.eclipse.workspaceresolver.WorkspaceResolver;
+import org.eclipse.core.resources.IFile;
 import org.eclipse.core.resources.IMarker;
 import org.eclipse.core.resources.IProject;
 import org.eclipse.core.resources.IResource;
@@ -320,8 +321,14 @@
     public File getIvyFile() {
         File file = new File(conf.getIvyXmlPath());
         if (!file.isAbsolute() && 
!FakeProjectManager.isFake(conf.getJavaProject())) {
-            file = 
conf.getJavaProject().getProject().getLocation().append(conf.getIvyXmlPath())
-                    .toFile();
+            Path ivyPath = new Path(conf.getIvyXmlPath());
+            // get the file location in Eclipse "space"
+            IFile ivyfile = 
conf.getJavaProject().getProject().getFile(ivyPath);
+            // compute the actual file system location, following Eclipse's 
linked folders (see
+            // IVYDE-211)
+            IPath ivyLocation = ivyfile.getLocation();
+            // get the corresponding java.io.File instance
+            file = ivyLocation.toFile();
         }
         return file;
     }

Modified: ant/ivy/ivyde/trunk/test/README.txt
URL: 
http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/test/README.txt?rev=836397&r1=836396&r2=836397&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/test/README.txt (original)
+++ ant/ivy/ivyde/trunk/test/README.txt Sun Nov 15 19:20:52 2009
@@ -8,3 +8,8 @@
 Expectation:
  * each IvyDE classpath container to resolve correctly
  * the projects are expected to compile correctly
+
+Exception:
+ * project 'linked-folder': it is relying on some Eclipse linked folder which
+   requires some absolute path. You probably will require to change it to make
+   it resolve correctly
\ No newline at end of file

Added: ant/ivy/ivyde/trunk/test/linked-folder/.classpath
URL: 
http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/test/linked-folder/.classpath?rev=836397&view=auto
==============================================================================
--- ant/ivy/ivyde/trunk/test/linked-folder/.classpath (added)
+++ ant/ivy/ivyde/trunk/test/linked-folder/.classpath Sun Nov 15 19:20:52 2009
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="src" path="src"/>
+       <classpathentry kind="src" path="link"/>
+       <classpathentry kind="con" 
path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+       <classpathentry kind="con" 
path="org.apache.ivyde.eclipse.cpcontainer.IVYDE_CONTAINER/?ivyXmlPath=link%2Fivy.xml&amp;confs=*&amp;ivySettingsPath=project%3A%2F%2F%2Fivysettings.xml&amp;loadSettingsOnDemand=false&amp;propertyFiles=&amp;doRetrieve=false&amp;retrievePattern=lib%2F%5Bconf%5D%2F%5Bartifact%5D.%5Bext%5D&amp;retrieveSync=false&amp;retrieveConfs=*&amp;retrieveTypes=*&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;alphaOrder=false&amp;resolveInWorkspace=false&amp;resolveBeforeLaunch=false"/>
+       <classpathentry kind="output" path="bin"/>
+</classpath>

Added: ant/ivy/ivyde/trunk/test/linked-folder/.project
URL: 
http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/test/linked-folder/.project?rev=836397&view=auto
==============================================================================
--- ant/ivy/ivyde/trunk/test/linked-folder/.project (added)
+++ ant/ivy/ivyde/trunk/test/linked-folder/.project Sun Nov 15 19:20:52 2009
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>ivydetest-linked-folder</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>
+       <linkedResources>
+               <link>
+                       <name>link</name>
+                       <type>2</type>
+                       
<location>/Users/hibou/dev/ivy/git-ivyde/test/linked-folder/linked</location>
+               </link>
+       </linkedResources>
+</projectDescription>

Added: ant/ivy/ivyde/trunk/test/linked-folder/ivysettings.xml
URL: 
http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/test/linked-folder/ivysettings.xml?rev=836397&view=auto
==============================================================================
--- ant/ivy/ivyde/trunk/test/linked-folder/ivysettings.xml (added)
+++ ant/ivy/ivyde/trunk/test/linked-folder/ivysettings.xml Sun Nov 15 19:20:52 
2009
@@ -0,0 +1,10 @@
+<ivysettings>
+    <caches defaultCacheDir="${ivy.settings.dir}/../cache-fakerepo" 
useOrigin="false" />
+    <settings defaultResolver="fakerepo" checkUpToDate="false" />
+    <resolvers>
+        <filesystem name="fakerepo">
+            <ivy 
pattern="${ivy.settings.dir}/../fakerepo/[organisation]/[module]/ivy-[revision].xml"/>
+            <artifact 
pattern="${ivy.settings.dir}/../fakerepo/[organisation]/[module]/[type]s/[artifact]-[revision].[ext]"/>
+        </filesystem>
+    </resolvers>
+</ivysettings>

Propchange: ant/ivy/ivyde/trunk/test/linked-folder/ivysettings.xml
------------------------------------------------------------------------------
    svn:eol-style = native

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

Propchange: ant/ivy/ivyde/trunk/test/linked-folder/ivysettings.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: ant/ivy/ivyde/trunk/test/linked-folder/linked/ivy.xml
URL: 
http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/test/linked-folder/linked/ivy.xml?rev=836397&view=auto
==============================================================================
--- ant/ivy/ivyde/trunk/test/linked-folder/linked/ivy.xml (added)
+++ ant/ivy/ivyde/trunk/test/linked-folder/linked/ivy.xml Sun Nov 15 19:20:52 
2009
@@ -0,0 +1,31 @@
+<!--
+   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-linked-folder">
+        <description>
+            Project with an ivy.xml in a linked folder
+        </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/linked-folder/linked/ivy.xml
------------------------------------------------------------------------------
    svn:eol-style = native

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

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


Reply via email to