Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
octylFractal committed Jul 17, 2024
1 parent 7a14eea commit 97830f3
Show file tree
Hide file tree
Showing 13 changed files with 56 additions and 41 deletions.
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM openjdk:17-alpine AS gradle_build
RUN apk add --no-cache sqlite
FROM eclipse-temurin:21 AS gradle_build
RUN apt-get -y update && apt-get install -y sqlite3
COPY . /
RUN ["./gradlew", "-si", "build", "installDist"]

FROM openjdk:17-alpine
FROM eclipse-temurin:21-alpine
RUN apk add --no-cache sqlite
RUN addgroup -g 1001 -S cassette_deck && adduser -u 1001 -S cassette_deck -G cassette_deck
RUN mkdir /cassette_deck && chown -R cassette_deck:cassette_deck /cassette_deck
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ cassette-deck
=============
A server to provide various metadata about Minecraft versions.

Requires Java 17 to build.
Requires Java 21 to build.
2 changes: 1 addition & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ plugins {
}

java {
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
toolchain.languageVersion.set(JavaLanguageVersion.of(21))
}

tasks.withType<JavaCompile> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.collect.ImmutableList;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.enginehub.cassettedeck.data.blob.LibraryStorage;
import org.springframework.stereotype.Component;
import org.springframework.util.FileSystemUtils;
Expand All @@ -36,6 +38,7 @@
import java.util.stream.Collectors;

public class DataGeneratorExecutor {
private static final Logger LOGGER = LogManager.getLogger();
private static final String JAVA_EXECUTABLE = ProcessHandle.current().info().command()
.orElseThrow(() -> new IllegalStateException("Don't know the java executable for this process"));
private static final Lock GENERATOR_LOCK = new ReentrantLock();
Expand Down Expand Up @@ -68,7 +71,7 @@ private List<Path> prepareClassPath() throws IOException {

private void runGenerator(String... args) throws IOException {
List<Path> classPath = prepareClassPath();
Process process = new ProcessBuilder(
ProcessBuilder processBuilder = new ProcessBuilder(
new ImmutableList.Builder<String>()
.add(JAVA_EXECUTABLE)
.add("-Xms64M", "-Xmx4G")
Expand All @@ -78,8 +81,9 @@ private void runGenerator(String... args) throws IOException {
.add(args)
.build()
)
.inheritIO()
.start();
.inheritIO();
LOGGER.info("Running data gen: {}", processBuilder.command());
Process process = processBuilder.start();
try {
int exitCode = process.waitFor();
if (exitCode != 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,11 @@ public Result load(MinecraftVersionEntry entry) throws DownloadException {
int dataVersion;
MojangBlockStates blockStates;
try {
try (var zf = new ZipFile(new SeekableInMemoryByteChannel(minecraftJarBytes))) {
try (
var zf = ZipFile.builder()
.setSeekableByteChannel(new SeekableInMemoryByteChannel(minecraftJarBytes))
.get()
) {
dataVersion = getDataVersion(entry, zf);
if (doDataGen) {
if (zf.getEntry("net/minecraft/data/Main.class") == null) {
Expand Down
1 change: 1 addition & 0 deletions app/src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
spring.threads.virtual.enabled=true

minecraft-version.poll.interval=P1D

Expand Down
2 changes: 1 addition & 1 deletion docker/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ if ! [ -f storage/database.sqlite ]; then
done
fi
fi
./bin/app "$@"
exec ./bin/app "$@"
20 changes: 10 additions & 10 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
[versions]
jooq = "3.18.5"
jooq = "3.19.10"

[plugins]
spring-boot = "org.springframework.boot:3.1.2"
spring-boot = "org.springframework.boot:3.3.1"

licenser = "org.cadixdev.licenser:0.6.1"

jooq = "nu.studer.jooq:8.2.1"
jooq = "nu.studer.jooq:9.0"

[libraries]
jetbrains-annotations = "org.jetbrains:annotations:24.0.1"
jetbrains-annotations = "org.jetbrains:annotations:24.1.0"

spring-boot-starter-web.module = "org.springframework.boot:spring-boot-starter-web"
spring-boot-starter-tomcat.module = "org.springframework.boot:spring-boot-starter-tomcat"
Expand All @@ -19,17 +19,17 @@ spring-boot-starter-security.module = "org.springframework.boot:spring-boot-star
spring-boot-starter-log4j2.module = "org.springframework.boot:spring-boot-starter-log4j2"
spring-boot-starter-test.module = "org.springframework.boot:spring-boot-starter-test"

bucket4j-core = "com.github.vladimir-bukhtoyarov:bucket4j-core:7.6.0"
bucket4j-core = "com.github.vladimir-bukhtoyarov:bucket4j-core:8.0.1"

apache-commons-compress = "org.apache.commons:commons-compress:1.23.0"
apache-commons-compress = "org.apache.commons:commons-compress:1.26.2"

guava = "com.google.guava:guava:32.1.1-jre"
guava = "com.google.guava:guava:33.2.1-jre"

xerial-sqlite = "org.xerial:sqlite-jdbc:3.42.0.0"
xerial-sqlite = "org.xerial:sqlite-jdbc:3.46.0.0"

disruptor = "com.lmax:disruptor:3.4.4"
disruptor = "com.lmax:disruptor:4.0.0"

junit-bom = "org.junit:junit-bom:5.10.0"
junit-bom = "org.junit:junit-bom:5.10.3"
junit-jupiter-api.module = "org.junit.jupiter:junit-jupiter-api"
junit-jupiter-engine.module = "org.junit.jupiter:junit-jupiter-engine"

Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
22 changes: 13 additions & 9 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#

##############################################################################
#
Expand Down Expand Up @@ -55,7 +57,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand Down Expand Up @@ -83,7 +85,9 @@ done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
' "$PWD" ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down Expand Up @@ -144,15 +148,15 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -201,11 +205,11 @@ fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.

set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
Expand Down
22 changes: 12 additions & 10 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem

@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
Expand Down Expand Up @@ -43,11 +45,11 @@ set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand All @@ -57,11 +59,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto execute

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand Down
2 changes: 1 addition & 1 deletion jooq-extensions/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
}

java {
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
toolchain.languageVersion.set(JavaLanguageVersion.of(21))
withJavadocJar()
withSourcesJar()
}
Expand Down

0 comments on commit 97830f3

Please sign in to comment.