svn commit: rev 36617 - avalon/trunk/tools/magic/src/main/org/apache/avalon/tools/tasks
[email protected] 19 Aug 2004 17:52:12 -0000
| Newsgroups | gmane.comp.jakarta.avalon.cvs |
|---|---|
| Message-ID | <[email protected]> |
Author: niclas
Date: Thu Aug 19 10:52:11 2004
New Revision: 36617
Modified:
avalon/trunk/tools/magic/src/main/org/apache/avalon/tools/tasks/HomeTask.java
Log:
Added check that the project dir correspond with current dir.
Modified: avalon/trunk/tools/magic/src/main/org/apache/avalon/tools/tasks/HomeTask.java
==============================================================================
--- avalon/trunk/tools/magic/src/main/org/apache/avalon/tools/tasks/HomeTask.java (original)
+++ avalon/trunk/tools/magic/src/main/org/apache/avalon/tools/tasks/HomeTask.java Thu Aug 19 10:52:11 2004
@@ -17,6 +17,7 @@
package org.apache.avalon.tools.tasks;
+import org.apache.avalon.tools.model.Context;
import org.apache.avalon.tools.model.Definition;
import org.apache.avalon.tools.model.Info;
import org.apache.avalon.tools.model.Home;
@@ -115,10 +116,17 @@
private void verifyBaseDir( Definition def )
throws BuildException
{
- String defBase = def.getBaseDir().getAbsolutePath();
- String projBase = getProject().getBaseDir().getAbsolutePath();
+ String defBase = Context.getCanonicalPath( def.getBaseDir() );
+ String projBase = Context.getCanonicalPath( getProject().getBaseDir() );
if( defBase.equals( projBase ) )
return;
- throw new BuildException( "The basedir in the Magic Index file, does not correspond with the current working directory. Most probably, you have the wrong project name in the build.xml file." );
+ throw new BuildException(
+ "The basedir ["
+ + defBase
+ + "] declared in the project index for the key ["
+ + def.getKey()
+ + "] does not correspond with the current working directory ["
+ + projBase
+ + "]. Most probably, you have the wrong project name in the build.xml file." );
}
}