ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 1652] New - JJTree Task: invalid timestamp check of target in outputdir
Date Tue, 08 May 2001 12:56:27 GMT
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=1652

*** shadow/1652	Tue May  8 05:56:26 2001
--- shadow/1652.tmp.29849	Tue May  8 05:56:26 2001
***************
*** 0 ****
--- 1,52 ----
+ +============================================================================+
+ | JJTree Task: invalid timestamp check of target in outputdir                |
+ +----------------------------------------------------------------------------+
+ |        Bug #: 1652                        Product: Ant                     |
+ |       Status: NEW                         Version: 1.3                     |
+ |   Resolution:                            Platform: PC                      |
+ |     Severity: Minor                    OS/Version:                         |
+ |     Priority:                           Component: Optional Tasks          |
+ +----------------------------------------------------------------------------+
+ |  Assigned To: ant-dev@jakarta.apache.org                                   |
+ |  Reported By: leon.poyyayil@trivadis.com                                   |
+ +----------------------------------------------------------------------------+
+ |          URL:                                                              |
+ +============================================================================+
+ |                              DESCRIPTION                                   |
+ build.xml:
+ ...
+   <jjtree
+      target="${location.src}/${location.pkg}/MyParser.jjt"
+      javacchome="${location.javacc}/bin/lib"
+      outputdirectory="${location.build}/${location.pkg}">
+   </jjtree>
+ ...
+ 
+ This will generate the MyParser.jj although MyParser.jjt hadn't changed since
+ the last generation. This is not in accordance with the manual which states
+ "This task only invokes JJTree if the grammar file is newer than the generated
+ JavaCC file."
+ 
+ Verified with the nightly build source:
+   /builds/jakarta-ant/nightly/2001-05-07/jakarta-ant-1.4alpha-src.tar.gz
+ 
+ Can be fixed as follows:
+ in src/main/org/apache/tools/ant/taskdefs/optional/javacc/JJTree.java:190
+ 
+ change the line:
+ final File javaFile = new File(
+   target.toString().substring(0, target.toString().indexOf(".jjt")) + ".jj");
+ 
+ to something like:
+ final File javaFile = getOutputJavaFile(outputDirectory, target);
+ 
+ such a method (getOutputJavaFile) should consider the output directory. An
+ implementation of such a method already exists in JavaCC.java in the same
+ directory. It only needs some update to handle the different extensions
+ required for this task (.jjt -> jj instead of jj -> java).
+ 
+ Hope this helped. If you need further info feel free to contact me:
+ mailto:leon.poyyayil@trivadis.com
+ 
+ Greetings
+ Leon

Mime
View raw message