diff --git a/README.md b/README.md index b152f6a7..8d4eeae4 100755 --- a/README.md +++ b/README.md @@ -30,6 +30,23 @@ dependencies { } ``` +### Building from Source + +The project uses code generation to create ARI bindings from Asterisk's Swagger API definitions. To build: + +1. Clone the repository +```bash +git clone https://github.com/ari4java/ari4java.git +cd ari4java +``` + +2. Build (this will automatically generate ARI bindings) +```bash +./gradlew build +``` + +The code generator task runs automatically before compilation to ensure the ARI bindings are up to date. + Due to the sun setting of JCenter the jar is now publish through Sonatype to Maven Central but under a new groupId. The groupId is now `io.github.ari4java` make sure you update your build files if you used `ch.loway.oss.ari4java`. diff --git a/build.gradle b/build.gradle index f51a70f2..840a85be 100755 --- a/build.gradle +++ b/build.gradle @@ -31,6 +31,16 @@ sourceSets { } } +// Task to run code generation before compilation +task generateAriApi(type: GradleBuild) { + description = 'Generate ARI API sources from JSON definitions' + buildFile = 'codegen/build.gradle' + tasks = ['runCodegen'] +} + +// Make Java compilation depend on code generation +compileJava.dependsOn generateAriApi + repositories { mavenCentral() } @@ -39,7 +49,8 @@ dependencies { implementation 'com.fasterxml.jackson.core:jackson-core:2.13.1' implementation 'com.fasterxml.jackson.core:jackson-databind:2.13.1' implementation 'com.fasterxml.jackson.core:jackson-annotations:2.13.1' - implementation 'io.netty:netty-all:4.1.72.Final' + // Bumped to a modern Netty release to avoid reflective access to JDK internals on Java 22+ + implementation 'io.netty:netty-all:4.1.112.Final' implementation 'javax.xml.bind:jaxb-api:2.3.1' implementation 'org.slf4j:slf4j-api:1.7.32' @@ -84,11 +95,11 @@ test { jacocoTestReport { reports { - xml.enabled true - csv.enabled false - html.enabled true - xml.destination = file("${buildDir}/reports/jacocoTestReport.xml") - html.destination = file("${buildDir}/reports/jacocoTestReport/html") + xml.required.set(true) + csv.required.set(false) + html.required.set(true) + xml.outputLocation.set(file("${buildDir}/reports/jacocoTestReport.xml")) + html.outputLocation.set(file("${buildDir}/reports/jacocoTestReport/html")) } afterEvaluate { classDirectories.setFrom(files(classDirectories.files.collect { diff --git a/examples/build.gradle b/examples/build.gradle index 54003227..36d9e782 100755 --- a/examples/build.gradle +++ b/examples/build.gradle @@ -7,9 +7,9 @@ repositories { } dependencies { - implementation 'ch.loway.oss.ari4java:ari4java:+' + implementation project(':') // Use the local project implementation 'ch.qos.logback:logback-classic:1.2.10' - implementation 'io.netty:netty-all:4.1.72.Final' + implementation 'io.netty:netty-all:4.1.112.Final' } java { diff --git a/examples/gradle/wrapper/gradle-wrapper.properties b/examples/gradle/wrapper/gradle-wrapper.properties index 2e6e5897..17655d0e 100755 --- a/examples/gradle/wrapper/gradle-wrapper.properties +++ b/examples/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 2e6e5897..17655d0e 100755 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/settings.gradle b/settings.gradle index 8fe455cd..a7b17088 100755 --- a/settings.gradle +++ b/settings.gradle @@ -1,2 +1,3 @@ rootProject.name = "ari4java" include "codegen" +include "examples"