Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » Any tips on using generated source files?
Any tips on using generated source files? [message #115500] Tue, 11 November 2003 02:31 Go to next message
Eclipse UserFriend
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 #115582 is a reply to message #115500] Tue, 11 November 2003 06:57 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Newsletter.ThorstenSchaefer.de

Hi,

> Does anyone have any tips on using generated source files with Eclipse
> (e.g. java source files generated from, say, XDoclet or JAXB)?
> 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?

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...

Bye,

Thorsten
Re: Any tips on using generated source files? [message #115937 is a reply to message #115582] Tue, 11 November 2003 17:56 Go to previous messageGo to next message
Eclipse UserFriend
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.
Re: Any tips on using generated source files? [message #116028 is a reply to message #115937] Wed, 12 November 2003 04:26 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Newsletter.ThorstenSchaefer.de

Hi Robert,

> 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.

My idea is to leave the problems view (where compile and other errors occur)
as is. The generated sources are generated to a separate directory, e.g.
gen-src. Then you only have to exclude this directory in the warnings view
and you get all problems which prevent compiling but also hide all warnings
like unused imports.

HTH,

Thorsten
Re: Any tips on using generated source files? [message #116961 is a reply to message #115500] Fri, 14 November 2003 12:08 Go to previous messageGo to next message
Eclipse UserFriend
I have created a simple plugin that can help:
http://www.genady.net/autogen/

It needs Eclipse 3.0M4 and JDK1.4.x

Genady

Robert Watkins wrote:
> 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 #119167 is a reply to message #116961] Thu, 20 November 2003 22:29 Go to previous message
Eclipse UserFriend
Genady wrote:

> I have created a simple plugin that can help:
> http://www.genady.net/autogen/

Ah! Exactly what I'm after. :)

I'll see if I can't add that directory support for you, too.
Previous Topic:Newbie questions OK for this group ?
Next Topic:How to develop a new ClassCreationWizard ?
Goto Forum:
  


Current Time: Tue Jul 22 19:48:12 EDT 2025

Powered by FUDForum. Page generated in 0.25572 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top