avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: jakarta-avalon-excalibur/info/src/java/org/apache/avalon/framework/tools/ant MetaGenerateTask.java
Date Sat, 16 Nov 2002 07:41:30 GMT
donaldp     2002/11/15 23:41:30

  Modified:    info/src/java/org/apache/avalon/framework/tools/ant
                        MetaGenerateTask.java
  Log:
  Make sure parent directory exists
  
  Revision  Changes    Path
  1.7       +13 -3     jakarta-avalon-excalibur/info/src/java/org/apache/avalon/framework/tools/ant/MetaGenerateTask.java
  
  Index: MetaGenerateTask.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/info/src/java/org/apache/avalon/framework/tools/ant/MetaGenerateTask.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- MetaGenerateTask.java	16 Nov 2002 07:05:38 -0000	1.6
  +++ MetaGenerateTask.java	16 Nov 2002 07:41:30 -0000	1.7
  @@ -192,13 +192,23 @@
               {
                   final String classname = javaClass.getFullyQualifiedName();
                   final File source = javaClass.getParentSource().getFile();
  -                final File dest = getOutputFileForClass(classname);
  +                final File dest = getOutputFileForClass( classname );
                   if( !m_force )
                   {
                       if( dest.exists() &&
  -                        dest.lastModified() >= source.lastModified() );
  +                        dest.lastModified() >= source.lastModified() )
                       {
                           continue;
  +                    }
  +                }
  +                final File parent = dest.getParentFile();
  +                if( null != parent )
  +                {
  +                    if( !parent.exists() && !parent.mkdirs() )
  +                    {
  +                        final String message =
  +                            "Failed to create output directory: " + parent;
  +                        throw new BuildException( message );
                       }
                   }
                   writeInfo( info );
  
  
  

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


Mime
View raw message