Christophe,
I'm currently working on an Ant-Task that calls an XDoclet-Task, sourcecode see below. Perhaps you can use it / get some directions from it. (I have never tried to call a task from a non-task Java Prog, but that's sure not to hard to find out)
Regards, Simon
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
import org.apache.tools.ant.Project; import org.apache.tools.ant.Task; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.types.FileSet; import org.apache.tools.ant.DirectoryScanner;
import xdoclet.TemplateSubTask; import xdoclet.DocletTask;
public class Example extends Task { // ...
private class DocletTaskAdapter extends DocletTask { DocletTaskAdapter(Project p) { this.setProject(p); } }
private void callXdoc() { // instantiate template subtask TemplateSubTask ts = new TemplateSubTask();
ts.setDestDir(someDir); ts.setDestinationFile(someFile); ts.setTemplateURL(someUrl);
DocletTaskAdapter dt = new DocletTaskAdapter(getProject());
// must be done before any other method call! dt.addTemplate(ts); dt.setDestDir(someDir); dt.setVerbose(true);
dt.addFileset(someFileSet);
// invoke task dt.execute(); }
// ... }
///////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////// Christophe Grosjean wrote:
Hi,
Currently, I start XDoclet from an Ant script.
Has someone an idea about how I can start if from a Java program ?
Thanks,
Christophe
------------------------------------------------------------------------
===================================================================
This message is strictly confidential as between the sender and the intended recipient.
If you are not the intended recipient of the message, please notify the sender immediately and delete this e-mail from your system.
It si not possible to guarantee the integrity of e-mails sent through the Internet.
It is therefore not recommended to include unencrypted confidential data, such as personal details, in e-mails.
The content of the message does not bind Lombard International Assurance S.A. ("Lombard") in any way and any information in this e-mail on the services offered by Lombard is intended to provide general guidance only. Nothing in this e-mail is
intended as an offer or solicitation for the purchase or sale of any life assurance, pension or other financial product. Neither is the information intended to constitute any form of legal, fiscal or investment advice and it should therefore be used only
in conjunction with appropriate professional advice obtained from a suitably qualified
professional source.
......................................................................
This email has been checked for the presence of computer virus before leaving our system. =======================================================================
-- AdNovum Informatik AG Simon Heinzle Praktikant
Roentgenstrasse 22, CH-8005 Zuerich mailto:[EMAIL PROTECTED] phone: +41 44 272 6111, fax: +41 44 272 6312 http://www.adnovum.ch
AdNovum Offices: Bern, Budapest, San Mateo, Zuerich (HQ)
------------------------------------------------------- SF.Net email is sponsored by: Tell us your software development plans! Take this survey and enter to win a one-year sub to SourceForge.net Plus IDC's 2005 look-ahead and a copy of this survey Click here to start! http://www.idcswdc.com/cgi-bin/survey?id=105hix _______________________________________________ xdoclet-user mailing list xdoclet-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xdoclet-user