From 856cef24781b6c1ad02bd5fac76a6e4c4b3e73be Mon Sep 17 00:00:00 2001 From: soloturn Date: Fri, 4 Feb 2022 01:06:44 +0100 Subject: [PATCH 1/2] javac --release to build for java8, with java11+ javac since java9 has a new flat --release to build a binary which can be run with an older java. the public API of that older release must be followed as well. the flags used before, -source, -target do not do this. therefor it got unnoticed that plantuml did not compile and run in java7 any more, despite beeing compiled for for java7. https://github.com/plantuml/plantuml/issues/898 --- build.gradle.kts | 6 ++++-- pom.xml | 3 +-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 014f46dac..bf006019c 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -18,8 +18,6 @@ dependencies { group = "net.sourceforge.plantuml" description = "PlantUML" -java.sourceCompatibility = JavaVersion.VERSION_1_8 -java.targetCompatibility = JavaVersion.VERSION_1_8 java { withSourcesJar() @@ -51,6 +49,10 @@ sourceSets { } } +tasks.compileJava { + options.release.set(8) +} + tasks.withType { manifest { attributes["Main-Class"] = "net.sourceforge.plantuml.Run" diff --git a/pom.xml b/pom.xml index a4e99df4d..250e37f7f 100644 --- a/pom.xml +++ b/pom.xml @@ -56,8 +56,7 @@ ${project.artifactId}-${project.version} - 1.8 - 1.8 + 8 net.sourceforge.plantuml.Run From 2bdb2f83003fbfd024edb08636332d11d9829c04 Mon Sep 17 00:00:00 2001 From: soloturn Date: Fri, 4 Feb 2022 01:12:06 +0100 Subject: [PATCH 2/2] github workflow --release flag needs build with 11 https://github.com/plantuml/plantuml/issues/898 --- .github/workflows/ci-gradle.yml | 4 ++-- .github/workflows/ci.yml | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci-gradle.yml b/.github/workflows/ci-gradle.yml index 7bc8bcb8e..45305a809 100644 --- a/.github/workflows/ci-gradle.yml +++ b/.github/workflows/ci-gradle.yml @@ -71,12 +71,12 @@ jobs: strategy: fail-fast: false matrix: - java_version: [ 8, 11, 17 ] + java_version: [ 11, 17 ] os: [ macos-10.15, macos-11, ubuntu-18.04, ubuntu-20.04, windows-2019, windows-2022 ] include: - release_from_this_build: true os: ubuntu-20.04 - java_version: 8 + java_version: 11 runs-on: ${{ matrix.os }} env: SIGN_ARTIFACTS: ${{ secrets.ARTIFACT_SIGNING_KEY != '' }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a81c57bfc..8ab0d8c1a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -71,12 +71,12 @@ jobs: strategy: fail-fast: false matrix: - java_version: [ 8, 11, 17 ] + java_version: [ 11, 17 ] os: [ macos-10.15, macos-11, ubuntu-18.04, ubuntu-20.04, windows-2019, windows-2022 ] include: - release_from_this_build: true os: ubuntu-20.04 - java_version: 8 + java_version: 11 runs-on: ${{ matrix.os }} env: SIGN_ARTIFACTS: ${{ secrets.ARTIFACT_SIGNING_KEY != '' }} @@ -144,7 +144,7 @@ jobs: if: matrix.release_from_this_build uses: actions/upload-artifact@v2 with: - # Using github.run_number here to reduce confusion when downloading & comparing artifacts from several builds + # Using github.run_number here to reduce confusion when downloading & comparing artifacts from several builds name: ${{ github.run_number }}-artifacts path: | target/*.asc