-
Notifications
You must be signed in to change notification settings - Fork 66
Development
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/javacontains Java code framework the rest interface -
src/main/generatedare generated classes - they should not be hand-edited -
src/test/javaunit tests for the project -
codegenis a Gradle sub-project that generates code insrc/main/generated -
exampleshas 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.
The order of operations:
- Get latest Asterisk source & extract swagger docs
- Build the project with generating the interface and implementation classes
- Publish to Maven Central using Sonatype
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
./gradlew clean :codegen:runCodegen build
You'll find the resulting jar file under the build/libs folder.
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
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.
The project has some actions to automate ARI version downloads (used to handle the release too, hopefully it'll return soon).