If you use Ant or Gradle to compile your ABL code or for CI/CD purposes, you can use the ABLApp Ant Task to generate an OpenEdge Application Archive (OEAR) for an ABL application. The ABLApp Ant Task functionality is provided by oeant-12.2.0.jar. Using the ABLApp Ant Task lets you automate the creation of OpenEdge Application Archive packages using your source-control or other environments, which supports continuous integration and deployment practices.

For more information about ABL applications, see OpenEdge Application Archive Structure and ABL applications.

To generate an OpenEdge Application Archive file (.oear) for an existing ABL application, include the following line in your build.xml file:
<taskdef name="ABLApp" classname="com.progress.oeant.ABLApp" classpath="${env.DLC}/java/oe/oeant-12.2.0.jar"/>

The ABLApp Ant Task is a subclass of the Ant Zip task. The majority of the documentation for Ant Zip tasks can be found at https://ant.apache.org/manual/Tasks/zip.html

The ABLApp task also uses some code from the Jar task for handling Manifests. You can find documentation regarding manifests at https://ant.apache.org/manual/Tasks/jar.html.

Differences between ABLApp and Zip Ant Tasks

The following attribute from the Zip task is deprecated in the ABLApp task: destFile

It is replaced by the following attributes:
  • destDir—The destination directory where the archive will go. The default is current directory.
  • archiveBaseName—The basename that the archive will use. The default is the ABLApp name.
  • archiveClassifier—Optional classifier that can be added to archive name (ALPHA, RELEASE, LATEST, etc). The default is blank.
  • archiveExtension—Archive extension type. The default is .oear.
  • archiveVersion—Optional version to use in the archive filename. The default is blank.
The archive filename is constructed as:
destDir/(archiveBaseName)-(archiveVersion)-(archiveClassifier)(archiveExtension)

Generating an ABLApp with Ant

Like the Ant Zip task, there are two ways to generate an OEAR file.

The first way uses basedir and requires you to copy over all the resources required by your ABLApp and ensure they are in the proper location.

The second way is to use filesets to pull resources from different locations an assemble them in the archive.

In either case, basedir must be set. It should point to an empty directory if you are using filesets.

Embedded attributes

The following attributes can be used as nested elements and to specify filesets. See the Jar task documentation for more information.

  • <tlr>—Fileset that comprises resources in the $CATALINA_BASE/ablapps/{ABLAppName}/tlr directory
  • <webapps>—Fileset that comprise the set of web applications used by this ABL Application. It must be a fully tailored war file, or a zip file that will be overlaid over a tailored oeabl.war.
  • <openedge>—Fileset that comprises the $CATALINA_BASE/ablapps/{ABLAppName}/openedge directory.
  • <conf>—Fileset that comprises the $CATALINA_BASE/ablapps/{ABLAppName}/conf directory
The following attributes require an update to the import script for them to be installed with the Import command:
  • <bin>—Fileset that comprises resources in the $CATALINA_BASE/bin directory.
  • <instance>—Fileset for instance-level resources.

The above can be used in conjunction with basedir, but should not be used with instancedir.

Additional attributes

The following additional attribute is supported in an ABLApp Ant Task:
  • instancedir—Location of a PAS for OpenEdge instance that you are exporting an ABLApp from.

    You can not specify both basedir and instancedir in your Ant script.

Example Ant Script

The following example Ant script uses the ABLApp task to generate an OpenEdge Application Archive (OEAR) package. In this example, the OEAR package loads the Progress Compiler Tools Jar file, creates an OpenEdge database, contains three web applications (nginx, Payments, and SSOProd), and compiles ABL code:

<project name="OpenEdge Application Archive (OEAR) Example" default="build" basedir=".">

    <description>
    Generates an OpenEdge Archive file that can be deployed to a PASOE Server
    </description>

    <!-- Set environment variables required for the ANT script -->  
    <property environment="env" />
    <fail unless="env.DLC" message="You should install OpenEdge to run this script"/>
    <property name="openedge" value="src/main/openedge" />
    <property name="bin" value="src/main/bin" />
    <property name="tlr" value="src/main/tlr" />
    <property name="conf" value="src/main/conf" />
    <property name="rcode" value="build/rcode" />
    <property name="instance" value="src/main/instance" />
    <property name="dbdir" value="build/db" />
    <property name="webapps" value="build/webapps" />
    <property name="theAppName" value="SSOApp" />
    <property name="theAppVersion" value="1.0.0" />
	<property name="classifier" value="ALPHA" />


    <!-- Load PCT tasks from DLC/pct -->
    <taskdef resource="PCT.properties" classpath="${env.DLC}/pct/PCT.jar" loaderRef="pct" />
    <typedef resource="types.properties" classpath="${env.DLC}/pct/PCT.jar" loaderRef="pct" />
    <record name="build.log" loglevel="verbose" append="false"/>

    <target name="build" depends="clean,packageApp">
    </target>

    <target name="clean" >
        <delete quiet="true" >
	        <fileset dir="build" />
	    </delete>
    </target>

    <target name="packageApp" depends="compile, buildwebapps">
        <taskdef name="ABLApp" classname="com.progress.oeant.ABLApp" classpath="${env.DLC}/java/oe/oeant-12.2.0.jar"/>


        <ABLApp description="Sample creation of an ABLApp"
            appName="${theAppName}"
            archiveBaseName="${theAppName}"
            archiveVersion="${theAppVersion}"
            archiveClassifier="ALPHA"
            basedir="src/main/SSOApp"
            destdir="build/oear">

            <bin dir="${bin}" /> 
            <tlr dir="${tlr}" />
            <conf dir="${conf}" />
            <openedge dir="${rcode}" includes="**/*.r,*.gen,*.map" />
            <webapps dir="${webapps}" />
            <instance dir="${instance}" /> 

        </ABLApp>

    </target>

    <target name="compile" depends="createdb">

        <PCTCompile destDir="${rcode}" dlcHome="${env.DLC}" relativePaths="false">
            <fileset dir="${openedge}" includes="**/*.p,**/*.cls" />
            <DBConnection dbName="sports2000" dbDir="${dbdir}" readOnly="true" />
            <propath>
                <pathelement path="${openedge}"/>
            </propath>
        </PCTCompile>

        <copy todir="${rcode}">
            <fileset dir="${openedge}">
                <include name="**/*.gen,**/*.map"/>
            </fileset>
        </copy>

    </target>

    <target name="createdb">
	    <echo>creating database copy of sports2000</echo>
	 
	    <mkdir dir="${dbdir}"/>
	    <sports2000 dbName="sports2000" destDir="${dbdir}" dlcHome="${env.DLC}" />
	
	    <PCTLoadData dlcHome="${env.DLC}" srcFile="${openedge}/_sec-authentication-domain.d" table="_sec-authentication-domain">
	        <DBConnection dbName="sports2000" dbDir="${dbdir}" singleUser="true"/>
	    </PCTLoadData>

    </target>

    <target name="buildwebapps">
        <echo>building web application zip files</echo>

        <zip destfile="build/webapps/nginx.zip" basedir="src/main/webapps/nginx" />
        <zip destfile="build/webapps/Payments.zip" basedir="src/main/webapps/Payments" />
        <zip destfile="build/webapps/SSOProd.zip" basedir="src/main/webapps/SSOProd" />

    </target>

</project>

The output of the Ant script is SSOApp-1.0.0-ALPHA.oear.