Custom Build Framework

In developing the Bitstorage subproject of DOMS, we created a rather elaborate build framework for handling interdependent webservices. Here is the documentation on how to use it.

Every module must have a build.xml. All build files have a specific structure

  1. Property definitions
  2. Import statements
  3. Set definitions

There are at present three kinds of modules

Property definitions

Every module build file must set the property global.dir to the correct value in regards to its basedir. This must happen as the firsts line of the project.     <property name="global.dir" value="${basedir}/../../.."/>

Every other property that should be set, must be set now, before any imports or something else is performed

Each of the kinds of module have specific properties that control how the build is performed

Common modules

Default values

    <property name="jarfile" value="${ant.project.name}.jar"/>
    <property name="srcpack.zip" value="${ant.project.name}-src.zip"/>

Webservice Modules

Default values

    <property name="warfilename" value="${ant.project.name}.war"/>

If wsdl.dir is not set, the webservice will be built without a wsdl. This is the expected behaivour for pure REST webservices.

Webservices inherit from Common, so all properties above are also respected.

Webservice Interface Modules

If generalSuperExceptionName is set, all generated exceptions will have this line inserted

    extends ${generalSuperExceptionName}

And all webservice method definitions that throws any exceptions will be specified to throw this

   throws ${generalSuperExceptionName}

This is nessesary to use the exceptionmapper functionality. Note that the generalSuperException is not generated, it must be provided, for example in the src folder of the module.

The properties from common modules also applies here.

Webservice Interface Modules

Import statements

Then the nessesary imports should be performed. These depends on the kind of module

Set definitions