This section provides several Ant tasks for the PROPACK and PROSIGN utility examples.

Create an archive

The following example creates an archive named demo.apl using an XML file to supply the necessary options to the propack Ant task.

proant -f propack_create.xml
The propack_create.xml file contains the propack task and options::
<?xml version="1.0"?>
<project name="AplTaskExample" default="main" basedir=".">
  <property environment="env" />
  <fail unless="env.DLC" message="You should install OpenEdge to run this script"/>

  <taskdef name="propack"
		 classname="com.progress.oeant.task.ProPack"
		 classpath="${env.DLC}/java/oe/oeant-12.7.0.jar" />

  <target name="main">
  <propack
	  destfile="demo.apl"
	  title="A title"
	  vendor="Some Vendor"
	  version="1.2.3.4"
	  vendorid="com.sample"
	  type="apl"
	  signaturePolicy="required"
	  validationPolicy="warn">
	<manifest>
	  <attribute name="My-Attribute"
			     value="My Value"/>
    </manifest>
    <fileset dir="demo"/>
  </propack>
 </target>
</project>

The output from running the Ant task is:

Buildfile: c:\OpenEdge\WRK\propack_create.xml

main:
  [propack] Building jar: c:\OpenEdge\WRK\demo.apl

BUILD SUCCESSFUL
Total time: 0 seconds

Sign an archive

The following example creates a signed archive named demosigned.apl using an XML file, prosign.xml, to supply the necessary options to the prosign Ant task.

proant -f prosign.xml
The prosign.xml file contains the prosign task and options:
<?xml version="1.0"?>

<project name="SignTaskExample" default="main" basedir=".">

  <property environment="env" />
  <fail unless="env.DLC" message="You should install OpenEdge to run this script"/>
    
  <taskdef name="prosign"
           classname="com.progress.oeant.task.ProSign"
           classpath="${env.DLC}/java/oe/oeant-12.7.0.jar" />

  <target name="main">
    <prosign
        archive="demo.apl"
        signedarchive="demosigned.apl"
        alias="defsigkey"
        keystore="testkeystore"
        storepass="password">
    </prosign>
  </target>
</project>
The output from running the Ant task:
Buildfile: c:\tmp\prosign.xml

main:
  [prosign] Signing JAR: c:\tmp\demo.apl to c:\tmp\demo.apl as defsigkey
  [prosign] jar signed.
  [prosign]
BUILD SUCCESSFUL
Total time: 2 seconds 

Verify a signed archive

The following example verifies a signed archive named demosigned.apl using an XML file, prosign_verify.xml, to supply the necessary options to the proverify Ant task.

proant -f prosign_verify.xml
The prosign_verify.xml file contains the proverify task and options:
<?xml version="1.0"?>

<project name="VerifyTaskExample" default="main" basedir=".">

  <property environment="env" />
  <fail unless="env.DLC" message="You should install OpenEdge to run this script"/>
    
  <taskdef name="proverify"
           classname="com.progress.oeant.task.ProVerify"
           classpath="${env.DLC}/java/oe/oeant-12.7.0.jar" />

  <target name="main">
    <proverify
        archive="demosigned.apl"
        alias="defsigkey"
        keystore="testkeystore"
        storepass="password">
    </proverify>
  </target>
</project>
The output from running the Ant task:
Buildfile: c:\tmp\prosign_verify.xml

main:
[proverify] Verifying JAR: c:\tmp\demosigned.apl
[proverify]
[proverify] jar verified.

BUILD SUCCESSFUL
Total time: 1 second
proenv>