bodewig 2003/07/11 02:03:20
Modified: src/main/org/apache/tools/ant/taskdefs/optional/javacc
JavaCC.java
Log:
Deal with jpackage's file system layout.
Submitted by: Paul Nasrat <pauln at truemesh dot com>
Revision Changes Path
1.24 +15 -2
ant/src/main/org/apache/tools/ant/taskdefs/optional/javacc/JavaCC.java
Index: JavaCC.java
===================================================================
RCS file:
/home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/javacc/JavaCC.java,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- JavaCC.java 7 Jul 2003 09:08:44 -0000 1.23
+++ JavaCC.java 11 Jul 2003 09:03:20 -0000 1.24
@@ -114,7 +114,9 @@
protected static final String[] ARCHIVE_LOCATIONS =
new String[] {"JavaCC.zip", "bin/lib/JavaCC.zip",
- "bin/lib/javacc.jar"};
+ "bin/lib/javacc.jar",
+ "javacc.jar", // used by jpackage for JavaCC 3.x
+ };
protected static final String COM_PACKAGE = "COM.sun.labs.";
protected static final String COM_JAVACC_CLASS = "javacc.Main";
@@ -395,6 +397,7 @@
break;
case 3:
+ case 4:
/*
* This is where the fun starts, JavaCC 3.0 uses
* org.netbeans.javacc, 3.1 uses org.javacc - I wonder
@@ -448,10 +451,20 @@
/**
* Helper method to determine the major version number of JavaCC.
+ *
+ * <p>Don't assume any relation between the number returned by
+ * this method and the "major version number" of JavaCC
+ * installed. Both 3 and 4 map to JavaCC 3.x (with no difference
+ * between 3.0 and 3.1).</p>
+ *
+ * <p>This method is only useful within this class itself, use
+ * [EMAIL PROTECTED] #getArchiveFile getArchiveFile} and [EMAIL
PROTECTED] #getMainClass
+ * getMainClass} for more widely useful results.</p>
+ *
* @param home the javacc home path directory.
* @throws BuildException thrown if the home directory is invalid
* or if the archive could not be found despite attempts to do so.
- * @return the file object pointing to the JavaCC archive.
+ * @return a number that is useless outside the scope of this class
*/
protected static int getMajorVersionNumber(File home)
throws BuildException {
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]