Any tips on using generated source files? [message #115500] |
Tue, 11 November 2003 02:31  |
Eclipse User |
|
|
|
Does anyone have any tips on using generated source files with Eclipse
(e.g. java source files generated from, say, XDoclet or JAXB)?
I can quite happily generate them using an Ant script and then add the
directory as a source folder. However, the generated files typically are
not up to the same standards as I prefer on my code (things like unused
imports, and so on). These then show up as problems in the problem list. I
_can_ filter them out, but that's not exactly pretty.
What I would like is for Eclipse to know about the files (so that it
includes them in compilations), but doesn't apply any standards beyond
what's required to compile. Does anyone know how to make Eclipse do that?
Thanks,
Robert
(P.S. Sorry if this is a FAQ; it certainly hadn't appeared recently on the
list)
|
|
|
|
Re: Any tips on using generated source files? [message #115937 is a reply to message #115582] |
Tue, 11 November 2003 17:56   |
Eclipse User |
|
|
|
Thorsten Schäfer wrote:
> I don't think that this is possible and I don't think that this is a good
> idea. If the generated files have problems/warning, they should appear. If
> you don't want to see them, you should exclude the generated-source-dir from
> the corresponding view. E.g. it wouldn't make sense to hide compilation
> problems on generated sources...
Depends what the problems are.
For example, I like seeing unused code (variables, imports, etc) as
problems. However, they wouldn't stop the code compiling if needed, and I
don't want to see them as problems for generated code.
If the code wouldn't compile with the minimal settings, then yes, that
would be a problem, and I would want it reported as such.
Also, it's not a real option to have the generated source in a separate
project with looser warnings; the generated source often has dependencies
on other classes in the project, and vice versa.
Not sure what you mean by excluding from view...
I've created a feature request for this (essentially, different
compiler-warnings per source-path); it's bug #46391.
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.25572 seconds