Many ABL applications make use of Apache Ant and PCT. Apache Ant is a build automation tool that uses XML and Java, and it was designed to make build processes simpler and more portable. Ant uses targets and tasks to compile, test, and run applications. It is primarily used for Java applications, but can be used for other types of applications as well. PCT is an open source set of Apache Ant tasks and plugins created by Riverside Software that automate work in OpenEdge. PCT is a large ecosystem of plugins that provides common build steps for automation and CI/CD.

Why migrate from Ant to Gradle?

Migrating from Ant to Gradle has the following benefits:
  • Gradle uses a domain-specific language, which allows users to add logic to the build pipeline.
  • Gradle has reusable tasks and can reuse other parts of a build pipeline, which makes the build script less verbose, more readable, and easier to maintain.
  • Gradle provides smarter dependency management than Ant.
  • Gradle make builds modular, which allows larger projects to be built from interdependent parts. You can even build multiple projects from the same pool of parts.

Use ant.importBuild

The Gradle task ant.ImportBuild is a straightforward and quick way to migrate your build processes from PCT or Ant to Gradle. This task converts Ant targets in your Ant scripts into Gradle tasks. To use ant.ImportBuild:
  1. Add the following to your build.gradle file in your project:
    ant.ImportBuild 'build.xml'
    This assumes build.xml contains your previous Ant tasks.
  2. After saving your build.gradle file, run your previous Ant tasks using the Gradle wrapper:
    gradlew ant target

Using ant.ImportBuild works quite well as an initial phase of migrating to Gradle, but it is not a full migration because you still need to maintain your existing Ant scripts.