Use this task to run ABL procedures.

Methods

Method Description Example
propath(String... propath)

Sets the AVM's PROPATH.

Will be appended to the PROPATHs provided in ABLExtension.

propath('path1', "${dlcHome}/path2")
profiler(Closure options)

Enables profiling.

See the profiler section for options

profiler { enabled = true outputDir = "${buildDir}/profiler"}
procedure(String procedure) Provides the procedure file to be run. procedure('src/main.p')
environment(String name, String value) Adds environment variables to pass to the system command environment('k1', 'v1')
environment(Map environment) Adds environment variables to pass to the system command environment([k1:"v2", k2:"v2"])
dbConnectionReferenceId(String... refIds)

Adds database task references. Reference the id property of the DBConnection tasks for more information.

Note that you must add the database task dependency to this (compile task).

dbConnectionReferenceId("id1", "id2")
dbConnection(Closure connection)

Adds database configurations. The argument should be provided as a closure with its object following the structure supported by the DBConnection task type.

Note that braces can be removed following the Java/Groovy syntax.

dbConnection{ dbName = 'sports2000' connectionParameters='-S 8000'}
avmOptions(Closure avmOptions)

AVM options. The argument should be provided as a closure.

See the avmOptions section for more information.

avmOptions{

tmpDir="path"

tty.enabled=true

}

arguments(Map args)

Additional arguments for ABL procedures.

(These arguments are directly passed to PCT).

arguments([k1:"v1", k2:'v2'])

Properties

Property Required? Description Example Default value
dlcHome

Yes

Should be set as described in the ABLExtension section.

OpenEdge DLC path None None
openedgeVersion No (read-only property) Specifies the OpenEdge version. This can be used for logging. This is a read-only property. None None
procedure Yes

Path of the procedure file that will be run.

Can be provided using the method procedure(String procedure).

procedure = 'src/main.p' None
propath No

Sets the AVM's PROPATH.

Will be appended to the PROPATHs provided in ABLExtension.

propath = files('path1', "${dlcHome}/path2") propath set in ABLExtension
wrkDir No Working directory from where the AVM is started wrkDir = 'path' wrkDir set in ABLExtension
avmOptions No

AVM options.

Use the method avmOptions(Closure avmOptions) to set the properties.

The properties defined in this task take priority if the same property is defined in ABLExtension

None avmOptions set in ABLExtension
dbConnection No

DB connection details.

Use methods dbConnection(Closure connection) or dbConnectionReferenceId(String... refIds) to add

None dbConnections set in ABLExtension
environment No Environment variables to pass to the system command environment = [k1:"v2", k2:"v2"] None
arguments No

Additional arguments for ABL procedures.

(These arguments are directly passed to PCT.)

arguments = [k1:"v1", k2:'v2'] None

Profiler

Property Description Example Default value
enabled Enables the profiler enabled=true false
description Description of the profiler session description="description" None
outputDir Generates a profiler output in this directory, with a unique name. Will be ignored if outputFile is provided. outputDir = 'path' "${buildDir}/profiler"
outputFile Profiler output file name outputFile='path' None
coverage Enables code coverage coverage=true false
statistics Enables statistics statistics=true false
debugListDir Generates debug listing files in this directory debugListDir="path" None

avmOptions{}

Property Description Example Default value
tmpDir The temporary directory for the AVM run time. -T is the startup parameter option. tmpDir = 'path1' None
tty.enabled The flag for using the _progres or prowin executables. Set to true for _progres, set to false for prowin (or prowin32 for a 32-bit AVM). tty { enabled = ‘true’ } true
xcodeSessionKey The XCODE session key for the secuity policy. xcodeSessionKey='myKey' None
parameterFile The parameter file. -pf is the startup parameter option. parameterFile='pathToFile' None
startupParameters The startup parameters as a string. This will be ignored if a parameterFile is provided startupParameters='-tok 4000 -s 200' None
assembliesDir The assemblies directory. -assemblies is the startup parameter option. assembliesDir='path1' None

Sample code snippet

The following code snippet is an example using ABLExtension:
task rumMain(type: ABLRun){
    procedure = "src/main.p"
    propath('src')
 
    wrkDir = "${buildDir}/rcode"
    avmOptions{
        tty.enabled = false
    }
 
    dbConnection{
        dbName="db/sports2000/sports2000"
        connectionParameters = "-1"
    }
 
    arguments = [ failOnError : true]
    profiler {
        enabled = true
        coverage = true
        outputDir = "${buildDir}/profiler"
        description = "Coverage for main.p"
    }
}