From c86429551e353938f785ce6ebcb8538e4fff6347 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Muller?= Date: Wed, 11 Dec 2024 14:56:55 +0100 Subject: [PATCH] Fix Maven publication (#64) There was an issue with Maven publication when using Java 17. I wasn't able to figure out the exact cause, but using Java 11 seems to work fine, so I've updated the project to use that version. I've also updated the `code_quality.yml` workflow to add a step to publish to Maven local, so we can always ensure that publication works. The error that was happening can be seen in the build log of the first commit: https://github.com/SRGSSR/srgdataprovider-android/actions/runs/12274751507/job/34248321537?pr=64 --- .github/workflows/code_quality.yaml | 14 ++++++++++++++ build.gradle.kts | 2 +- data/build.gradle.kts | 6 +++--- dataprovider-paging/build.gradle.kts | 6 +++--- dataprovider-retrofit/build.gradle.kts | 6 +++--- dataproviderdemo/build.gradle.kts | 6 +++--- 6 files changed, 27 insertions(+), 13 deletions(-) diff --git a/.github/workflows/code_quality.yaml b/.github/workflows/code_quality.yaml index b2b01df..1d73c35 100644 --- a/.github/workflows/code_quality.yaml +++ b/.github/workflows/code_quality.yaml @@ -59,3 +59,17 @@ jobs: - uses: gradle/actions/setup-gradle@v4 - name: Run Unit Tests run: ./gradlew testDebug + + maven-local-publication: + name: Publish to Maven Local + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + - uses: gradle/actions/setup-gradle@v4 + - name: Publish to Maven Local + run: ./gradlew publishToMavenLocal diff --git a/build.gradle.kts b/build.gradle.kts index 20ccd1c..2150bc0 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -30,7 +30,7 @@ allprojects { } tasks.withType().configureEach { - jvmTarget = "17" + jvmTarget = "11" reports { xml.required.set(false) html.required.set(true) diff --git a/data/build.gradle.kts b/data/build.gradle.kts index c83cb8c..fd604fb 100644 --- a/data/build.gradle.kts +++ b/data/build.gradle.kts @@ -30,11 +30,11 @@ android { } compileOptions { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 } kotlinOptions { - jvmTarget = "17" + jvmTarget = "11" } lint { // https://developer.android.com/reference/tools/gradle-api/4.1/com/android/build/api/dsl/LintOptions diff --git a/dataprovider-paging/build.gradle.kts b/dataprovider-paging/build.gradle.kts index c507b2b..bdc753d 100644 --- a/dataprovider-paging/build.gradle.kts +++ b/dataprovider-paging/build.gradle.kts @@ -29,11 +29,11 @@ android { } compileOptions { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 } kotlinOptions { - jvmTarget = "17" + jvmTarget = "11" } lint { // https://developer.android.com/reference/tools/gradle-api/4.1/com/android/build/api/dsl/LintOptions diff --git a/dataprovider-retrofit/build.gradle.kts b/dataprovider-retrofit/build.gradle.kts index 450c15d..3b4bd58 100644 --- a/dataprovider-retrofit/build.gradle.kts +++ b/dataprovider-retrofit/build.gradle.kts @@ -29,11 +29,11 @@ android { } compileOptions { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 } kotlinOptions { - jvmTarget = "17" + jvmTarget = "11" } lint { // https://developer.android.com/reference/tools/gradle-api/4.1/com/android/build/api/dsl/LintOptions diff --git a/dataproviderdemo/build.gradle.kts b/dataproviderdemo/build.gradle.kts index 78915a4..58a4dc5 100644 --- a/dataproviderdemo/build.gradle.kts +++ b/dataproviderdemo/build.gradle.kts @@ -37,11 +37,11 @@ android { } compileOptions { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 } kotlinOptions { - jvmTarget = "17" + jvmTarget = "11" } lint {