Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gradle Reduction #417

Merged
merged 1 commit into from
May 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ plugins {
allprojects {
apply plugin: 'java'

tasks.withType(JavaCompile) {
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
}

Expand All @@ -32,6 +32,7 @@ allprojects {

sourceCompatibility = JavaVersion.VERSION_16
targetCompatibility = JavaVersion.VERSION_16

}

apply from: 'env-variables.gradle'
Expand All @@ -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)
Expand Down Expand Up @@ -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 {
Expand Down
15 changes: 6 additions & 9 deletions bungee/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
}

Expand All @@ -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
}
16 changes: 6 additions & 10 deletions core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 {
Expand All @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion spigot/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
Expand Down
Loading