On Tue, 10 May 2005, Erik Hatcher <[EMAIL PROTECTED]> wrote:

> I can (and probably will) change it such that <jjdoc> is not run if
> JavaCC is not present and adjust it so that the check for JavaCC is
> only done on the targets that truly need it (but are not part of the
> main build path).

This may be tricky, given the way the task works.

The task checks whether it finds javacc.jar or JavaCC.zip in a
specific location relative to the javacchome attribute.  In Gump you
can't trust this alone since Gump will make Ant ignore the internal
classpath of the task.

Given that there really is a lot of convulted logic involved because
the task supports four different versions with three different
classnames and three different archive locations (and no, there is no
one to one mapping of classname to archive location), you are probably
best of creating a condition yourself.

The <available> logic would be something like

<or>
  <and>
    <!-- JavaCC 1.x or 2.x -->
    <or>
      <available file="${javacchome}/JavaCC.zip"/>
      <available file="${javacchome}/bin/lib/JavaCC.zip"/>
    </or>
    <available classname="COM.sun.labs.jjdoc.JJDocMain">
      <classpath>
        <pathelement location="${javacchome}/JavaCC.zip"/>
        <pathelement location="${javacchome}/bin/lib/JavaCC.zip"/>
      </classpath>
    </available>
  </and>
  <and>
    <!-- JavaCC 3.x -->
    <or>
      <available file="${javacchome}/bin/lib/javacc.jar"/>
      <!-- JPackage RPM of 3.x -->
      <available file="${javacchome}/javacc.jar"/>
    </or>
    <or>
      <!-- JavaCC 3.0 -->
      <available classname="org.netbeans.javacc.jjdoc.JJDocMain">
        <classpath>
          <pathelement location="${javacchome}/bin/lib/javacc.jar"/>
          <pathelement location="${javacchome}/javacc.jar"/>
        </classpath>
      </available>
      <!-- JavaCC 3.1 -->
      <available classname="org.javacc.jjdoc.JJDocMain">
        <classpath>
          <pathelement location="${javacchome}/bin/lib/javacc.jar"/>
          <pathelement location="${javacchome}/javacc.jar"/>
        </classpath>
      </available>
    </or>
  </and>
</or>

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to