chore: build upgrades (#417)

Use updated methods.
Update dependencies
This commit is contained in:
TreemanKing 2024-05-12 22:36:37 +10:00 committed by GitHub
parent 669d0500fe
commit ae33016af4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 17 additions and 27 deletions

View File

@ -19,7 +19,7 @@ plugins {
allprojects {
apply plugin: 'java'
tasks.withType(JavaCompile) {
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
}
@ -32,6 +32,7 @@ allprojects {
sourceCompatibility = JavaVersion.VERSION_16
targetCompatibility = JavaVersion.VERSION_16
}
apply from: 'env-variables.gradle'
@ -44,10 +45,6 @@ println "Version: ${getVersion()}"
description = ""
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
configurations {
// configuration that holds jars to copy into lib
implementation.extendsFrom(includeLibs)
@ -119,14 +116,14 @@ minecraftServerConfig {
jvmArgument = ["-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005", "-DIReallyKnowWhatIAmDoingISwear=true"]
}
tasks.withType(Jar) {
tasks.withType(Jar).configureEach {
duplicatesStrategy = DuplicatesStrategy.WARN
}
/**
* Will build then copy it to the minecraft server folder for use with the launch task and dev tools plugin
*/
task copyPlugin() {
tasks.register('copyPlugin') {
dependsOn(build)
doLast {
copy {

View File

@ -4,10 +4,6 @@ apply plugin: 'idea'
apply plugin: 'eclipse'
apply plugin: 'java'
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
configurations {
// configuration that holds jars to copy into lib
includeLibs
@ -22,15 +18,15 @@ repositories {
// includeLibs just says to include the library in the final jar
dependencies {
//includeLibs group: 'com.google.code.gson', name: 'gson', version:'2.8.2'
implementation group: 'com.google.code.gson', name: 'gson', version:'2.8.2'
implementation group: 'com.google.code.gson', name: 'gson', version: '2.8.9'
//includeLibs group: 'com.google.inject', name: 'guice', version:'4.0'
implementation group: 'com.google.inject', name: 'guice', version:'4.0'
implementation group: 'com.google.guava', name: 'guava', version: '29.0-jre'
implementation group: 'com.google.guava', name: 'guava', version: '33.2.0-jre'
// For spigot api
implementation "org.spigotmc:spigot-api:1.16.1-R0.1-SNAPSHOT"
// For bukkit api
// For bungee api
implementation "net.md-5:bungeecord-api:1.15-SNAPSHOT"
}
@ -42,7 +38,8 @@ jar {
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present.
// If you remove this task, sources will not be generated.
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
tasks.register('sourcesJar', Jar) {
dependsOn classes
getArchiveClassifier().set('sources')
from sourceSets.main.allSource
}

View File

@ -2,10 +2,6 @@ apply plugin: 'maven-publish'
apply plugin: 'idea'
apply plugin: 'eclipse'
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
configurations {
// configuration that holds jars to copy into lib
includeLibs
@ -19,13 +15,13 @@ repositories {
// includeLibs just says to include the library in the final jar
dependencies {
includeLibs group: 'com.google.code.gson', name: 'gson', version:'2.8.7'
implementation group: 'com.google.code.gson', name: 'gson', version:'2.8.7'
includeLibs group: 'com.google.code.gson', name: 'gson', version: '2.8.9'
implementation group: 'com.google.code.gson', name: 'gson', version:'2.8.9'
includeLibs group: 'com.google.inject', name: 'guice', version:'5.0.1'
implementation group: 'com.google.inject', name: 'guice', version:'5.0.1'
implementation group: 'com.google.guava', name: 'guava', version: '30.1.1-jre'
implementation group: 'io.netty', name: 'netty-buffer', version: '4.1.53.Final'
implementation group: 'io.netty', name: 'netty-codec', version: '4.1.53.Final'
implementation group: 'com.google.guava', name: 'guava', version: '33.2.0-jre'
implementation group: 'io.netty', name: 'netty-buffer', version: '4.1.109.Final'
implementation group: 'io.netty', name: 'netty-codec', version: '4.1.109.Final'
}
jar {
@ -36,7 +32,7 @@ jar {
// Set SPIGOT_LOC to the location of your server and SPIGOT_JAR as the name of the jar file in the server you want to run
// DIReallyKnowWhatIAmDoingISwear is to remove the stupid pause spigot has at the start
task runJar() {
tasks.register('runJar') {
doLast {
javaexec {
main "-jar"

View File

@ -21,7 +21,7 @@ dependencies {
implementation "org.spigotmc:spigot-api:1.13-R0.1-SNAPSHOT"
implementation "net.md-5:bungeecord-api:1.16-R0.4"
implementation "com.mojang:authlib:3.5.41"
implementation group: 'com.google.inject', name: 'guice', version:'5.0.1'
implementation "com.google.inject:guice:5.0.1"
// Be careful to only use what you need to from paper, otherwise it will become incompatible with spigot.
//compileOnly 'com.destroystokyo.paper:paper-api:1.16.5-R0.1-SNAPSHOT'
}