ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maart...@apache.org
Subject svn commit: r707168 - in /ant/ivy/core/branches/2.0.x: CHANGES.txt src/java/org/apache/ivy/core/settings/IvySettings.java test/java/org/apache/ivy/core/settings/XmlSettingsParserTest.java
Date Wed, 22 Oct 2008 19:27:08 GMT
Author: maartenc
Date: Wed Oct 22 12:27:08 2008
New Revision: 707168

URL: http://svn.apache.org/viewvc?rev=707168&view=rev
Log:
Merged code changes for IVY-953 into 2.0.x branch

Modified:
    ant/ivy/core/branches/2.0.x/CHANGES.txt
    ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/core/settings/IvySettings.java
    ant/ivy/core/branches/2.0.x/test/java/org/apache/ivy/core/settings/XmlSettingsParserTest.java

Modified: ant/ivy/core/branches/2.0.x/CHANGES.txt
URL: http://svn.apache.org/viewvc/ant/ivy/core/branches/2.0.x/CHANGES.txt?rev=707168&r1=707167&r2=707168&view=diff
==============================================================================
--- ant/ivy/core/branches/2.0.x/CHANGES.txt (original)
+++ ant/ivy/core/branches/2.0.x/CHANGES.txt Wed Oct 22 12:27:08 2008
@@ -89,6 +89,7 @@
 
 - IMPROVEMENT: Error messages on use of relative paths can be cyrptic (IVY-909)
 - IMPROVEMENT: Maven accepts illegal XML for its pom's, Ivy not (IVY-921)
+- IMPROVEMENT: Ivy should set the ${basedir} property (IVY-953)
 
 - FIX: NullPointerException in AbstractPatternsBasedResolver when organization is null (IVY-928)
 - FIX: NullPointerException when Ivy cannot locate pom parent (IVY-927)

Modified: ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/core/settings/IvySettings.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/core/settings/IvySettings.java?rev=707168&r1=707167&r2=707168&view=diff
==============================================================================
--- ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/core/settings/IvySettings.java (original)
+++ ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/core/settings/IvySettings.java Wed
Oct 22 12:27:08 2008
@@ -756,6 +756,7 @@
     public void setBaseDir(File baseDir) {
         this.baseDir = baseDir.getAbsoluteFile();
         setVariable("ivy.basedir", this.baseDir.getAbsolutePath());
+        setVariable("basedir", this.baseDir.getAbsolutePath(), false);
     }
     
     public File getBaseDir() {

Modified: ant/ivy/core/branches/2.0.x/test/java/org/apache/ivy/core/settings/XmlSettingsParserTest.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/branches/2.0.x/test/java/org/apache/ivy/core/settings/XmlSettingsParserTest.java?rev=707168&r1=707167&r2=707168&view=diff
==============================================================================
--- ant/ivy/core/branches/2.0.x/test/java/org/apache/ivy/core/settings/XmlSettingsParserTest.java
(original)
+++ ant/ivy/core/branches/2.0.x/test/java/org/apache/ivy/core/settings/XmlSettingsParserTest.java
Wed Oct 22 12:27:08 2008
@@ -572,6 +572,19 @@
         assertEquals(new File(basedir, "packager/cache"), packager.getResourceCache());
     }
 
+    public void testBaseDirVariables() throws Exception {
+        IvySettings settings = new IvySettings();
+        settings.setBaseDir(new File("test/base/dir"));
+        assertEquals(new File("test/base/dir").getAbsolutePath(), settings.getVariable("basedir"));
+        assertEquals(new File("test/base/dir").getAbsolutePath(), settings.getVariable("ivy.basedir"));
+
+        settings = new IvySettings();
+        settings.setVariable("basedir", new File("other/base/dir").getAbsolutePath());
+        settings.setBaseDir(new File("test/base/dir"));
+        assertEquals(new File("other/base/dir").getAbsolutePath(), settings.getVariable("basedir"));
+        assertEquals(new File("test/base/dir").getAbsolutePath(), settings.getVariable("ivy.basedir"));
+    }
+
     public static class MyOutputter implements ReportOutputter {
         public void output(
                 ResolveReport report, ResolutionCacheManager cacheMgr, ResolveOptions options)
{



Mime
View raw message