ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From co...@apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/javacc JJTree.java
Date Tue, 20 Feb 2001 13:01:48 GMT
conor       01/02/20 05:01:48

  Modified:    src/main/org/apache/tools/ant/taskdefs/optional/javacc Tag:
                        ANT_13_BRANCH JJTree.java
  Log:
  Bring task into line with documentation
  Put in workaround for JJTree bug/features
  
  Submitted by:	Stephane Bailliez <sbailliez@imediation.com>
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.2.2.1   +13 -9     jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/javacc/JJTree.java
  
  Index: JJTree.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/javacc/JJTree.java,v
  retrieving revision 1.2
  retrieving revision 1.2.2.1
  diff -u -r1.2 -r1.2.2.1
  --- JJTree.java	2001/01/03 14:18:42	1.2
  +++ JJTree.java	2001/02/20 13:01:45	1.2.2.1
  @@ -171,18 +171,22 @@
               cmdl.createArgument().setValue("-"+name+":"+value.toString());
           }
   
  -        // load command line with required attributes
  -        if (outputDirectory != null) {
  -            if (!outputDirectory.isDirectory()) {
  -                throw new BuildException("Outputdir not a directory.");
  -            }
  -            cmdl.createArgument().setValue(
  -                "-OUTPUT_DIRECTORY:"+outputDirectory.getAbsolutePath());
  -        }
  -
           if (target == null || !target.isFile()) {
               throw new BuildException("Invalid target: " + target);
           }
  +        
  +        // use the directory containing the target as the output directory
  +        if (outputDirectory == null) {
  +            outputDirectory = new File(target.getParent());
  +        }        
  +        if (!outputDirectory.isDirectory() ) {
  +            throw new BuildException("'outputdirectory' " + outputDirectory + " is not
a directory.");
  +        }
  +        // convert backslashes to slashes, otherwise jjtree will put this as
  +        // comments and this seems to confuse javacc
  +        cmdl.createArgument().setValue(
  +            "-OUTPUT_DIRECTORY:"+outputDirectory.getAbsolutePath().replace('\\', '/'));
  +        
           final File javaFile = new File(
               target.toString().substring(0, target.toString().indexOf(".jjt")) + ".jj");
           if (javaFile.exists() && target.lastModified() < javaFile.lastModified())
{
  
  
  

Mime
View raw message