|
|
|
Re: Annotation Processor not run automatically [message #249962 is a reply to message #249946] |
Mon, 03 December 2007 14:34   |
Eclipse User |
|
|
|
Originally posted by: wharley.bea.com
"hackingbear" <cutebear103@hotmail.com> wrote in message
news:a633bec87e8f1f56378a1516fa9d4aac$1@www.eclipse.org...
> My annotation processor is srt to run in batch mode.
Correct, if your processor is set to run in batch mode, then it will only be
called when you do a full build. Batch mode is unpleasant. It's really
only there to deal with a few pre-existing processors that did things like
keeping pass counters in static variables: in batch mode we throw out the
whole classloader on every build, so that statics get re-initialized. It
also helps address the problem of processors that assume they will be able
to process every source file on every build, which again is not a valid
assumption in an IDE because of incremental builds.
Why do you have your processor set that way? Is it because you're trying to
create a composite file, that is, a single file that contains information
gathered from all your source files? You might, in that case, have better
luck writing a processor based on the Java 6 annotation processing API
(javax.annotation.processing). Or you might want some sort of two-stage
design, where your processor creates intermediate files that are then glued
together into a single composite file by a separate Builder. With the Java
5 API it is practically impossible to get composite files to work right in
an IDE. With Java 6 it is still really hard, but at least it's possible.
Sun doesn't seem to have given much consideration to incremental compilation
in their API design.
> After I got the project run the APT laboriously and produce a .properties
> files in the .apt_generated folder, the resulting file is not copied to
> the output folder and so not visible at run-time.
I'm not sure why that would be. You can try playing with that one by
manually creating files in the .apt_generated folder and seeing if they get
copied. Check filters, exclusions, details of the build.properties file?
-Walter Harley
JDT APT team
|
|
|
|
Re: Annotation Processor not run automatically [message #250110 is a reply to message #249962] |
Sun, 09 December 2007 19:02  |
Eclipse User |
|
|
|
Walter Harley wrote:
>> After I got the project run the APT laboriously and produce a .properties
>> files in the .apt_generated folder, the resulting file is not copied to
>> the output folder and so not visible at run-time.
> I'm not sure why that would be. You can try playing with that one by
> manually creating files in the .apt_generated folder and seeing if they get
> copied. Check filters, exclusions, details of the build.properties file?
I carefully test this. First turn off my ant builder which copy over the
file to bin/. If I "new" a file under .apt_generated/, the file is copied
over. but if I delete the APT generated files, do either a clean under
auto-build or a manual build, the generated files do not get copied over
to bin/. I try to create my own generated/ folder and switch APT to use
that, but still does not work.
is this a bug?
|
|
|
Powered by
FUDForum. Page generated in 0.07328 seconds