diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..2c97cfa --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,31 @@ +name: build + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + java: + strategy: + matrix: + java: [25] + os: ['ubuntu-latest'] + runs-on: ${{ matrix.os }} + name: Build on ${{ matrix.os }} on Java ${{ matrix.java }} + steps: + - uses: actions/checkout@v6 + - name: Set up JDK ${{ matrix.java }} + uses: actions/setup-java@v5 + with: + distribution: corretto + java-version: ${{ matrix.java }} + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v6 + - name: Build with Gradle + run: | + cd java && ./gradlew --no-daemon -s :build + # TODO: add golang build \ No newline at end of file diff --git a/java/build.gradle.kts b/java/build.gradle.kts index cb9c406..f208354 100644 --- a/java/build.gradle.kts +++ b/java/build.gradle.kts @@ -14,13 +14,13 @@ plugins { // Apply the java-library plugin for API and implementation separation. `java-library` - id("com.google.protobuf") version "0.9.4" - id("io.freefair.lombok") version "8.6" - id("com.github.johnrengelman.shadow") version "7.1.2" + id("com.google.protobuf") version "0.10.0" + id("io.freefair.lombok") version "9.5.0" + id("com.gradleup.shadow") version "9.4.2" jacoco - id("com.github.spotbugs") version "6.0.7" + id("com.github.spotbugs") version "6.5.6" checkstyle - id("org.cyclonedx.bom") version "1.10.0" + id("org.cyclonedx.bom") version "3.2.4" } repositories { @@ -51,7 +51,7 @@ dependencies { implementation("org.apache.commons:commons-lang3:3.0") implementation("com.jayway.jsonpath:json-path:2.9.0") implementation("io.github.resilience4j:resilience4j-retry:2.2.0") - implementation(enforcedPlatform("com.fasterxml.jackson:jackson-bom:2.17.0")) + implementation(platform("com.fasterxml.jackson:jackson-bom:2.17.0")) implementation("com.fasterxml.jackson.core:jackson-core") implementation("com.fasterxml.jackson.core:jackson-annotations") implementation("com.fasterxml.jackson.core:jackson-databind") @@ -78,7 +78,7 @@ protobuf { } jacoco { - toolVersion = "0.8.9" // Use the latest version available + toolVersion = "0.8.15" // Use the latest version available } tasks.jacocoTestReport { @@ -122,7 +122,7 @@ tasks.jacocoTestCoverageVerification { } spotbugs { - toolVersion.set("4.8.3") + toolVersion.set("4.10.2") ignoreFailures.set(false) showProgress.set(true) effort.set(com.github.spotbugs.snom.Effort.MAX) @@ -201,16 +201,14 @@ tasks.javadoc { } } +java { + withJavadocJar() + withSourcesJar() +} + tasks { - jar { - archiveBaseName.set("DemandDrivenTrafficEvaluator") - archiveClassifier.set("core") - archiveVersion.set("2.0.0") // Set your library version - } named("shadowJar") { - archiveBaseName.set("DemandDrivenTrafficEvaluator") archiveClassifier.set("fat") - archiveVersion.set("2.0.0") // Set your library version destinationDirectory.set(layout.buildDirectory.dir("libs")) configurations = listOf(project.configurations.runtimeClasspath.get()) @@ -243,3 +241,5 @@ tasks { finalizedBy(jacocoTestReport) } } + +project.group = "com.amazon.demanddriventrafficevaluator" diff --git a/java/gradle.properties b/java/gradle.properties index 70ebcc6..f8bb508 100644 --- a/java/gradle.properties +++ b/java/gradle.properties @@ -4,6 +4,7 @@ # This file was generated by the Gradle 'init' task. # https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties -org.gradle.parallel=true -org.gradle.caching=true +version=2.0.0 +org.gradle.parallel=true +org.gradle.caching=true \ No newline at end of file diff --git a/java/gradle/wrapper/gradle-wrapper.properties b/java/gradle/wrapper/gradle-wrapper.properties index 0aaefbc..5dd3c01 100644 --- a/java/gradle/wrapper/gradle-wrapper.properties +++ b/java/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.5.1-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/java/settings.gradle.kts b/java/settings.gradle.kts index e1f83b8..1a8e8da 100644 --- a/java/settings.gradle.kts +++ b/java/settings.gradle.kts @@ -15,5 +15,4 @@ plugins { id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0" } -rootProject.name = "DemandDrivenTrafficEvaluator" -include("lib") +rootProject.name = "demand-driven-traffic-evaluator"