From 6cc93c85ed926d6c91d96cafbdbba91f6280200a Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Tue, 29 Oct 2024 09:46:33 +0100 Subject: [PATCH] Upgrade Gradle and Kotlin version (#18) * Upgrade Gradle and Kotlin version * Update libpretixsync to use merged kotlin/gradle-upgrade * Add explicit dependency on libpretixsync for server jar * Remove signature when building a fat jar --------- Co-authored-by: Maximilian Richt --- .github/workflows/main.yml | 4 +-- .github/workflows/release.yml | 4 +-- build.gradle | 33 +++--------------------- gradle/wrapper/gradle-wrapper.properties | 2 +- libpretixsync-repo | 2 +- server/build.gradle | 15 ++++++----- 6 files changed, 18 insertions(+), 42 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 36a2710..f4e81a6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -11,7 +11,7 @@ jobs: build: strategy: matrix: - java: [ '11', '17' ] + java: [ '17', '21' ] runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -35,4 +35,4 @@ jobs: uses: mikepenz/action-junit-report@v4 if: success() || failure() with: - report_paths: '**/build/test-results/test/TEST-*.xml' \ No newline at end of file + report_paths: '**/build/test-results/test/TEST-*.xml' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index efde85e..ef22db7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,10 +11,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: set up JDK 11 + - name: set up JDK 17 uses: actions/setup-java@v1 with: - java-version: 11 + java-version: 17 - name: Submodules run: git submodule update --init - name: Build diff --git a/build.gradle b/build.gradle index a36c229..fd704b3 100644 --- a/build.gradle +++ b/build.gradle @@ -1,38 +1,11 @@ -buildscript { - ext.kotlin_version = '1.7.20' - repositories { - jcenter() - mavenCentral() - maven { - url "https://plugins.gradle.org/m2/" - } - } - dependencies { - classpath "net.ltgt.gradle:gradle-apt-plugin:0.17" - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath "com.google.protobuf:protobuf-gradle-plugin:0.8.11" - } +plugins { + id 'org.jetbrains.kotlin.jvm' version '1.9.23' apply false + id 'org.jetbrains.kotlin.kapt' version '1.9.23' apply false } group 'eu.pretix.pretixscan' version '1.0-SNAPSHOT' -apply plugin: 'base' -apply plugin: 'kotlin' -apply plugin: 'java' -apply plugin: 'kotlin-kapt' -apply plugin: 'net.ltgt.apt-idea' - repositories { mavenCentral() } - -dependencies { -} - -compileKotlin { - kotlinOptions.jvmTarget = "11" -} -compileTestKotlin { - kotlinOptions.jvmTarget = "11" -} \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 2e6e589..17655d0 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -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 diff --git a/libpretixsync-repo b/libpretixsync-repo index b20fbea..d045829 160000 --- a/libpretixsync-repo +++ b/libpretixsync-repo @@ -1 +1 @@ -Subproject commit b20fbeaaab0605b7b8e2192ea38c382413fc09b7 +Subproject commit d045829952863e6ddb805f535f542a1590a01860 diff --git a/server/build.gradle b/server/build.gradle index 1ba799e..c5fb0a0 100644 --- a/server/build.gradle +++ b/server/build.gradle @@ -1,9 +1,10 @@ plugins { - id 'application' - id 'kotlin' - id 'kotlin-kapt' - id 'com.github.johnrengelman.shadow' version '7.1.2' - id 'com.palantir.git-version' version '3.0.0' + id('application') + id('org.jetbrains.kotlin.jvm') + id('org.jetbrains.kotlin.kapt') + id('com.github.johnrengelman.shadow') version '7.1.2' + id('com.palantir.git-version') version '3.0.0' + id('com.google.protobuf') version '0.9.4' apply false } apply from: '../libpretixsync-repo/libpretixsync/versions.gradle' @@ -12,7 +13,6 @@ version gitVersion() repositories { mavenCentral() - jcenter() } dependencies { @@ -55,6 +55,8 @@ dependencies { mainClassName = "eu.pretix.pretixscan.scanproxy.Server" jar { + dependsOn(':libpretixsync:jar') + duplicatesStrategy = DuplicatesStrategy.EXCLUDE manifest { attributes "Main-Class": mainClassName @@ -62,6 +64,7 @@ jar { from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } } + exclude 'META-INF/*.RSA', 'META-INF/*.SF', 'META-INF/*.DSA' } java { sourceCompatibility = JavaVersion.VERSION_11