Skip to content
Graham Brown edited this page Jan 26, 2026 · 3 revisions

The structure

The project is structured using Gradle, the source is partially hand-written and partially generated out of Swagger definitions, the folders structure is as follows:

  • src/main/java contains Java code framework the rest interface
  • src/main/generated are generated classes - they should not be hand-edited
  • src/test/java unit tests for the project
  • codegen is a Gradle sub-project that generates code in src/main/generated
  • examples has a some examples, please refer to Examples form more details

The easiest way to build is simply using the Gradle Wrapper script is bundled in the project to make it easier to get started, details to follow in the build section below.

Build & Release Process

The order of operations:

  1. Get latest Asterisk source & extract swagger docs
  2. Build the project with generating the interface and implementation classes
  3. Publish to Maven Central using Sonatype

1. Get latest Asterisk source

Step 1 has a helper script that'll clone the Asterisk source generating the data required for the APIs into the codegen/src/main/resources/codegen-data folder, these artefacts should be committed to the source repository. In a command terminal change directory to the codegen folder and execute the getApis.sh script. The script downloads the Asterisk code into codegen/tmp keep this folder around to make the process quicker by performing a pull rather than a clone

2. Build

./gradlew clean :codegen:runCodegen build

You'll find the resulting jar file under the build/libs folder.

3. Publish

Previously Bintray was used to publish and there were automated GH Actions, but it was sunset. Now using Sonatype, but have not automated into GH Actions yet. For now build from tag locally using the publishMavenPublicationToSonatypeRepository gradle task it uploads to Sonatype but then need to publish. Sonatype has also made some changes recently, previously https://s01.oss.sonatype.org/ was used to then make apply/release the upload to the public, but now https://central.sonatype.com/ and still working out how that works

Examples build

For local development of the examples add a .inc-examples file (touch .inc-examples) this will then include the examples folder and change the dependency of the examples to the root project, otherwise change directory to the examples folder and use gradle from there.

GitHub Action automation

The project has some actions to automate ARI version downloads (used to handle the release too, hopefully it'll return soon).

Clone this wiki locally