Sources generated by APT are not compiled to output folder [message #255513] |
Mon, 11 August 2008 17:34  |
Eclipse User |
|
|
|
Originally posted by: adv.zahn.googlemail.com
Hello,
I have a Java Project with an Annotation Processor, generating some
source code to a source folder. Unfortunately, the generated source code
is not compiled to the "bin" output folder.
The annotation processor is my own one, and after generating the source
code, I call the following lines:
final IFolder genFolder = ...;
if(null != genFolder)
try {
if(null != genFolder)
genFolder.refreshLocal(IResource.DEPTH_INFINITE, monitor);
} catch (CoreException e1) {
...
}
What am I missing?
Greetings,
Ralf
|
|
|
Re: Sources generated by APT are not compiled to output folder [message #255517 is a reply to message #255513] |
Mon, 11 August 2008 17:43   |
Eclipse User |
|
|
|
Originally posted by: adv.zahn.googlemail.com
Okay, might be the fact that I do not use the filer, I just use a code
generator generating the source file into the folder.
Ralf Zahn schrieb:
> Hello,
>
> I have a Java Project with an Annotation Processor, generating some
> source code to a source folder. Unfortunately, the generated source code
> is not compiled to the "bin" output folder.
>
> The annotation processor is my own one, and after generating the source
> code, I call the following lines:
>
> final IFolder genFolder = ...;
> if(null != genFolder)
> try {
> if(null != genFolder)
> genFolder.refreshLocal(IResource.DEPTH_INFINITE, monitor);
> } catch (CoreException e1) {
> ...
> }
>
> What am I missing?
>
>
> Greetings,
> Ralf
|
|
|
|
|
Re: Sources generated by APT are not compiled to output folder [message #255530 is a reply to message #255524] |
Tue, 12 August 2008 11:34  |
Eclipse User |
|
|
|
"Ralf Zahn" <adv.zahn@googlemail.com> wrote in message
news:g7rl1i$4ru$1@build.eclipse.org...
> Okay, but I had to use another source folder because (in the Annotation
> Processor) I call an external code generator that does not use the Filer
> object.
I understand your use case. Unfortunately this is a limitation of the way
that APT, and the Eclipse java compiler, work. If you want types generated
within an APT pass to be compiled, you need to generate them with the Filer.
I expect the same would be true, by the way, if you were using Sun's apt and
javac.
One option, if you can't change the external code generator, is have it
generate into a temp directory, and then have the annotation processor read
the contents of that directory and use Filer to generate the "real" files.
|
|
|
Powered by
FUDForum. Page generated in 0.06375 seconds