3.2 Apache ANT Quickstart

The ANT task allows Bundlor to be run from inside any ANT based build system

  1. Define a bundlor namespace

    <project name="bundlor-sample-ant"
        xmlns:bundlor="antlib:com.springsource.bundlor.ant">
  2. Import the bundlor task into your build

    <target name="bundlor.init">
      <taskdef resource="com/springsource/bundlor/ant/antlib.xml"
          uri="antlib:com.springsource.bundlor.ant">
        <classpath id="bundlor.classpath">
          <fileset dir="${bundlor.home}/dist"/>
          <fileset dir="${bundlor.home}/lib"/>
        </classpath>
      </taskdef>
    </target>

    This example uses a very simplistic method for building the bundlor task classpath. It is possible to use a dependency manager such as Ivy to better manage the classpath of Bundlor.

  3. Use the bundlor task. See Section 4.2, “Apache ANT Usage” for details about the parameters of the task.

    <bundlor:bundlor
        inputPath="${basedir}/target/classes"
        outputPath="${basedir}/target/classes"
        bundleVersion="1.0.2.BUILD-${timestamp}"
        manifestTemplatePath="${basedir}/template.mf"/>