Beehive
  1. Beehive
  2. BEEHIVE-374

Make <apt> ant task respect the fork attribute

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: V1Alpha, V1Beta, v1m1, 1.0, 1.0.1
    • Fix Version/s: None
    • Component/s: Controls
    • Labels:
      None

      Description

      The <apt> ant task is built on top of the built-in <javac> task, which includes a "fork" attribute enabling in-proc invocation of the compiler. Currently, the apt task ignores this attribute and will always launch the apt executable in a seperate process.

      The Javac ant task has a pluggable architecture for invoking different compilers and already has support built in for the various jdk compilers, jikes, sj, etc.

      I think doing this would only involve writing one of these CompilerAdaptor classes for in-proc APT invocations, then modifying AptTask to configure it.

      Sample compiler adaptors can be found in the ant source distribution under src/main/org/apache/tools/ant/taskdefs/compilers.

      1. BEEHIVE-374.diff
        6 kB
        Chad Schoettger
      2. BEEHIVE-374.zip
        1 kB
        Chad Schoettger

        Activity

        Hide
        Steve Tocco added a comment -

        moving to v1 (if not needed for ship, please move to Fix For = TBD)

        Show
        Steve Tocco added a comment - moving to v1 (if not needed for ship, please move to Fix For = TBD)
        Hide
        Steve Tocco added a comment -

        moving to v1 (if not needed for ship, please move to Fix For = TBD)

        Show
        Steve Tocco added a comment - moving to v1 (if not needed for ship, please move to Fix For = TBD)
        Hide
        Kyle Marvin added a comment -

        This is really just a build perf issue, not a functional one, so I am going to push it out a bit. Scream if you think this is wrong!

        Show
        Kyle Marvin added a comment - This is really just a build perf issue, not a functional one, so I am going to push it out a bit. Scream if you think this is wrong!
        Hide
        Kyle Marvin added a comment -

        Meant to change "Fix Version" on last edit, but accidentally modified "Affects Version". Correcting....

        Show
        Kyle Marvin added a comment - Meant to change "Fix Version" on last edit, but accidentally modified "Affects Version". Correcting....
        Hide
        Eddie O'Neil added a comment -

        Setting component.

        Show
        Eddie O'Neil added a comment - Setting component.
        Hide
        Chad Schoettger added a comment -

        I have created a new class, org.apache.beehive.controls.runtime.generator.AptCompilerAdapter, to support invoking the APT compiler in-process. The AptTask has also been modified. The default behavior of the AptTask will remain the same (still fork the APT process) unless the task's fork attribute has been explicitly set to 'no' in the ant build file.

        To apply patch:

        • the BEEHIVE-374.zip file contains the new class 'AptCompilerAdapter' which should be extracted to:
          <beehive>controls/src/runtime/src/org/apache/beehive/controls/runtime/generator
        • apply the BEEHIVE-374.diff file as a patch, will patch the AptTask with the necessary changes to enable in-process invocation of the APT compiler.
        Show
        Chad Schoettger added a comment - I have created a new class, org.apache.beehive.controls.runtime.generator.AptCompilerAdapter, to support invoking the APT compiler in-process. The AptTask has also been modified. The default behavior of the AptTask will remain the same (still fork the APT process) unless the task's fork attribute has been explicitly set to 'no' in the ant build file. To apply patch: the BEEHIVE-374 .zip file contains the new class 'AptCompilerAdapter' which should be extracted to: <beehive>controls/src/runtime/src/org/apache/beehive/controls/runtime/generator apply the BEEHIVE-374 .diff file as a patch, will patch the AptTask with the necessary changes to enable in-process invocation of the APT compiler.
        Hide
        Chad Schoettger added a comment -

        to Eddie for review/commit

        Show
        Chad Schoettger added a comment - to Eddie for review/commit
        Hide
        Eddie O'Neil added a comment -

        Chad – I tried this, and the patch works with the default fork setting, but in switching the "fork" flag to "false" to run APT embedded, the controls DRTs fail when building the web application.

        This isn't a big deal; I'll pass this back to you for the time being. Might be worth another look at some point.

        Show
        Eddie O'Neil added a comment - Chad – I tried this, and the patch works with the default fork setting, but in switching the "fork" flag to "false" to run APT embedded, the controls DRTs fail when building the web application. This isn't a big deal; I'll pass this back to you for the time being. Might be worth another look at some point.
        Hide
        Chad Schoettger added a comment -

        After a bit more investigation it appears that Ant has some problems running Apt when fork is set to false. It appears that Ant will be disabling setting the fork attribute to false in the near future, (See ASF Bugzilla 33882 for additional information).

        I have been seeing errors when running with fork set to false, here's a sample:

        [apt] warning: Bad annotation processor factory: java.lang.ClassCastException: org.apache.beehive.controls.runtime.generator.apt.ControlAnnotationProcessorFactory
        [apt] warning: Bad annotation processor factory: java.lang.ClassCastException: org.apache.beehive.controls.runtime.generator.apt.ControlClientAnnotationProcessorFactory

        I think the best thing for now is to hold off on fixing this bug until things settle down in Ant around apt.

        Show
        Chad Schoettger added a comment - After a bit more investigation it appears that Ant has some problems running Apt when fork is set to false. It appears that Ant will be disabling setting the fork attribute to false in the near future, (See ASF Bugzilla 33882 for additional information). I have been seeing errors when running with fork set to false, here's a sample: [apt] warning: Bad annotation processor factory: java.lang.ClassCastException: org.apache.beehive.controls.runtime.generator.apt.ControlAnnotationProcessorFactory [apt] warning: Bad annotation processor factory: java.lang.ClassCastException: org.apache.beehive.controls.runtime.generator.apt.ControlClientAnnotationProcessorFactory I think the best thing for now is to hold off on fixing this bug until things settle down in Ant around apt.

          People

          • Assignee:
            Unassigned
            Reporter:
            Kyle Marvin
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:

              Development