Home
Categories
Dictionary
Download
Project Details
Changes Log
What Links Here
How To
Syntax
FAQ
License

Ant integration



It is possible to integrate the application in an ant build file.

Usage

You must define at least the following properties:

You must also set the classpath for the application.

The most basic example is: In this basic example:
  • The input directory is "wiki/input", which is in the same directory as the ant file
  • The output directory is "wiki/output", which is in the same directory as the ant file
  • The application jar is also in the same directory as the ant file
  <java classname="org.docgene.main.DocGenerator">
     <arg value="-input=wiki/input"/>
     <arg value="-output=wiki/output"/>
     <classpath>
        <pathelement path="docGenerator.jar"/>
        <pathelement path="plugins/scripts.jar"/>
     </classpath>
  </java>

Using the tool in ant in a complex build process

If the task which generates the wiki is used in a list of other tasks in ant, you may use the preventExit=true property in the command-line or the configuration file.

Using the configuration file

Main Article: Configuration file

Examples

Basic example

In this basic example:
  • The input directory is "wiki/input", which is in the same directory as the ant file
  • The output directory is "wiki/output", which is in the same directory as the ant file
  • The application jar is also in the same directory as the ant file
  <java classname="org.docgene.main.DocGenerator">
     <arg value="-input=wiki/input"/>
     <arg value="-output=wiki/output"/>
     <classpath>
        <pathelement path="docGenerator.jar"/>
        <pathelement path="plugins/scripts.jar"/>
     </classpath>
  </java>
In this example:
  • A search box allowing to search on the article titles and their table of contents sub-titles is added
  <java classname="org.docgene.main.DocGenerator">
     <arg value="-input=wiki/input"/>
     <arg value="-output=wiki/output"/>
     <arg value="-search=titles"/>
     <classpath>
        <pathelement path="docGenerator.jar"/>
     </classpath>
     <jvmarg line="-Dfile.encoding=UTF-8" />
  </java>

Usage of a configuration file

In the following example:
  <target name="generateWiki" description="generate Wiki" depends="version" >
     <java classname="org.docgene.main.DocGenerator">
        <arg value="-input=wiki/input"/>
        <arg value="-output=wiki/output"/>
        <arg value="-search=titles"/>
        <arg value="-config=wikisource/config.properties"/>
        <arg value="-$version=${version}"/>
        <classpath>
           <pathelement path="docGenerator.jar"/>
        </classpath>
        <jvmarg line="-Dfile.encoding=UTF-8" />
     </java>
  </target>

Categories: general

docJGenerator Copyright (c) 2016-2023 Herve Girod. All rights reserved.