On Sun, 2005-02-06 at 22:31, Rob Griffin wrote:
> Andrew,
> 
> That fixes my problem. It seems a bit subtle to me. It also means that
> I can't selectively process only part of my source tree, which is a
> bit of a nuisance.

Yes you can, just set up the includes attribute (or nested include
elements) accordingly.
e.g.

<fileset dir="${src.root}">
  <include name="com/mycompany/foo/**/*.java"/>
  <!-- com.mycompany.bar.* not processed -->
</fileset>

And combined with excludes you can do more complex things like

<fileset dir="${src.root}">
  <include name="com/mycompany/**/*.java"/>
  <exclude name="com/mycompany/bar/OneBean.java"/>
  <!-- com.mycompany.bar.TwoBean and everything in com.mycompany.foo
will be processed -->
</fileset>

See the Ant docs for more details. 
http://ant.apache.org/manual/CoreTypes/fileset.html

>  Why does XDoclet need to know the root of my tree?

Limitation of the parser, I guess.  I don't know why, since I didn't
write it and haven't dug that deeply through it.  Possibly to do with
the way it resolves unknown classes or something.

> Can't it just use the package definition in each source file?

It maybe ought to be able to, but it doesn't (and that's the way it's
always been).  Feel free to send in a patch ;-)


Andrew.


> 
> Point taken about the destination directory.  
> 
> Thanks,
> 
> Rob Griffin
> Quest Software
> 2/293 Camberwell Road
> Camberwell, Victoria 3124
> Australia
> Phone: +613 98118021
> Fax: +613 9811 8099
> 
> With Quest Software, you can expect more... more performance, more
> productivity, more value from your IT investments.
> 
> Visit www.quest.com to learn how.
>  
> 
> > -----Original Message-----
> > From: [EMAIL PROTECTED] 
> > [mailto:[EMAIL PROTECTED] On Behalf 
> > Of Andrew Stevens
> > Sent: Saturday, 5 February 2005 10:39 PM
> > To: xdoclet-user@lists.sourceforge.net
> > Subject: Re: [Xdoclet-user] XDoclet fails to generate JMX files
> > 
> > On Wed, 2005-02-02 at 05:04, Rob Griffin wrote:
> > > Hello,
> > > 
> > > I'm trying to use XDoclet to generate JMX interfaces and 
> > descriptors.
> > > 
> > > I have a simple HelloWorld class with this Javadoc
> > > 
> > > package com.quest.jmxxx;
> > > /**
> > >  *
> > >  * @jmx.mbean
> > >  *      name="HelloWorld"
> > >  *      persistPolicy="NoMoreOftenThan"
> > >  *      persistPeriod="3000"
> > >  *
> > >  **/
> > > public class HelloWorld
> > > {
> > > ...etc..
> > > }
> > > 
> > > and my Ant file looks like this:
> > > 
> > >     <target name='GenerateJMXFiles' depends='init'>
> > >         <jmxdoclet  destDir         ='${source.dir}/com/quest/jmxxx'
> > >                     force           ='true'
> > >                     verbose         ='true'>
> > >             <fileset dir='${source.dir}/com/quest/jmxxx'/>
> > 
> > That tells XDoclet (or, more precisely, the parser it uses) that the
> > root of your package hierarchy is ${source.dir}/com/quest/jmxxx.  When
> > it then finds that the package of your classes doesn't match their
> > location *below that directory*, it skips the files.  Just use
> >     <fileset dir='${source.dir}' includes="**/*.java"/>
> > instead and it should be fine.
> > Also, you should probably change that destDir parameter too, otherwise
> > you'll find it generates the files in 
> > ${source.dir}/com/quest/jmxxx/com/quest/jmxxx
> > Again, just use destDir='${source.dir}' and XDoclet will put things in
> > the right packages below that.
> > 
> > However, in general you should generate things into a 
> > separate location
> > to the original source files (and then include both sets of 
> > files in the
> > sourcepath when you compile).  Otherwise, a poorly configured 
> > subtask or
> > parameter in the @tags could potentially cause XDoclet to 
> > overwrite the
> > files you've spent so long writing...
> > 
> > 
> > Andrew.
> > 
> > 
> > >             <mbeaninterface/>
> > >         </jmxdoclet>
> > > 
> > >     </target>
> > > 
> > > When I run Ant the jmxdoclet task runs but no files are 
> > generated. I get
> > > this output
> > > 
> > > GenerateJMXFiles:
> > > [jmxdoclet] 2/02/2005 15:56:05 xdoclet.XDocletMain start
> > > [jmxdoclet] INFO: Running <mbeaninterface/>
> > >  
> > > Thanks,
> > > 
> > > Rob Griffin
> > -- 
-- 



-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
xdoclet-user mailing list
xdoclet-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xdoclet-user

Reply via email to