views:

129

answers:

1

I would like to use Doxia to generate some documentation but invoke it with Ant (and no, Maven is not an option). I was looking for some pointers but nothing popped up after a few Google search.

Did anyone already used Doxia in an Ant environment and how did it turned out?

+1  A: 

I don't know of any Ant Doxia task, it really would be simpler to use Maven or the invoke Mvn ant task from within your Ant build to invoke Doxia...

If this is really not feasible, it should be fairly straightforward to cobble together a custom ant task to invoke Doxia.

As requested, some pointers to get started:

Maven is based on Plexus and the Doxia components are available from the Plexus container to an application.
There is a tutorial on getting started with Plexus you might find helpful for some background on creating a wrapper.

The example below shows how you can obtain the SiteTools component in a standalone application. As in the Ant tutorial referenced above, it would be straightforward to wrap the execution in an Ant task.

public class DoxiaPlexusTest
{
    public static void main( String[] args )
        throws Exception {
        // create a new container
        PlexusContainer container = new DefaultPlexusContainer();

        SiteTool siteTool = container.lookup( SiteTool.class );

        try {
            new DoxiaPlexusTest().letsDoDoxia(siteTool);
        finally {
            // stop the components and container
            container.dispose();
        }
    }

    public void letsDoDoxia(SiteTool siteTool) {
        List localesList = siteTool.getAvailableLocales( locales );
        String relativePath = siteTool.getRelativePath( "C:/foo/child",
                            "C:/foo/master" );
        ...
    }
}
Rich Seller