Skip to content

Commit

Permalink
update: Update to Twitch4J 1.23.0 (#12)
Browse files Browse the repository at this point in the history
update: Update to Twitch4J 1.23.0
  • Loading branch information
Awakened-Redstone authored Nov 14, 2024
2 parents 2258096 + 1779712 commit 8be758c
Show file tree
Hide file tree
Showing 13 changed files with 124 additions and 117 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Set up JDK 17
- name: Set up JDK 21
uses: actions/setup-java@2dfa2011c5b2a0f1489bf9e433881c92c1631f88 # v4.3.0
with:
java-version: '17'
java-version: '21'
distribution: 'temurin'
- uses: gradle/actions/setup-gradle@d156388eb19639ec20ade50009f3d199ce1e2808 # v4.1.0
- run: ./gradlew build modrinth
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,5 @@ run/

# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar
/CHANGELOG.md
/deps-*.txt
/maven-metadata.xml
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
* Bump Twitch4J version (Awakened Redstone)
* Update the minimum loader version to `0.14.23` to handle Java 22 binaries packaged on jackson (Awakened Redstone)
* The mod is now compiled with a Java 8 target instead of Java 17 (Awakened Redstone)
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2022 PhilippHeuer, iProdigy, stachu540, sg4e, Waridley, tedyoung, potb, tadite, SomniumPrime, boostchicken, BelchingJalapeno, sgdc3, MaximKulikov, SethFalco, FCKJohni, MaciejGorczyca, artek2001, sp0ck1, LunarWatcher, p4czyk, Kaufisch, sulunemre, keysym, Flewp, jonteohr
Copyright (c) 2022 Philipp Heuer, Awakened Redstone

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
97 changes: 42 additions & 55 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import net.fabricmc.loom.task.RemapJarTask
import groovy.json.JsonSlurper
import groovy.xml.XmlSlurper

plugins {
id 'fabric-loom' version '1.1-SNAPSHOT'
id 'fabric-loom' version '1.8-SNAPSHOT'
id "com.modrinth.minotaur" version "2.+"
id 'maven-publish'
}

def MINECRAFT_VERSIONS_FILE = "generated/minecraft_versions.txt"
def minecraftVersions = file(MINECRAFT_VERSIONS_FILE).text.readLines()

def CHANGELOG = new File('CHANGELOG.md').exists() ? new File('CHANGELOG.md').text : ""

archivesBaseName = project.archives_base_name
Expand All @@ -25,7 +24,9 @@ dependencies {
testImplementation(platform("org.junit:junit-bom:5.9.2"))
testImplementation("org.junit.jupiter:junit-jupiter")

include modApi("com.github.twitch4j:twitch4j:${project.library_version}")
include modApi("com.github.twitch4j:twitch4j:${project.library_version}") {
exclude group: "org.slf4j", module: "slf4j-api"
}
include "com.github.twitch4j:twitch4j-auth:${project.library_version}"
include "com.github.twitch4j:twitch4j-chat:${project.library_version}"
include "com.github.twitch4j:twitch4j-client-websocket:${project.library_version}"
Expand All @@ -40,24 +41,28 @@ dependencies {
include "com.github.twitch4j:twitch4j-pubsub:${project.library_version}"
include "com.github.twitch4j:twitch4j-util:${project.library_version}"

include "com.apollographql.apollo:apollo-api-jvm:2.5.14"
include "com.apollographql.apollo:apollo-http-cache-api:2.5.14"
include "com.apollographql.apollo:apollo-normalized-cache-api-jvm:2.5.14"
include "com.apollographql.apollo:apollo-normalized-cache-jvm:2.5.14"
include "com.apollographql.apollo:apollo-runtime:2.5.14"
var apollo = "2.5.14"
var events4j = "0.12.2"
var jackson = "2.18.1"
var openfeign = "13.5"
var xanthic = "0.6.2"

include "com.apollographql.apollo:apollo-api-jvm:$apollo"
include "com.apollographql.apollo:apollo-http-cache-api:$apollo"
include "com.apollographql.apollo:apollo-normalized-cache-api-jvm:$apollo"
include "com.apollographql.apollo:apollo-normalized-cache-jvm:$apollo"
include "com.apollographql.apollo:apollo-runtime:$apollo"
include "com.benasher44:uuid-jvm:0.2.0"
include "com.bucket4j:bucket4j_jdk8-core:8.10.1"
include "com.fasterxml.jackson.core:jackson-annotations:2.17.2"
include "com.fasterxml.jackson.core:jackson-core:2.17.2"
include "com.fasterxml.jackson.core:jackson-databind:2.17.2"
include "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.17.2"
include "com.fasterxml.jackson:jackson-bom:2.17.2"
include "com.fasterxml.jackson.core:jackson-annotations:$jackson"
include "com.fasterxml.jackson.core:jackson-core:$jackson"
include "com.fasterxml.jackson.core:jackson-databind:$jackson"
include "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson"
include "com.github.ben-manes.caffeine:caffeine:2.9.3"
include "com.github.philippheuer.credentialmanager:credentialmanager:0.3.1"
include "com.github.philippheuer.events4j:events4j-api:0.12.2"
include "com.github.philippheuer.events4j:events4j-bom:0.12.2"
include "com.github.philippheuer.events4j:events4j-core:0.12.2"
include "com.github.philippheuer.events4j:events4j-handler-simple:0.12.2"
include "com.github.philippheuer.events4j:events4j-api:$events4j"
include "com.github.philippheuer.events4j:events4j-core:$events4j"
include "com.github.philippheuer.events4j:events4j-handler-simple:$events4j"
include "com.github.tony19:named-regexp:1.0.0"
include "com.google.errorprone:error_prone_annotations:2.10.0"
include "com.neovisionaries:nv-websocket-client:2.14"
Expand All @@ -68,14 +73,14 @@ dependencies {
include "com.squareup.okio:okio-jvm:3.6.0"
include "commons-configuration:commons-configuration:1.10"
include "commons-lang:commons-lang:2.6"
include "io.github.openfeign:feign-core:13.4"
include "io.github.openfeign:feign-hystrix:13.4"
include "io.github.openfeign:feign-jackson:13.4"
include "io.github.openfeign:feign-okhttp:13.4"
include "io.github.openfeign:feign-slf4j:13.4"
include "io.github.xanthic.cache:cache-api:0.6.1"
include "io.github.xanthic.cache:cache-core:0.6.1"
include "io.github.xanthic.cache:cache-provider-caffeine:0.6.1"
include "io.github.openfeign:feign-core:$openfeign"
include "io.github.openfeign:feign-hystrix:$openfeign"
include "io.github.openfeign:feign-jackson:$openfeign"
include "io.github.openfeign:feign-okhttp:$openfeign"
include "io.github.openfeign:feign-slf4j:$openfeign"
include "io.github.xanthic.cache:cache-api:$xanthic"
include "io.github.xanthic.cache:cache-core:$xanthic"
include "io.github.xanthic.cache:cache-provider-caffeine:$xanthic"
include "io.reactivex:rxjava:1.2.0"
include "net.fabricmc:fabric-language-kotlin:1.10.19+kotlin.1.9.23"
include "org.hdrhistogram:HdrHistogram:2.1.9"
Expand All @@ -90,7 +95,7 @@ processResources {
}
}

def targetJavaVersion = 17
def targetJavaVersion = 8
tasks.withType(JavaCompile).configureEach {
// ensure that the encoding is set to UTF-8, no matter what the system default is
// this fixes some edge cases with special characters not displaying correctly
Expand Down Expand Up @@ -152,6 +157,15 @@ build.dependsOn remapMavenJar
tasks.modrinth.dependsOn(tasks.remapMavenJar)

modrinth {
def json = new URL("https://meta.fabricmc.net/v2/versions/game").text
def versions = new JsonSlurper().parseText(json)
def minecraftVersions = new ArrayList<String>()
for (def version : versions) {
if (version.stable) {
minecraftVersions.add(version.version)
}
}

String projectVersion = project.version.toString()
List<String> projectVersionNumber = projectVersion.split("-", 2)
String projectVersionName = "Release ${projectVersionNumber[0]}"
Expand All @@ -178,27 +192,6 @@ modrinth {
uploadFile = remapJar
}

import groovy.json.JsonSlurper
import groovy.xml.XmlSlurper

import java.nio.charset.StandardCharsets

tasks.register('updateMinecraftVersions') {
group = "update"
doFirst {
def json = new URL("https://meta.fabricmc.net/v2/versions/game").text
def versions = new JsonSlurper().parseText(json)
def output = new StringBuilder()
for (def version : versions) {
if (version.stable) {
output.append("${version.version}")
output.append("\n")
}
}
file(MINECRAFT_VERSIONS_FILE).setText(output.toString(), StandardCharsets.UTF_8.name())
}
}

tasks.register('checkVersion') {
doFirst {
def xml = new URL("https://maven.awakenedredstone.com/com/github/twitch4j/twitch4j-fabric/maven-metadata.xml").text
Expand All @@ -210,10 +203,4 @@ tasks.register('checkVersion') {
}
}

tasks.register('updateVersions') {
group = "update"
dependsOn(updateMinecraftVersions)
}

publish.dependsOn checkVersion
project.tasks.modrinth.dependsOn updateVersions
32 changes: 0 additions & 32 deletions generated/minecraft_versions.txt

This file was deleted.

6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ org.gradle.jvmargs=-Xmx2G
# check these on https://modmuss50.me/fabric.html
minecraft_version=1.18.2
yarn_mappings=1.18.2+build.2
loader_version=0.14.19
loader_version=0.14.23

# Mod Properties
mod_version=1.8.0
library_version=1.22.0
mod_version=1.9.0
library_version=1.23.0
maven_group=com.github.twitch4j
archives_base_name=twitch4j-fabric
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 3 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
41 changes: 28 additions & 13 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/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 All @@ -80,13 +80,11 @@ do
esac
done

APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

APP_NAME="Gradle"
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}

# 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"'
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down Expand Up @@ -133,22 +131,29 @@ location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi

# Increase the maximum file descriptors if we can.
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=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=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -193,18 +198,28 @@ if "$cygwin" || "$msys" ; then
done
fi

# 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.

# 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, 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" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
"$@"

# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi

# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
Expand Down
15 changes: 9 additions & 6 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
@rem limitations under the License.
@rem

@if "%DEBUG%" == "" @echo off
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
Expand All @@ -25,7 +25,8 @@
if "%OS%"=="Windows_NT" setlocal

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

Expand All @@ -40,7 +41,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto execute
if %ERRORLEVEL% equ 0 goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Expand Down Expand Up @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar

:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
if %ERRORLEVEL% equ 0 goto mainEnd

:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%

:mainEnd
if "%OS%"=="Windows_NT" endlocal
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"icon": "assets/twitch4j/icon.png",
"environment": "*",
"depends": {
"fabricloader": ">=0.14.7",
"fabricloader": ">=0.14.23",
"minecraft": "*"
}
}
Loading

0 comments on commit 8be758c

Please sign in to comment.