Skip to content

Commit ec5451f

Browse files
committed
Update to Java 17, remove Sponge temporarily
1 parent 3f99cc5 commit ec5451f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+509
-610
lines changed

all/build.gradle

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ plugins {
33
id 'org.jetbrains.kotlin.jvm' // version '1.3.61'
44
}
55

6-
sourceCompatibility = 1.8
76
archivesBaseName = "all"
87

98
repositories {
@@ -12,18 +11,14 @@ repositories {
1211

1312
dependencies {
1413
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
15-
testCompile group: 'junit', name: 'junit', version: '4.13.1'
14+
testImplementation group: 'junit', name: 'junit', version: '4.13.1'
1615

17-
compile project(':core')
18-
compile project(':bungee')
19-
compile project(':spigot')
20-
compile project(":sponge")
21-
compile project(":velocity")
22-
}
16+
implementation project(':core')
17+
implementation project(':bungee')
18+
implementation project(':spigot')
2319

24-
compileKotlin {
25-
kotlinOptions.jvmTarget = "1.8"
26-
}
27-
compileTestKotlin {
28-
kotlinOptions.jvmTarget = "1.8"
20+
if (projects.any { it.name == "sponge" }) {
21+
implementation project(":sponge")
22+
}
23+
implementation project(":velocity")
2924
}

build.gradle

Lines changed: 27 additions & 126 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,9 @@
1-
buildscript {
2-
ext.kotlin_version = '1.5.21'
3-
repositories {
4-
jcenter()
5-
maven {
6-
url "https://plugins.gradle.org/m2/"
7-
}
8-
9-
}
10-
11-
dependencies {
12-
classpath "com.github.jengelman.gradle.plugins:shadow:4.0.4"
13-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
14-
}
15-
}
16-
171
plugins {
182
id 'java' apply true
19-
id 'org.jetbrains.kotlin.jvm' version '1.5.21'
20-
id 'net.nemerosa.versioning' version '2.14.0'
21-
id "io.freefair.lombok" version "5.3.0"
3+
id 'org.jetbrains.kotlin.jvm' version '1.6.0'
4+
id 'net.nemerosa.versioning' version '2.15.1'
5+
id "io.freefair.lombok" version "6.3.0"
6+
id 'com.github.johnrengelman.shadow' version '7.1.0'
227
id 'signing'
238
id 'maven-publish'
249
}
@@ -31,14 +16,10 @@ apply plugin: 'kotlin'
3116

3217
archivesBaseName = "FernAPI"
3318

34-
sourceCompatibility = targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
35-
compileJava {
36-
sourceCompatibility = targetCompatibility = '1.8'
37-
}
38-
3919

4020
allprojects {
4121
apply plugin: 'java'
22+
apply plugin: 'kotlin'
4223
// apply plugin: 'maven'
4324
apply plugin: 'com.github.johnrengelman.shadow'
4425
apply plugin: 'maven-publish'
@@ -50,8 +31,8 @@ allprojects {
5031
// version = versioning.info.full
5132
ext.buildVer = "1.9.0"
5233
ext.aikarVer = "0.5.0-SNAPSHOT"
53-
ext.adventureAPI = "4.8.1"
54-
ext.adventureAPIPlatform = "4.0.0-SNAPSHOT"
34+
ext.adventureAPI = "4.9.3"
35+
ext.adventureAPIPlatform = "4.0.0"
5536
ext.slf4j_ver = "1.7.30"
5637
project.ext.beta_version = '4' // Only modify when beta
5738
ext.beta_prefix = 'rc'
@@ -76,11 +57,11 @@ allprojects {
7657
full = {
7758
scmInfo ->
7859

79-
GString suffix = "${scmInfo.branch}"
60+
String suffix = "${scmInfo.branch}"
8061

8162
if (suffix == 'beta') suffix += "${project.beta_version}"
8263

83-
GString num = scmInfo.tag != null ? "${scmInfo.tag}" : "${scmInfo.abbreviated}.h-${suffix}"
64+
String num = scmInfo.tag != null ? "${scmInfo.tag}" : "${scmInfo.abbreviated}.h-${suffix}"
8465

8566
return "${num}"
8667

@@ -129,7 +110,7 @@ allprojects {
129110
}
130111

131112

132-
GString tagVer = "${buildVer}${beta_prefix}${project.beta_version}"
113+
String tagVer = "${buildVer}${beta_prefix}${project.beta_version}"
133114
// If being worked on
134115
version = versioning.info.tag != null ? versioning.info.tag : "v${tagVer}-${versioning.info.branch}-${versioning.info.build}"
135116

@@ -141,6 +122,7 @@ allprojects {
141122

142123
from(sourceSets.main.resources.srcDirs) {
143124
include 'fernapi_version.json'
125+
duplicatesStrategy = DuplicatesStrategy.WARN;
144126

145127

146128
expand 'fernapi_version': project.version
@@ -159,7 +141,6 @@ allprojects {
159141
url "https://libraries.minecraft.net"
160142
}
161143

162-
jcenter()
163144
maven { url "https://jitpack.io" }
164145
mavenCentral()
165146
maven {
@@ -174,29 +155,36 @@ allprojects {
174155
implementation fileTree(include: ['*.jar'], dir: 'libs')
175156

176157
api "net.kyori:adventure-api:$adventureAPI"
177-
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
178-
179-
compile group: 'com.google.code.findbugs', name: 'annotations', version: '3.0.1u2'
180-
181-
// compileOnly 'org.projectlombok:lombok:1.18.12'
182-
// annotationProcessor 'org.projectlombok:lombok:1.18.12'
158+
api "net.kyori:adventure-text-serializer-legacy:$adventureAPI"
159+
implementation group: 'com.google.code.findbugs', name: 'annotations', version: '3.0.1u2'
183160
}
184161

185-
sourceCompatibility = targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
162+
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_17
163+
// sourceCompatibility = targetCompatibility = JavaVersion.VERSION_17
186164

187165
compileJava {
188-
sourceCompatibility = targetCompatibility = '1.8'
166+
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_17
189167
options.compilerArgs += ["-parameters"]
190168
options.fork = true
191169
options.forkOptions.executable = 'javac'
192170
}
193171

172+
tasks.withType(JavaCompile).configureEach {
173+
options.encoding = "utf-8"
174+
175+
if (JavaVersion.current().isJava10Compatible()) {
176+
options.release.set(17)
177+
}
178+
}
179+
194180
compileKotlin {
195181
kotlinOptions.javaParameters = true
182+
kotlinOptions.jvmTarget = sourceCompatibility
196183
}
197184

198185
shadowJar {
199186
minimize()
187+
mergeServiceFiles()
200188
relocate 'co.aikar.commands', "${project.group}.acf"
201189
relocate 'co.aikar.locales', "${project.group}.locales"
202190
relocate 'co.aikar.idb', "${project.group}.idb"
@@ -289,7 +277,7 @@ allprojects {
289277
configure(subprojects.findAll {it.name != 'core'}) {
290278
afterEvaluate {
291279
dependencies {
292-
compile(project(':core'))
280+
implementation(project(':core'))
293281
}
294282
}
295283
}
@@ -306,90 +294,3 @@ configure(subprojects.findAll {it.name != 'all'}) {
306294
}
307295
}
308296
}
309-
310-
311-
repositories {
312-
mavenCentral()
313-
}
314-
dependencies {
315-
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
316-
}
317-
compileKotlin {
318-
kotlinOptions {
319-
jvmTarget = "1.8"
320-
}
321-
}
322-
compileTestKotlin {
323-
kotlinOptions {
324-
jvmTarget = "1.8"
325-
}
326-
}
327-
328-
//
329-
//repositories {
330-
// maven {
331-
// name = 'spigotmc-repo'
332-
// url = 'https://hub.spigotmc.org/nexus/content/groups/public/'
333-
// }
334-
//
335-
// maven {
336-
// name = 'sonatype'
337-
// url = 'https://oss.sonatype.org/content/groups/public/'
338-
// }
339-
//
340-
//
341-
// maven {
342-
// name = 'placeholderapi'
343-
// url = 'http://repo.extendedclip.com/content/repositories/placeholderapi/'
344-
// }
345-
//
346-
// maven {
347-
// name 'velocity'
348-
// url 'https://repo.velocitypowered.com/snapshots/'
349-
// }
350-
//
351-
// flatDir {
352-
// dirs 'libs'
353-
// }
354-
//
355-
// jcenter()
356-
// maven { url "https://jitpack.io" }
357-
// mavenCentral()
358-
//}
359-
360-
361-
362-
363-
364-
365-
366-
//
367-
//dependencies {
368-
// implementation fileTree(include: ['*.jar'], dir: 'libs')
369-
// compileOnly 'com.google.code.gson:gson:2.6.2'
370-
// //compileOnly 'org.spigotmc:spigot-api:1.8-R0.1-SNAPSHOT'
371-
// compileOnly 'org.spigotmc:spigot-api:1.14.4-R0.1-SNAPSHOT' // The Spigot API with no shadowing. Requires the OSS repo.
372-
// compileOnly 'net.md-5:bungeecord-api:1.14-SNAPSHOT'
373-
// compileOnly group: 'me.clip', name: 'placeholderapi', version: '2.9.2'
374-
// compileOnly 'org.spongepowered:spongeapi:7.1.0'
375-
// compileOnly 'com.velocitypowered:velocity-api:1.1.0-SNAPSHOT'
376-
// annotationProcessor 'com.velocitypowered:velocity-api:1.1.0-SNAPSHOT'
377-
//// compile group: 'mysql', name: 'mysql-connector-java', version: '8.0.17'
378-
// compile 'org.mariadb.jdbc:mariadb-java-client:2.1.2'
379-
// compile 'com.github.Fernthedev:fern-configmanager:1.1.2' // Check github releases tag for the version.
380-
//
381-
// compileOnly ('com.github.Fernthedev:VaultAPI:7.0') {
382-
// exclude group: 'org.bukkit'
383-
// }
384-
// // 2. Use Guava types in your public API:
385-
// compile("com.google.guava:guava:28.1-jre")
386-
////
387-
// compileOnly 'org.projectlombok:lombok:1.18.8'
388-
// annotationProcessor 'org.projectlombok:lombok:1.18.8'
389-
//
390-
//
391-
//// implementation 'com.google.guava:guava:22.0'
392-
//}
393-
394-
395-

bungee/build.gradle

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ plugins {
22
id 'java'
33
id 'org.jetbrains.kotlin.jvm'// version '1.4.32'
44
}
5-
sourceCompatibility = 1.8
65
archivesBaseName = "bungee"
76

87
repositories {
@@ -16,14 +15,5 @@ repositories {
1615
dependencies {
1716
implementation "net.kyori:adventure-platform-bungeecord:$adventureAPIPlatform"
1817
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
19-
testCompile group: 'junit', name: 'junit', version: '4.13.1'
20-
compileOnly 'net.md-5:bungeecord-api:1.16-R0.3'
18+
compileOnly 'net.md-5:bungeecord-api:1.18-R0.1-SNAPSHOT'
2119
}
22-
23-
compileKotlin {
24-
kotlinOptions.jvmTarget = "1.8"
25-
}
26-
compileTestKotlin {
27-
kotlinOptions.jvmTarget = "1.8"
28-
}
29-

bungee/src/main/java/com/github/fernthedev/fernapi/server/bungee/BungeeInterface.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import net.md_5.bungee.api.CommandSender;
1515
import net.md_5.bungee.api.ProxyServer;
1616
import net.md_5.bungee.api.connection.ProxiedPlayer;
17+
import org.jetbrains.annotations.NotNull;
1718
import org.slf4j.Logger;
1819
import org.slf4j.LoggerFactory;
1920

@@ -120,7 +121,7 @@ public OfflineFPlayer<ProxiedPlayer> getPlayerFromName(String name) {
120121
}
121122

122123
@Override
123-
public OfflineFPlayer<ProxiedPlayer> getPlayerFromUUID(UUID uuid) {
124+
public @NotNull OfflineFPlayer<ProxiedPlayer> getPlayerFromUUID(UUID uuid) {
124125
ProxiedPlayer player = fernBungeeAPI.getProxy().getPlayer(uuid);
125126

126127
Universal.debug(() ->"Player uuid " + uuid + " for player " + player);
@@ -167,7 +168,7 @@ public List<IFPlayer<ProxiedPlayer>> matchPlayerName(String name) {
167168
return getPlayers()
168169
.parallelStream()
169170
.filter(proxiedPlayerIFPlayer -> proxiedPlayerIFPlayer.getName().contains(name))
170-
.collect(Collectors.toList());
171+
.toList();
171172
}
172173

173174

bungee/src/main/java/com/github/fernthedev/fernapi/server/bungee/interfaces/BungeePluginData.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import com.github.fernthedev.fernapi.universal.handlers.FernAPIPlugin;
66
import com.github.fernthedev.fernapi.universal.handlers.MethodInterface;
77
import lombok.NonNull;
8-
import lombok.RequiredArgsConstructor;
98
import lombok.SneakyThrows;
109
import net.md_5.bungee.api.plugin.PluginDescription;
1110
import org.jetbrains.annotations.NotNull;
@@ -16,12 +15,14 @@
1615
import java.util.List;
1716
import java.util.logging.Logger;
1817

19-
@RequiredArgsConstructor
2018
public class BungeePluginData implements PluginData<PluginDescription> {
2119

2220
@NonNull
2321
private final PluginDescription bungeePluginData;
2422

23+
public BungeePluginData(@NonNull PluginDescription bungeePluginData) {
24+
this.bungeePluginData = bungeePluginData;
25+
}
2526

2627
/**
2728
* @return the server specific instance. Use for checking equality or getting server-specific data

0 commit comments

Comments
 (0)