Skip to content

Commit

Permalink
Merge pull request #255 from LossyDragon/updates2024
Browse files Browse the repository at this point in the history
Target Java 11, remove obsolete code, update protobufs
  • Loading branch information
LossyDragon authored Apr 12, 2024
2 parents ddfbef7 + edc946e commit b1472da
Show file tree
Hide file tree
Showing 81 changed files with 1,172 additions and 2,370 deletions.
9 changes: 6 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@ insert_final_newline = true
trim_trailing_whitespace = true

[*.{kt,kts}]
ij_kotlin_packages_to_use_import_on_demand = java.util.**, in.dragonbra.javasteam.protobufs.steamclient.**, kotlinx.coroutines.**
indent_size = 4
ktlint_disabled_rules=no-wildcard-imports
ktlint_code_style = intellij_idea
ktlint_standard_package-name = disabled
ktlint_standard_multiline-expression-wrapping = disabled
ktlint_standard_trailing-comma-on-call-site = disabled


[*.{yml,yaml}]
indent_size = 2
8 changes: 4 additions & 4 deletions .github/workflows/javasteam-build-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Checkout JavaSteam with Java 8
- name: Checkout JavaSteam with Java 11
uses: actions/setup-java@v3
with:
java-version: '8'
java-version: '11'
distribution: 'temurin'
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1
uses: gradle/wrapper-validation-action@v2
- name: Build with Gradle, skip signing
uses: gradle/gradle-build-action@v2
uses: gradle/gradle-build-action@v3
with:
arguments: build -x signMavenJavaPublication
8 changes: 4 additions & 4 deletions .github/workflows/javasteam-build-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Checkout JavaSteam with Java 8
- name: Checkout JavaSteam with Java 11
uses: actions/setup-java@v3
with:
java-version: '8'
java-version: '11'
distribution: 'temurin'
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1
uses: gradle/wrapper-validation-action@v2
- name: Build with Gradle, skip signing
uses: gradle/gradle-build-action@v2
uses: gradle/gradle-build-action@v3
with:
arguments: build -x signMavenJavaPublication
- uses: actions/upload-artifact@v3
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="javasteam [wrapper --gradle-version 8.6]" type="GradleRunConfiguration" factoryName="Gradle" nameIsGenerated="true">
<configuration default="false" name="javasteam [wrapper --gradle-version 8.7]" type="GradleRunConfiguration" factoryName="Gradle" nameIsGenerated="true">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
Expand All @@ -12,7 +12,7 @@
<list>
<option value="wrapper" />
<option value="--gradle-version" />
<option value="8.6" />
<option value="8.7" />
</list>
</option>
<option name="vmOptions" />
Expand Down
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ plugins {
`maven-publish`
alias(libs.plugins.kotlin.dokka)
alias(libs.plugins.kotlin.jvm)
alias(libs.plugins.kotlin.lint)
alias(libs.plugins.maven.publish)
alias(libs.plugins.protobuf.gradle)
id("jacoco")
Expand Down
4 changes: 2 additions & 2 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
`kotlin-dsl`
`java-gradle-plugin`
id("org.jlleitschuh.gradle.ktlint") version "11.6.1"
id("org.jlleitschuh.gradle.ktlint") version "12.1.0" // https://github.com/JLLeitschuh/ktlint-gradle/releases
}

version = "1.0.0"
Expand All @@ -14,7 +14,7 @@ dependencies {
implementation(gradleApi())

// https://mvnrepository.com/artifact/commons-io/commons-io
implementation("commons-io:commons-io:2.14.0")
implementation("commons-io:commons-io:2.16.0")
}

gradlePlugin {
Expand Down
22 changes: 14 additions & 8 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,20 +1,26 @@
# ****
# Don't forget to update dependencies in buildSrc
# toml doesn't support buildSrc yet
# ****

[versions]
# Java / Kotlin versions
java = "1.8"
kotlin = "1.9.20" # https://kotlinlang.org/docs/releases.html#release-details || https://mvnrepository.com/artifact/org.jetbrains.dokka/dokka-gradle-plugin
java = "11"
kotlin = "1.9.23" # https://kotlinlang.org/docs/releases.html#release-details
dokka = "1.9.20" # https://mvnrepository.com/artifact/org.jetbrains.dokka/dokka-gradle-plugin
ktlint = "12.1.0" # https://github.com/JLLeitschuh/ktlint-gradle/releases

# Standard Library versions
bouncyCastle = "1.77" # https://mvnrepository.com/artifact/org.bouncycastle/bcprov-jdk18on
commons-io = "2.15.1" # https://mvnrepository.com/artifact/commons-io/commons-io
bouncyCastle = "1.78" # https://mvnrepository.com/artifact/org.bouncycastle/bcprov-jdk18on
commons-io = "2.16.0" # https://mvnrepository.com/artifact/commons-io/commons-io
commons-lang3 = "3.14.0" # https://mvnrepository.com/artifact/org.apache.commons/commons-lang3
commons-validator = "1.8.0" # https://mvnrepository.com/artifact/commons-validator/commons-validator
gson = "2.10.1" # https://mvnrepository.com/artifact/com.google.code.gson/gson
jacoco = "0.8.11" # https://www.eclemma.org/jacoco
jacoco = "0.8.12" # https://www.eclemma.org/jacoco
javaWebSocket = "1.5.6" # https://mvnrepository.com/artifact/org.java-websocket/Java-WebSocket
kotlin-coroutines = "1.8.0" # https://mvnrepository.com/artifact/org.jetbrains.kotlinx/kotlinx-coroutines-core
okHttp = "5.0.0-alpha.12" # https://mvnrepository.com/artifact/com.squareup.okhttp3/okhttp
protobuf = "3.25.3" # https://mvnrepository.com/artifact/com.google.protobuf/protobuf-java
protobuf = "4.26.1" # https://mvnrepository.com/artifact/com.google.protobuf/protobuf-java
protobuf-gradle = "0.9.4" # https://mvnrepository.com/artifact/com.google.protobuf/protobuf-gradle-plugin
publishPlugin = "1.1.0" # https://mvnrepository.com/artifact/io.github.gradle-nexus/publish-plugin
qrCode = "1.0.1" # https://mvnrepository.com/artifact/pro.leaco.qrcode/console-qrcode
Expand All @@ -23,7 +29,7 @@ qrCode = "1.0.1" # https://mvnrepository.com/artifact/pro.leaco.qrcode/console-q
commonsCodec = "1.16.1" # https://mvnrepository.com/artifact/commons-codec/commons-codec
junit5 = "5.10.2" # https://mvnrepository.com/artifact/org.junit/junit-bom
mockWebServer = "5.0.0-alpha.12" # https://mvnrepository.com/artifact/com.squareup.okhttp3/mockwebserver3-junit5
mockitoVersion = "4.11.0" # https://mvnrepository.com/artifact/org.mockito/mockito-core
mockitoVersion = "5.11.0" # https://mvnrepository.com/artifact/org.mockito/mockito-core

[libraries]
bouncyCastle = { module = "org.bouncycastle:bcprov-jdk18on", version.ref = "bouncyCastle" }
Expand All @@ -48,7 +54,7 @@ test-mockito-core = { module = "org.mockito:mockito-core", version.ref = "mockit
test-mockito-jupiter = { module = "org.mockito:mockito-junit-jupiter", version.ref = "mockitoVersion" }

[plugins]
kotlin-dokka = { id = "org.jetbrains.dokka", version.ref = "kotlin" }
kotlin-dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" }
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
kotlin-lint = { id = "org.jlleitschuh.gradle.ktlint", version.ref = "ktlint" }
maven-publish = { id = "io.github.gradle-nexus.publish-plugin", version.ref = "publishPlugin" }
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.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
20 changes: 10 additions & 10 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,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 +57,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
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ private void onConnected(ConnectedCallback callback) {
// parseJsonWebToken(pollResponse.accessToken, "AccessToken");
// parseJsonWebToken(pollResponse.refreshToken, "RefreshToken");
} catch (Exception e) {
e.printStackTrace();
System.err.println(e.getMessage());

// List a couple of exceptions that could be important to handle.
if (e instanceof AuthenticationException) {
Expand Down Expand Up @@ -193,4 +193,4 @@ private void parseJsonWebToken(String token, String name) {
System.out.println();
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ private void onConnected(ConnectedCallback callback) {

steamUser.logOn(details);
} catch (Exception e) {
e.printStackTrace();
System.err.println(e.getMessage());

if (e instanceof AuthenticationException) {
System.out.println("An Authentication error has occurred.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ private void onConnected(ConnectedCallback callback) {
accessToken = pollResponse.getAccessToken();
refreshToken = pollResponse.getRefreshToken();
} catch (Exception e) {
e.printStackTrace();
System.err.println(e.getMessage());

// List a couple of exceptions that could be important to handle.
if (e instanceof AuthenticationException) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public EResult getResult() {
* The concept of this example is still valid.
*/
// handlers can also define functions which can send data to the steam servers
@SuppressWarnings("unused")
public void logOff(String user, String pass) {
ClientMsgProtobuf<CMsgClientLogOff.Builder> logOffMessage = new ClientMsgProtobuf<>(CMsgClientLogOff.class, EMsg.ClientLogOff);
client.send(logOffMessage);
Expand Down Expand Up @@ -88,4 +89,4 @@ private void handleLogonResponse(IPacketMsg packetMsg) {
// post the callback to be consumed by user code
client.postCallback(new MyCallback(result));
}
}
}
Loading

0 comments on commit b1472da

Please sign in to comment.