Skip to content

Commit

Permalink
feat(node+bukkit+bungeecord): Update to CloudNet 4.0.0-RC11
Browse files Browse the repository at this point in the history
This patch updates the sample project to target the newly release CloudNet version 4.0.0-RC11.
In doing so, this project now requires to be built with Java SDK 23 or newer.

In addition, the Gradle samples have moved to a version catalog to ease the management and updates of dependencies and keeps all dependency versions in sync.

Due to the latest update, the RPC samples have been updated as well.
  • Loading branch information
GiantTreeLP committed Oct 19, 2024
1 parent e40da9e commit 3932a55
Show file tree
Hide file tree
Showing 16 changed files with 108 additions and 72 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: Set up JDK 21
- name: Set up JDK 23
uses: actions/setup-java@v3
with:
java-version: '21'
java-version: '23'
distribution: 'temurin'
cache: maven
- name: Build with Maven
Expand All @@ -28,10 +28,10 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: Setup up JDK 21
- name: Setup up JDK 23
uses: actions/setup-java@v3
with:
java-version: '21'
java-version: '23'
distribution: 'temurin'
cache: gradle
- name: Build with Gradle
Expand Down
16 changes: 6 additions & 10 deletions gradle/bukkit/plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,13 @@ repositories {
}

dependencies {
// Spigot
val spigotVersion = "1.21-R0.1-SNAPSHOT"
implementation("org.spigotmc", "spigot-api", spigotVersion)
// BOMs
implementation(platform(libs.cloudnet.bom))
testImplementation(platform(libs.junit.bom))
testImplementation(libs.junit.jupiter)

// CloudNet
val cloudNetVersion = "4.0.0-RC10"
implementation(platform("eu.cloudnetservice.cloudnet:bom:$cloudNetVersion"))
implementation("eu.cloudnetservice.cloudnet", "bridge")
implementation("eu.cloudnetservice.cloudnet", "wrapper-jvm")
implementation("eu.cloudnetservice.cloudnet", "platform-inject-api")
annotationProcessor("eu.cloudnetservice.cloudnet", "platform-inject-processor", cloudNetVersion)
implementation(libs.bundles.spigot.plugin)
annotationProcessor(libs.cloudnet.platform.inject.processor)
}

tasks.test {
Expand Down
19 changes: 6 additions & 13 deletions gradle/bungeecord/plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,13 @@ repositories {
}

dependencies {
testImplementation(platform("org.junit:junit-bom:5.10.0"))
testImplementation("org.junit.jupiter:junit-jupiter")
// BOMs
implementation(platform(libs.cloudnet.bom))
testImplementation(platform(libs.junit.bom))
testImplementation(libs.junit.jupiter)

// BungeeCord
val bungeecordVersion = "1.21-R0.1-SNAPSHOT"
implementation("net.md-5", "bungeecord-api", bungeecordVersion)

// CloudNet
val cloudNetVersion = "4.0.0-RC10"
implementation(platform("eu.cloudnetservice.cloudnet:bom:$cloudNetVersion"))
implementation("eu.cloudnetservice.cloudnet", "bridge")
implementation("eu.cloudnetservice.cloudnet", "wrapper-jvm")
implementation("eu.cloudnetservice.cloudnet", "platform-inject-api")
annotationProcessor("eu.cloudnetservice.cloudnet", "platform-inject-processor", cloudNetVersion)
implementation(libs.bundles.bungeecord.plugin)
annotationProcessor(libs.cloudnet.platform.inject.processor)
}

tasks.test {
Expand Down
6 changes: 0 additions & 6 deletions gradle/cloudnet/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,4 @@ repositories {
}

dependencies {
testImplementation(platform("org.junit:junit-bom:5.10.0"))
testImplementation("org.junit.jupiter:junit-jupiter")
}

tasks.test {
useJUnitPlatform()
}
25 changes: 9 additions & 16 deletions gradle/cloudnet/rpc-module/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id("java")
id("eu.cloudnetservice.juppiter") version "0.4.0"
alias(libs.plugins.juppiter)
}

group = "com.github.moincraft.gradle.cloudnet"
Expand Down Expand Up @@ -31,21 +31,14 @@ repositories {
}

dependencies {
testImplementation(platform("org.junit:junit-bom:5.10.0"))
testImplementation("org.junit.jupiter:junit-jupiter")

compileOnly("org.slf4j", "slf4j-api", "2.0.13")

// Spigot
val spigotVersion = "1.21-R0.1-SNAPSHOT"
implementation("org.spigotmc", "spigot-api", spigotVersion)

// CloudNet
val cloudNetVersion = "4.0.0-RC10"
implementation(platform("eu.cloudnetservice.cloudnet:bom:$cloudNetVersion"))
implementation("eu.cloudnetservice.cloudnet", "node")
implementation("eu.cloudnetservice.cloudnet", "platform-inject-api")
annotationProcessor("eu.cloudnetservice.cloudnet", "platform-inject-processor", cloudNetVersion)
// BOMs
implementation(platform(libs.cloudnet.bom))
testImplementation(platform(libs.junit.bom))
testImplementation(libs.junit.jupiter)

implementation(libs.bundles.spigot.plugin)
implementation(libs.bundles.node.module)
annotationProcessor(libs.cloudnet.platform.inject.processor)
}

tasks.test {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.github.moincraft.cloudnet.module.platform;

import eu.cloudnetservice.driver.network.NetworkClient;
import eu.cloudnetservice.driver.network.rpc.RPCFactory;
import eu.cloudnetservice.driver.network.rpc.factory.RPCFactory;
import eu.cloudnetservice.driver.network.rpc.RPCSender;
import jakarta.inject.Inject;
import jakarta.inject.Singleton;
Expand Down Expand Up @@ -30,7 +30,7 @@ public PlatformRPCSample(
@Nonnull RPCFactory rpcFactory,
@Nonnull NetworkClient networkClient
) {
this.rpcSender = rpcFactory.providerForClass(networkClient, RPCSample.class);
this.rpcSender = rpcFactory.newRPCSenderBuilder(RPCSample.class).targetComponent(networkClient).build();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.github.moincraft.cloudnet.module.platform.node;

import com.github.moincraft.cloudnet.module.platform.RPCSample;
import eu.cloudnetservice.driver.network.rpc.RPCFactory;
import eu.cloudnetservice.driver.network.rpc.RPCHandlerRegistry;
import eu.cloudnetservice.driver.network.rpc.factory.RPCFactory;
import eu.cloudnetservice.driver.network.rpc.handler.RPCHandlerRegistry;
import jakarta.inject.Inject;
import jakarta.inject.Singleton;
import org.slf4j.Logger;
Expand Down Expand Up @@ -30,7 +30,7 @@ public NodeRPCSample(
@Nonnull RPCHandlerRegistry rpcHandlerRegistry
) {
// Register the RPC handler
var rpcHandler = rpcFactory.newHandler(RPCSample.class, this);
var rpcHandler = rpcFactory.newRPCHandlerBuilder(RPCSample.class).targetInstance(this).build();
rpcHandlerRegistry.registerHandler(rpcHandler);
}

Expand Down
51 changes: 51 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
[versions]
cloudnet = "4.0.0-RC11"
juppiter = "0.4.0"

spigot = "1.21.1-R0.1-SNAPSHOT"
bungeecord = "1.21-R0.1-SNAPSHOT"

slf4j = "2.0.16"
junit = "5.11.2"

[libraries]
cloudnet-bom = { group = "eu.cloudnetservice.cloudnet", name = "bom", version.ref = "cloudnet" }
cloudnet-bridge = { group = "eu.cloudnetservice.cloudnet", name = "bridge", version.ref = "cloudnet" }
cloudnet-wrapper-jvm = { group = "eu.cloudnetservice.cloudnet", name = "wrapper-jvm", version.ref = "cloudnet" }
cloudnet-platform-inject-api = { group = "eu.cloudnetservice.cloudnet", name = "platform-inject-api", version.ref = "cloudnet" }
cloudnet-platform-inject-processor = { group = "eu.cloudnetservice.cloudnet", name = "platform-inject-processor", version.ref = "cloudnet" }
cloudnet-node = { group = "eu.cloudnetservice.cloudnet", name = "node", version.ref = "cloudnet" }

spigot-api = { group = "org.spigotmc", name = "spigot-api", version.ref = "spigot" }
bungeecord-api = { group = "net.md-5", name = "bungeecord-api", version.ref = "bungeecord" }

slf4j-api = { group = "org.slf4j", name = "slf4j-api", version.ref = "slf4j" }

junit-bom = { group = "org.junit", name = "junit-bom", version.ref = "junit" }
junit-jupiter = { group = "org.junit.jupiter", name = "junit-jupiter", version.ref = "junit" }

[plugins]
juppiter = { id = "eu.cloudnetservice.juppiter", version.ref = "juppiter" }

[bundles]
spigot-plugin = [
"cloudnet-bridge",
"cloudnet-wrapper-jvm",
"cloudnet-platform-inject-api",
"spigot-api",
]

bungeecord-plugin = [
"cloudnet-bridge",
"cloudnet-wrapper-jvm",
"cloudnet-platform-inject-api",
"bungeecord-api",
]

node-module = [
"cloudnet-bridge",
"cloudnet-node",
"cloudnet-wrapper-jvm",
"cloudnet-platform-inject-api",
"slf4j-api",
]
9 changes: 9 additions & 0 deletions gradle/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,12 @@ include("bungeecord")
include("bungeecord:plugin")
include("cloudnet")
include("cloudnet:rpc-module")

dependencyResolutionManagement {
versionCatalogs {
create("libs") {
from(files("libs.versions.toml"))
}
}
}

8 changes: 4 additions & 4 deletions maven/bukkit/plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
<artifactId>maven-bukkit-plugin</artifactId>

<properties>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<maven.compiler.source>23</maven.compiler.source>
<maven.compiler.target>23</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

Expand All @@ -30,7 +30,7 @@
<dependency>
<groupId>eu.cloudnetservice.cloudnet</groupId>
<artifactId>bom</artifactId>
<version>4.0.0-RC10</version>
<version>4.0.0-RC11</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand All @@ -41,7 +41,7 @@
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.21-R0.1-SNAPSHOT</version>
<version>1.21.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<!-- CloudNet v4 -->
Expand Down
4 changes: 2 additions & 2 deletions maven/bukkit/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
</modules>

<properties>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<maven.compiler.source>23</maven.compiler.source>
<maven.compiler.target>23</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

Expand Down
2 changes: 1 addition & 1 deletion maven/bungeecord/plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<dependency>
<groupId>eu.cloudnetservice.cloudnet</groupId>
<artifactId>bom</artifactId>
<version>4.0.0-RC10</version>
<version>4.0.0-RC11</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down
4 changes: 2 additions & 2 deletions maven/bungeecord/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
</modules>

<properties>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<maven.compiler.source>23</maven.compiler.source>
<maven.compiler.target>23</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

Expand Down
4 changes: 2 additions & 2 deletions maven/cloudnet/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
</modules>

<properties>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<maven.compiler.source>23</maven.compiler.source>
<maven.compiler.target>23</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

Expand Down
10 changes: 5 additions & 5 deletions maven/cloudnet/rpc-module/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
<artifactId>rpc-module</artifactId>

<properties>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<maven.compiler.source>23</maven.compiler.source>
<maven.compiler.target>23</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

Expand All @@ -30,7 +30,7 @@
<dependency>
<groupId>eu.cloudnetservice.cloudnet</groupId>
<artifactId>bom</artifactId>
<version>4.0.0-RC10</version>
<version>4.0.0-RC11</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand All @@ -41,13 +41,13 @@
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.21-R0.1-SNAPSHOT</version>
<version>1.21.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>2.0.13</version>
<version>2.0.16</version>
</dependency>
<!-- CloudNet v4 -->
<dependency>
Expand Down
4 changes: 2 additions & 2 deletions maven/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
</modules>

<properties>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<maven.compiler.source>23</maven.compiler.source>
<maven.compiler.target>23</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

Expand Down

0 comments on commit 3932a55

Please sign in to comment.