From ec1aa7dc57a44525ca1e5048ac36c5c089827734 Mon Sep 17 00:00:00 2001 From: zero88 Date: Fri, 21 Jun 2024 18:43:06 +0700 Subject: [PATCH] feat(gradle): Tweak a step to make jooqx support multiple java versions #216 --- .github/workflows/jooqx.yml | 6 +++++- core/build.gradle.kts | 10 ++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/jooqx.yml b/.github/workflows/jooqx.yml index ae176fd7..d551c3a4 100644 --- a/.github/workflows/jooqx.yml +++ b/.github/workflows/jooqx.yml @@ -85,13 +85,17 @@ jobs: needs: [ context, build, analysis ] if: needs.context.outputs.shouldPublish == 'true' || needs.context.outputs.isRelease == 'true' uses: zero88/shared-ghactions/.github/workflows/gradle-publish.yml@main + strategy: + matrix: + java: [ '8', '17' ] + os: [ 'ubuntu-latest' ] with: profile: 'jooqx' version: ${{ needs.context.outputs.version }} semanticVersion: ${{ needs.context.outputs.semanticVersion }} hashVersion: ${{ needs.context.outputs.commitId }} isRelease: ${{ needs.context.outputs.isRelease }} - javaVersion: 17 + javaVersion: ${{ matrix.java }} secrets: ossrhUser: ${{ secrets.OSS_SONATYPE_USER }} ossrhToken: ${{ secrets.OSS_SONATYPE_PASSWORD }} diff --git a/core/build.gradle.kts b/core/build.gradle.kts index 71289842..9ff77a39 100644 --- a/core/build.gradle.kts +++ b/core/build.gradle.kts @@ -102,4 +102,14 @@ tasks { testFixturesJavadoc { title = "jOOQx Testing ${project.version} API" } + + withType { + // need to override in here, since at root project, test-fixtures is not yet recognized + if (name == "testFixturesJar") { + when (JavaVersion.current().majorVersion) { + "8" -> archiveClassifier.set("test-fixtures-jvm8") + "11" -> archiveClassifier.set("test-fixtures-jvm11") + } + } + } }