avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcconn...@apache.org
Subject svn commit: rev 22699 - in avalon/trunk/tools/magic/src/main/org/apache/avalon/tools: model tasks
Date Thu, 08 Jul 2004 08:33:22 GMT
Author: mcconnell
Date: Thu Jul  8 01:33:21 2004
New Revision: 22699

Modified:
   avalon/trunk/tools/magic/src/main/org/apache/avalon/tools/model/Magic.java
   avalon/trunk/tools/magic/src/main/org/apache/avalon/tools/tasks/GumpTask.java
Log:
Add trap to catch scenario where gump supplies a file instead of a directory in response to
reference="home" and fail early.

Modified: avalon/trunk/tools/magic/src/main/org/apache/avalon/tools/model/Magic.java
==============================================================================
--- avalon/trunk/tools/magic/src/main/org/apache/avalon/tools/model/Magic.java	(original)
+++ avalon/trunk/tools/magic/src/main/org/apache/avalon/tools/model/Magic.java	Thu Jul  8
01:33:21 2004
@@ -376,6 +376,13 @@
         if( null != path )
         {
             File system = new File( path );
+            if( system.exists() && system.isFile() )
+            {
+                final String error = 
+                  "Supplied 'magic.home' value is not directory ["
+                  + system;
+                throw new BuildException( error );
+            }
             return Context.getCanonicalFile( system );
         }
 

Modified: avalon/trunk/tools/magic/src/main/org/apache/avalon/tools/tasks/GumpTask.java
==============================================================================
--- avalon/trunk/tools/magic/src/main/org/apache/avalon/tools/tasks/GumpTask.java	(original)
+++ avalon/trunk/tools/magic/src/main/org/apache/avalon/tools/tasks/GumpTask.java	Thu Jul
 8 01:33:21 2004
@@ -446,7 +446,7 @@
         writer.write( 
            "\n      <!-- for magic -->" );
         writer.write( 
-           "\n      <depend name=\"magic.home\" reference=\"home\" project=\"magic\"/>"
);
+           "\n      <depend name=\"magic.home\" reference=\"home\" project=\"magic\" inherit=\"runtime\"/>"
);
         writer.write( 
            "\n      <property name=\"gump.signature\" value=\"@@DATE@@\"/>" );
 

---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@avalon.apache.org
For additional commands, e-mail: cvs-help@avalon.apache.org


Mime
View raw message