8000 Feature/java25 compatibility by devanshu-tj · Pull Request #200 · ari4java/ari4java · GitHub
[go: up one dir, main page]

Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.

Expand Down
23 changes: 17 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand All @@ -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'

Expand Down Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions examples/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion examples/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
rootProject.name = "ari4java"
include "codegen"
include "examples"
0