Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

Gram is a simple xdoclet-like tool for processing doclet tags or Java 5 annotations in source code or bytecode and auto-generating files, data or resources.

Gram = Groovy + JAM. JAM does all the hard work of abstracting away the details between annotations and doclet tags and handling Java 1.4 and 5 compliance. Groovy takes care of the scripting, code generation & templating. Gram is the little tidy bit of code in between.

Using Gram

You can use the Gram class as a main() and run it from your IDE if you wish. There is a GramTask as well for using it inside Ant.

Often since JAM depends on Sun's doclet stuff, you can have issues running the GramTask inside Maven and sometimes Ant. So I tend to run the Gram command line tool from inside an Ant build. e.g.

Unknown macro: {code language="xml"}

<java classname="org.codehaus.gram.Gram" fork="true">
<classpath refid="tool.classpath"/>

<!-- the directory where the source code lives -->
<arg value="src/java"/>

<!-- the groovy script to run to generate stuff -->
<arg value="src/script/MyGram.groovy"/>
</java>

Jar Dependencies

Gram just depends on

  • The Groovy 'all' jar (groovy-all-1.0-beta-*.jar)
  • JAM (there is a jam-dev.jar in the groovy jar repository
  • commons-logging (well what doesn't depend on that
  • No labels