Fuego 5.5 Ant Libraries - Reference Documentation

Requirements

The Fuego Ant tasks require Ant 1.6.1 or newer, and they rely on the namespace and antlib features included in Ant version 1.6.

Fuego Ant .jar libraries

For Ant to find the Fuego Ant Libraries, the full path to the Fuego lib/ and ext/ directories must be passed to Ant using the -lib option. Example:

 On Unix:
 ant -lib /fuego5.5/enterprise/lib:/fuego5.5/enterprise/ext

 On Windows:
 ant -lib c:\fuego5.5\enterprise\lib;c:\fuego5.5\enterprise\ext

To avoid using the -lib argument every time, it can be specified once using the ANT_ARGS environment variable:

 On Unix:
 ANT_ARGS="-lib /fuego5.5/enterprise/lib:/fuego5.5/enterprise/ext"
 export ANT_ARGS

 On Windows:
 set ANT_ARGS=-lib c:\fuego5.5\enterprise\lib;c:\fuego5.5\enterprise\ext

Fuego Namespace declaration

Ant scripts need to include the Fuego antlibs in its project definition in order to use Fuego tasks:

<project name="FuegoExample"
         xmlns:fuego="antlib:fuego.tools.ant.enterprise"
         xmlns:fuego.j2ee="antlib:fuego.tools.ant.j2ee">
 ...
</project>

The previous example defines the fuego namespace for accessing the standard Fuego library of tasks and fuego.j2ee for those tasks specific to the J2EE edition of Fuego.

Every reference to a standard Fuego task will be prefixed by "fuego:", and the J2EE-specific ones will be referenced with the "fuego.j2ee:" prefix. Like in the following snippet that uses the publish and buildear tasks:

<project name="FuegoExample" xmlns:fuego="antlib:fuego.tools.ant.enterprise">
 ...
  <target name="publish">
    ...
    <!-- Publish a process -->
    <fuego:publish fpr="myproject.fpr">
      ...
    </fuego:publish>

    <fuego.j2ee:buildear ...
      ...

    </fuego.j2ee:buildear>
  </target>
 ...
</project>

Setting fuego.basedir

Finally, the last requirement for Fuego Ant tasks to work correctly is to define the fuego.basedir property inside the build script. This property must point to a the Fuego Enterprise installation directory:

<project name="FuegoExample" xmlns:fuego="antlib:fuego.tools.ant.enterprise">

  <property name="fuego.basedir"
           value="/fuego5.5/enterprise"/>
 ...
</project>

Using Fuego tasks

The following example represents a small but complete Ant script that uses Fuego tasks.

The example script publishes and deploys a Fuego process making use of:

Fuego:publish is the task that allows for publishing and deploying processes. As any other task that needs access to a Fuego directory, it must be enclosed by a fuego:session task.

A fuego:passport basically defines the authentication information needed to access a particular Fuego directory. The fuego:session task accepts a passport reference to establish a session to the directory.

<!-- This script publishes and deploys a Fuego Process. -->
<project name="FuegoExample" xmlns:fuego="antlib:fuego.tools.ant.enterprise">

  <!-- Include properties -->
  <property file="build.properties"/>

  <!-- Define a fuego passport -->
  <fuego:passport id="fuego.passport"
         directoryid="default"
            preset="engine" />

  <target name="publish" description="Publish and deploy processes">

  <!-- Open a session to the Fuego directory -->
    <fuego:session
          passportref="fuego.passport"
              verbose="true"
          haltonerror="true" >

      <!-- Publish processes -->
      <fuego:publish fpr="${fuego.project}"
                  deploy="true"
                  engine="${fuego.engine}">

        <fuego:rolemap abstract="Employee" real="Role1"/>
        <fuego:rolemap abstract="Idea Evaluator" real="Role1"/>
      </fuego:publish>
    </fuego:session>

  </target>

</project>

The example includes properties from another file: build.properties. Keeping the values that are likely to change in a separate properties file is a good practice to follow, since it allows for easy parameterization of the script.

This is a build.properties file suitable for the above example:

# Fuego Enterprise installation directory
fuego.basedir=/fuego5.5/enterprise

# Name of Fuego Engine to deploy process
fuego.engine=Standalone

# Project to deploy
fuego.project=/fuego5.5/studio/samples/HelloWorld.fpr