Use the APL task to create protected r-code archive file with .apl as extension.

This archive is based on *.jar files, though any type of files can be added within it, AVM will access only the r-code and image files. For more information, see Manage archive libraries.

The APL task has the following default properties:
  • archiveExtension is set to .apl
  • entryCompression is set to ZipEntryCompression.STORED because the AVM only supports uncompresses archive entries.

Some manifest attributes are mandated and some attribute values are defaulted. For more information, see Access information in a manifest file .

The table below describes how APL task handles some of the attibutes.

Attribute Required Default
'Implementation-Title'

No

archiveFileName
'Component-Name'

No

archiveFileName
'Package-Type'

apl (always)
'OpenEdge-Tool'

OpenEdge DevOps Framework (always)
'OpenEdge-Version'

No

abl.opendgeVersion.

Sample code snippet 1

task createMyFirstProtectedRCodeArchive(type: APL) {
    from("${buildDir}/rcode")
    from("${buildDir}/resources")
    archiveBaseName = "myFirstProtectedRCode"
    destinationDirectory = project.file "$buildDir/dist"
 
    manifest {
        // only mandatory attribute, others are defaulted
        attributes.put "Implementation-Vendor", "Progress Software"
    }
}

Sample code snippet 2

task createMyFirstProtectedRCodeArchive(type: APL) {
    from("${buildDir}/rcode")
    from("${buildDir}/resources")
    archiveBaseName = "myFirstProtectedRCode"
    destinationDirectory = project.file "$buildDir/dist"
 
    manifest {
        attributes.put 'Implementation-Title', 'My First ABL Application'
        attributes.put 'Implementation-Vendor', 'Progress Software'
        attributes.put 'Implementation-Version', '1.0.0'
        attributes.put 'Implementation-Vendor-ID', 'PRGS'
        attributes.put 'Component-Name', 'Core ABL'
        attributes.put 'Build-OS', 'unix'
        attributes.put 'Signature-Policy', 'required'
        attributes.put 'Validation-Policy', 'warn'
         
        attributes.put 'My-Custom-Attribute', 'DevOps Build'
    }
}

Sample code snippet 3

task createMyFirstProtectedRCodeArchive(type: APL) {
    from("${buildDir}/rcode")
    from("${buildDir}/resources")
    archiveBaseName = "myFirstProtectedRCode"
    destinationDirectory = project.file "$buildDir/dist"
 
    manifest {
        // using APL's exposed Keys and Values
        attributes.put AttributeKeys.ImplementationTitle, 'My First ABL Application'
        attributes.put AttributeKeys.ImplementationVendor, 'Progress Software'
        attributes.put AttributeKeys.ImplementationVersion, '1.0.0'
        attributes.put AttributeKeys.ImplementationVendorID, 'PRGS'
        attributes.put AttributeKeys.ComponentName, 'Core ABL'
        attributes.put AttributeKeys.BuildOS, BuildOSValues.UNIX                // BuildOSValues.WINDOWS / BuildOSValues.ALL
        attributes.put AttributeKeys.SignaturePolicy, SignaturePolicy.REQUIRED  // SignaturePolicy.OPEN
        attributes.put AttributeKeys.ValidationPolicy, ValidationPolicy.WARN    // ValidationPolicy.NONE / ValidationPolicy.FAIL
         
        attributes.put 'My-Custom-Attribute', 'My Awesome Build'
    }
}

Extracting APL file

You can extract an APL file in a Gradle native way using Copy task. For example, refer to the following code snippet.

task extractMyFirstProtectedRCodeArchive(type: Copy) {
    from zipTree("$buildDir/dist/myFirstProtectedRCode.apl")
    into "$buildDir/extract/myFirstProtectedRCode"
}
Note: You can update the content of an exisiting APL file by using the same APL task as used in the example above. For handling conflicts of duplicates, use the Gradle's JAR task type duplicateStrategy property.

Refer to the Gradle documentation for more information about Copy and Jar task types.