This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 180033 - Processors in j2seproject src no longer run in test
Summary: Processors in j2seproject src no longer run in test
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Project (show other bugs)
Version: 6.x
Hardware: PC Linux
: P2 normal (vote)
Assignee: Jan Lahoda
URL:
Keywords: REGRESSION
Depends on:
Blocks: 179749
  Show dependency tree
 
Reported: 2010-01-30 17:54 UTC by Jesse Glick
Modified: 2010-02-08 05:46 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2010-01-30 17:54:36 UTC
I have a j2seproject which defines an annotation processor in src/ (together with a registration in src/META-INF/services/javax.annotation.processing.Processor). Files in test/ are intended to be processed. This used to work but stopped working after I upgraded build-impl.xml from the recent AP work. Verbose mode shows that -processorpath is passed but it contains just ${javac.classpath}. I do not want to set javac.processorpath to include build/classes because that would be wrong when compiling src/ initially.

The problem here is that you are assuming that a single ${ap.cmd.line.internal} is suitable for both main sources and tests, whereas there should be two independent sets of properties.
Comment 1 Jesse Glick 2010-01-30 18:00:32 UTC
Workaround (assuming you want to run all processors in CP, the default):

    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test" xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3">
        <j2seproject3:javac classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}" apcmdline=""/>
        <copy todir="${build.test.classes.dir}">
            <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
        </copy>
    </target>
Comment 2 Quality Engineering 2010-02-03 21:45:16 UTC
Integrated into 'main-golden', will be available in build *201002040200* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/b0946bc11c81
User: Jan Lahoda <jlahoda@netbeans.org>
Log: #180048, #180033, #180034: improving the build-impl.xml (and related parts) to handle processorpath with spaces, run APs in tests that are defined in src folders, etc.
Comment 3 David Strupl 2010-02-08 02:49:28 UTC
Shouldn't this report be closed as fixed?
Comment 4 Jan Lahoda 2010-02-08 05:46:28 UTC
It should be closed - it is possible, however, that we will need more changes to the build script in the future, as we get new reports.