Velocity
  1. Velocity
  2. VELOCITY-222

[patch] add javacc task to build.xml

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.5
    • Fix Version/s: 1.5
    • Component/s: Build
    • Labels:
      None
    • Environment:
      Operating System: other
      Platform: Other

      Description

      This patch adds a new task "parser" to build.xml. This task runs jjtree and
      javacc on the source file Parser.jjt. It's an independent task, nothing else
      is dependent on it. (such as compile). The purpose is to speed up
      integrating changes to the parse syntax into the source tree. (replacing the
      odd and non-platform independent "build" script at
      src/org/apache/velocity/runtime/parser).

      Including this patch as an optional task would make things more efficient for
      those of us playing with the syntax, but keep compilation simple in general.

      You could argue that this task should be integrated into the general build
      process (e.g. remove Parser.java, etc. out of the source tree), but I think
      this wouldn't be wise. The main reason is that it makes it too hard for
      novice developers to compile Velocity. (They'd have to learn javacc in
      addition to ant). It'd be good to keep the barriers to entry for developers
      low.

      Finally, note that ant 1.5 is not compatible with javacc 3.x. To use this
      task with javacc3.1, you must upgrade to the 1.6 version of ant (currently
      only available as a nightly build). I've found it useful, but some may feel
      this is enough of a reason to keep this patch out of CVS. (I'd appreciate
      comments).

      1. ASF.LICENSE.NOT.GRANTED--build.xml.patch
        3 kB
        Will Glass-Husain
      2. ASF.LICENSE.NOT.GRANTED--build.xml.patch
        4 kB
        Will Glass-Husain
      3. ASF.LICENSE.NOT.GRANTED--build.xml.patch
        4 kB
        Will Glass-Husain
      4. ASF.LICENSE.NOT.GRANTED--build.xml.patch
        5 kB
        Will Glass-Husain

        Activity

        Hide
        Will Glass-Husain added a comment -

        Created an attachment (id=8879)
        patch to build.xml

        Show
        Will Glass-Husain added a comment - Created an attachment (id=8879) patch to build.xml
        Hide
        Will Glass-Husain added a comment -

        Created an attachment (id=8882)
        corrected patch to build.xml (specifies output directory)

        Show
        Will Glass-Husain added a comment - Created an attachment (id=8882) corrected patch to build.xml (specifies output directory)
        Hide
        Geir Magnusson Jr added a comment -

        Fine idea but :

        1) We should continue to keep velocity buildable w/o javacc, so we checking the artifacts of javacc.

        2) You are 100% right that the ant 1.6 dependency is a show stopper

        I'm parking this one as LATER. Feel free to submit a build.bat for the OS-challenged - that
        should certainly go in there

        Show
        Geir Magnusson Jr added a comment - Fine idea but : 1) We should continue to keep velocity buildable w/o javacc, so we checking the artifacts of javacc. 2) You are 100% right that the ant 1.6 dependency is a show stopper I'm parking this one as LATER. Feel free to submit a build.bat for the OS-challenged - that should certainly go in there
        Hide
        Will Glass-Husain added a comment -

        Seems reasonable. I'll note for the record though that neither ant 1.6 nor
        javacc are required to build Velocity, even with this patch. They are only
        required for this specific (and optional) task.

        The source files for Parser.java, etc are still in the tree and still
        compilable as always.

        Show
        Will Glass-Husain added a comment - Seems reasonable. I'll note for the record though that neither ant 1.6 nor javacc are required to build Velocity, even with this patch. They are only required for this specific (and optional) task. The source files for Parser.java, etc are still in the tree and still compilable as always.
        Hide
        Daniel Rall added a comment -

        Geir, if the Ant 1.6 dependency is soft, I'd like to consider Will's changes for
        Velocity 1.5 with the stipulation that an appropriate warning message is
        displayed when those who don't have the necessary dependencies satisfied try and
        invoke the "parser" target. As Will's patch stands today, a check is done for
        the existance of the directory pointed to by the "javacc.home" property – this
        check would need to be expanded a bit to meet the above requirement. Also, it
        should be line wrapped for 80 columns or less.

        Show
        Daniel Rall added a comment - Geir, if the Ant 1.6 dependency is soft, I'd like to consider Will's changes for Velocity 1.5 with the stipulation that an appropriate warning message is displayed when those who don't have the necessary dependencies satisfied try and invoke the "parser" target. As Will's patch stands today, a check is done for the existance of the directory pointed to by the "javacc.home" property – this check would need to be expanded a bit to meet the above requirement. Also, it should be line wrapped for 80 columns or less.
        Hide
        Will Glass-Husain added a comment -

        Created an attachment (id=8954)
        new patch for build.xml following dlr recommendations

        Show
        Will Glass-Husain added a comment - Created an attachment (id=8954) new patch for build.xml following dlr recommendations
        Hide
        Will Glass-Husain added a comment -

        Created an attachment (id=8957)
        oops! forgot to save file. This is the new patch (replacing previous)

        Show
        Will Glass-Husain added a comment - Created an attachment (id=8957) oops! forgot to save file. This is the new patch (replacing previous)
        Hide
        Will Glass-Husain added a comment -

        Ant 1.6 has been out for almost 2 years now. (Since December of 2003). I'm wondering if anyone objects if we put this patch in.

        Note that there's no loss of functionality for earlier versions of ant - the taks should simply display a warning message if the ant dependency isn't met.

        Show
        Will Glass-Husain added a comment - Ant 1.6 has been out for almost 2 years now. (Since December of 2003). I'm wondering if anyone objects if we put this patch in. Note that there's no loss of functionality for earlier versions of ant - the taks should simply display a warning message if the ant dependency isn't met.
        Hide
        Will Glass-Husain added a comment -

        Asked about this on dev list - no comments. Thus blessed by the power of lazy consensus - committed.

        Show
        Will Glass-Husain added a comment - Asked about this on dev list - no comments. Thus blessed by the power of lazy consensus - committed.

          People

          • Assignee:
            Unassigned
            Reporter:
            Will Glass-Husain
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development