Author: hibou
Date: Tue Nov 16 12:58:22 2010
New Revision: 1035625

URL: http://svn.apache.org/viewvc?rev=1035625&view=rev
Log:
IVYDE-247: new ${ivyproject_loc} variable support

Added:
    ant/ivy/ivyde/trunk/test/settings-by-project/
    ant/ivy/ivyde/trunk/test/settings-by-project/.classpath
    ant/ivy/ivyde/trunk/test/settings-by-project/.project
    ant/ivy/ivyde/trunk/test/settings-by-project/ivy.xml
    ant/ivy/ivyde/trunk/test/settings-by-project/ivysettings.xml
Modified:
    ant/ivy/ivyde/trunk/doc/release-notes.html
    
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/IvySettingsSetup.java
    
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/retrieve/StandaloneRetrieveSetup.java

Modified: ant/ivy/ivyde/trunk/doc/release-notes.html
URL: 
http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/doc/release-notes.html?rev=1035625&r1=1035624&r2=1035625&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/doc/release-notes.html (original)
+++ ant/ivy/ivyde/trunk/doc/release-notes.html Tue Nov 16 12:58:22 2010
@@ -130,6 +130,7 @@ List of changes since <a href="/ivy/ivyd
     <li>NEW: IvyDE can now resolve in an offline mode, where Ivy use only the 
caches (Ivy 2.3 required)</li>
     <li>NEW: Explicit ordering of configurations (IVYDE-159)</li>
     <li>NEW: Open the ivy file on the double click in the reverse dependency 
explorer</li>
+    <li>NEW: The ivysettings field editor now supports the variable 
${ivyproject_loc} which is referencing the current project being resolved 
(IVYDE-247)</li>
 </ul><ul>
     <li>IMPROVE: let IvyDE refresh workspace after a resolve (IVYDE-27) 
(thanks to Clint Burghduff)</li>
     <li>IMPROVE: IvyDE now resolve by batch, then preventing too many 
workspace build (IVYDE-177)</li>

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=1035625&r1=1035624&r2=1035625&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
 Tue Nov 16 12:58:22 2010
@@ -24,6 +24,7 @@ import java.util.List;
 import org.apache.ivyde.eclipse.IvyDEException;
 import org.apache.ivyde.eclipse.IvyPlugin;
 import org.apache.ivyde.eclipse.retrieve.RetrieveSetup;
+import org.eclipse.core.resources.IProject;
 import org.eclipse.core.runtime.IPath;
 import org.eclipse.jdt.core.IClasspathAttribute;
 import org.eclipse.jdt.core.IJavaProject;
@@ -206,12 +207,19 @@ public class IvyClasspathContainerConfig
     // Getters that take into account the global preferences
     // ///////////////////////////
 
+    private IProject getProject() {
+        if (javaProject == null) {
+            return null;
+        }
+        return javaProject.getProject();
+    }
+
     public String getInheritedIvySettingsPath() throws IvyDEException {
         if (!isSettingsProjectSpecific) {
             return IvyPlugin.getPreferenceStoreHelper().getIvySettingsSetup()
-                    .getResolvedIvySettingsPath();
+                    .getResolvedIvySettingsPath(getProject());
         }
-        return ivySettingsSetup.getResolvedIvySettingsPath();
+        return ivySettingsSetup.getResolvedIvySettingsPath(getProject());
     }
 
     public boolean getInheritedLoadSettingsOnDemandPath() {

Modified: 
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvySettingsSetup.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvySettingsSetup.java?rev=1035625&r1=1035624&r2=1035625&view=diff
==============================================================================
--- 
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvySettingsSetup.java
 (original)
+++ 
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvySettingsSetup.java
 Tue Nov 16 12:58:22 2010
@@ -25,6 +25,7 @@ import java.util.List;
 
 import org.apache.ivyde.eclipse.IvyDEException;
 import org.apache.ivyde.eclipse.IvyPlugin;
+import org.eclipse.core.resources.IProject;
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.variables.IStringVariableManager;
@@ -55,11 +56,18 @@ public class IvySettingsSetup {
         this.loadSettingsOnDemand = setup.loadSettingsOnDemand;
     }
 
-    public String getResolvedIvySettingsPath() throws IvyDEException {
+    public String getResolvedIvySettingsPath(IProject project) throws 
IvyDEException {
         String url;
         IStringVariableManager manager = 
VariablesPlugin.getDefault().getStringVariableManager();
+        String path;
+        if (project != null) {
+            path = ivySettingsPath.replaceAll("\\$\\{ivyproject_loc\\}", 
"\\${workspace_loc:"
+                + project.getName() + "}");
+        } else {
+            path = ivySettingsPath;            
+        }
         try {
-            url = manager.performStringSubstitution(ivySettingsPath, false);
+            url = manager.performStringSubstitution(path, false);
         } catch (CoreException e) {
             throw new IvyDEException("Unrecognized variables",
                     "Unrecognized variables in the Ivy settings file " + 
ivySettingsPath, e);

Modified: 
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/retrieve/StandaloneRetrieveSetup.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/retrieve/StandaloneRetrieveSetup.java?rev=1035625&r1=1035624&r2=1035625&view=diff
==============================================================================
--- 
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/retrieve/StandaloneRetrieveSetup.java
 (original)
+++ 
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/retrieve/StandaloneRetrieveSetup.java
 Tue Nov 16 12:58:22 2010
@@ -99,9 +99,9 @@ public class StandaloneRetrieveSetup {
     public String getInheritedIvySettingsPath() throws IvyDEException {
         if (!isSettingsProjectSpecific) {
             return IvyPlugin.getPreferenceStoreHelper().getIvySettingsSetup()
-                    .getResolvedIvySettingsPath();
+                    .getResolvedIvySettingsPath(project);
         }
-        return ivySettingsSetup.getResolvedIvySettingsPath();
+        return ivySettingsSetup.getResolvedIvySettingsPath(project);
     }
 
     public Collection getInheritedPropertyFiles() throws IvyDEException {

Added: ant/ivy/ivyde/trunk/test/settings-by-project/.classpath
URL: 
http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/test/settings-by-project/.classpath?rev=1035625&view=auto
==============================================================================
--- ant/ivy/ivyde/trunk/test/settings-by-project/.classpath (added)
+++ ant/ivy/ivyde/trunk/test/settings-by-project/.classpath Tue Nov 16 12:58:22 
2010
@@ -0,0 +1,25 @@
+<!--
+   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.    
+-->
+<?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=%24%7Bivyproject_loc%7D%2Fivysettings.xml&amp;loadSettingsOnDemand=false&amp;propertyFiles=&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&amp;retrievedClasspath=false&amp;mapIfOnlyOneSource=false&amp;mapIfOnlyOneJavadoc=false"/>
+       <classpathentry kind="output" path="bin"/>
+</classpath>

Added: ant/ivy/ivyde/trunk/test/settings-by-project/.project
URL: 
http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/test/settings-by-project/.project?rev=1035625&view=auto
==============================================================================
--- ant/ivy/ivyde/trunk/test/settings-by-project/.project (added)
+++ ant/ivy/ivyde/trunk/test/settings-by-project/.project Tue Nov 16 12:58:22 
2010
@@ -0,0 +1,36 @@
+<!--
+   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.    
+-->
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>ivydetest-settings-by-project</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>
+               <nature>org.apache.ivyde.eclipse.ivynature</nature>
+       </natures>
+</projectDescription>

Added: ant/ivy/ivyde/trunk/test/settings-by-project/ivy.xml
URL: 
http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/test/settings-by-project/ivy.xml?rev=1035625&view=auto
==============================================================================
--- ant/ivy/ivyde/trunk/test/settings-by-project/ivy.xml (added)
+++ ant/ivy/ivyde/trunk/test/settings-by-project/ivy.xml Tue Nov 16 12:58:22 
2010
@@ -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-settings-by-project">
+        <description>
+            Project with settings local to the project
+        </description>
+    </info>
+    <configurations>
+        <conf name="default" />
+    </configurations>
+    <dependencies>
+        <dependency org="myorg" name="mymodule" rev="1.1" conf="default" />
+    </dependencies>
+</ivy-module>

Added: ant/ivy/ivyde/trunk/test/settings-by-project/ivysettings.xml
URL: 
http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/test/settings-by-project/ivysettings.xml?rev=1035625&view=auto
==============================================================================
--- ant/ivy/ivyde/trunk/test/settings-by-project/ivysettings.xml (added)
+++ ant/ivy/ivyde/trunk/test/settings-by-project/ivysettings.xml Tue Nov 16 
12:58:22 2010
@@ -0,0 +1,28 @@
+<!--
+   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.    
+-->
+<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>


Reply via email to