Skip to content

Commit

Permalink
Update to Java 21
Browse files Browse the repository at this point in the history
  • Loading branch information
Aizistral committed Sep 7, 2024
1 parent 1193153 commit afd101a
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 25 deletions.
49 changes: 25 additions & 24 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@ buildscript {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "io.freefair.gradle:lombok-plugin:5.3.3.3"
}
}

plugins {
id("io.freefair.lombok") version "8.10"
id 'com.bmuschko.docker-remote-api' version '3.2.3'
}

Expand All @@ -25,7 +23,8 @@ version = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy.MM.dd-HH.

apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'io.freefair.lombok'

java.toolchain.languageVersion = JavaLanguageVersion.of(21)

repositories {
flatDir {
Expand All @@ -35,42 +34,44 @@ repositories {
}

dependencies {
compile name: 'commons-io-2.4'
compile name: 'guava-17.0'
compile name: 'gson-2.8.0'
compile name: 'asm-debug-all-5.2'
compile 'org.slf4j:slf4j-api:2.0.7'
compile 'ch.qos.logback:logback-classic:1.3.6'
compile 'net.dv8tion:JDA:5.1.0'
compile 'org.xerial:sqlite-jdbc:3.45.2.0'
implementation name: 'commons-io-2.4'
implementation name: 'guava-17.0'
implementation name: 'gson-2.8.0'
implementation name: 'asm-debug-all-5.2'
implementation 'org.slf4j:slf4j-api:2.0.7'
implementation 'ch.qos.logback:logback-classic:1.3.6'
implementation 'net.dv8tion:JDA:5.1.0'
implementation 'org.xerial:sqlite-jdbc:3.45.2.0'
}

tasks.withType(JavaCompile).configureEach {
it.options.release = 21
}

compileJava {
outputs.upToDateWhen { false }
options.compilerArgs << '-XDignore.symbol.file'
options.fork = true
options.forkOptions.executable = 'javac'
java {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}

jar {
classifier = 'bin'
baseName = archivesBaseName
archiveClassifier = 'bin'
archiveBaseName = archivesBaseName
}

task fatJar(type: Jar, dependsOn: 'jar') {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE

inputs.file jar.archivePath
from(configurations.compile.collect { zipTree(it).matching {
from(configurations.runtimeClasspath.collect { zipTree(it).matching {
exclude "META-INF/**"
} })

from("${projectDir}/services") {
into "META-INF/services"
}

classifier = 'all'
baseName = archivesBaseName
archiveClassifier = 'all'
archiveBaseName = archivesBaseName
}

tasks.withType(Jar) {
Expand All @@ -94,9 +95,9 @@ artifacts {

task createDockerfile(type: Dockerfile) {
destFile = project.file('build/docker/Dockerfile')
from 'openjdk:8-jre-alpine'
from 'openjdk:21-jre-alpine'
maintainer 'Aizistral "admin@aizistral.com"'
copyFile fatJar.archiveName, '/infinite-machine/InfiniteMachine.jar'
copyFile fatJar.archiveFileName.get(), '/infinite-machine/InfiniteMachine.jar'
runCommand 'mkdir /infinite-machine/persistence'
runCommand 'mkdir /infinite-machine/persistence/database'
runCommand 'mkdir /infinite-machine/persistence/config'
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip

0 comments on commit afd101a

Please # to comment.