The following sample code demonstrates how you can use the ABLCompile and DBConnection task types in a custom task:

import com.progress.gradle.abl.tasks.*
plugins {
  id "progress.openedge.abl-base" version "2.2"
}

// This section defines the global configuration available to all task types.

abl{
    propath("${dlcHome}/tty/")
    avmOptions {}
    compileOptions{}
    rcodeDir='rcode1'
    wrkDir = "myWrkDir"
     
    dbConnection{
        dbName = 'sports2000'
        connectionParameters='-S 8000'
    }
}

// This section defines the DBConnection task.
 
task myDbConTask(type: DBConnection){
    id='id1'
    dbName='sports2020'
    parameterFile='pathToFile'
    aliases = ['alias1', 'alias2', 'aalias3']
}

// This section defines the ABLCompile task.
 
task myCompileTask(type: ABLCompile){
    println "OE version: ${openedgeVersion}"
 
    source('src1', 'src2')
    include('**/*.p', '**/*.cls')
    exclude('**/*.txt', '**/*.conf')
    rcodeDir='rcode1'
    propath('path1', "${dlcHome}/path2")
    wrkDir = 'path1'
    avmOptions{
        tty.enabled='true'
        startupParameters='-tok 4000 -s 200'
    }
    compileOptions{
        xrefDir='xref2'
        preprocessDir=""
        preprocess.enabled=""
        strictOptions{
            requireFullNames='warning'
        }
        outputType='json'
    }
     
    dbConnection{
        dbName = 'sports2020'
        parameterFile='pathToParameterFile'
        connectionParameters='-S 8000'
        port = '8000'
        host = 'localhost'
        username = 'admin'
        password = 'admin2'
        aliases = ['alias1', 'alias2', 'aalias3']
    }
    dbConnectionReferenceId("id0")
    dbConnectionReferenceId("id1", "id2")
}
 
myCompileTask.dependsOn myDbConTask

You can find more sample projects on the Progress community.