From 4bccc8d3d6b50ddc9f77b9b84ce8c646082854a5 Mon Sep 17 00:00:00 2001 From: Sekwah Date: Mon, 4 Jun 2018 11:59:23 +0100 Subject: [PATCH 1/3] Updateged build --- build.gradle | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/build.gradle b/build.gradle index 23c9266..aeb0664 100644 --- a/build.gradle +++ b/build.gradle @@ -12,23 +12,38 @@ sourceCompatibility = 1.8 targetCompatibility = 1.8 tasks.withType(JavaCompile) { - options.encoding = 'UTF-8' + options.encoding = 'UTF-8' } - repositories { maven { url "http://repo.maven.apache.org/maven2" } } + +configurations { + // configuration that holds jars to copy into lib + includeLibs +} + +// includeLibs just says to include the library in the final jar dependencies { + includeLibs group: 'com.google.code.gson', name: 'gson', version:'2.8.2' compile group: 'com.google.code.gson', name: 'gson', version:'2.8.2' + includeLibs group: 'com.google.inject', name: 'guice', version:'4.0' compile group: 'com.google.inject', name: 'guice', version:'4.0' } +jar { + from configurations.includeLibs.collect { it.isDirectory() ? it : zipTree(it) } +} + // 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() << { javaexec { - main="-jar"; args "${System.env.SPIGOT_LOC}\\${System.env.SPIGOT_JAR}.jar"; - workingDir = "${System.env.SPIGOT_LOC}"; + main "-jar" + args "${System.env.MC_SERVER_LOC}\\${System.env.MC_SERVER_JAR}.jar" + jvmArgs "-DIReallyKnowWhatIAmDoingISwear=true" + workingDir "${System.env.MC_SERVER_LOC}" } -} +} \ No newline at end of file From 63d11ee1e98e3fa3ef8930ceb263d85b0d281512 Mon Sep 17 00:00:00 2001 From: Sekwah Date: Mon, 4 Jun 2018 11:59:23 +0100 Subject: [PATCH 2/3] Updated build --- build.gradle | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/build.gradle b/build.gradle index 23c9266..aeb0664 100644 --- a/build.gradle +++ b/build.gradle @@ -12,23 +12,38 @@ sourceCompatibility = 1.8 targetCompatibility = 1.8 tasks.withType(JavaCompile) { - options.encoding = 'UTF-8' + options.encoding = 'UTF-8' } - repositories { maven { url "http://repo.maven.apache.org/maven2" } } + +configurations { + // configuration that holds jars to copy into lib + includeLibs +} + +// includeLibs just says to include the library in the final jar dependencies { + includeLibs group: 'com.google.code.gson', name: 'gson', version:'2.8.2' compile group: 'com.google.code.gson', name: 'gson', version:'2.8.2' + includeLibs group: 'com.google.inject', name: 'guice', version:'4.0' compile group: 'com.google.inject', name: 'guice', version:'4.0' } +jar { + from configurations.includeLibs.collect { it.isDirectory() ? it : zipTree(it) } +} + // 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() << { javaexec { - main="-jar"; args "${System.env.SPIGOT_LOC}\\${System.env.SPIGOT_JAR}.jar"; - workingDir = "${System.env.SPIGOT_LOC}"; + main "-jar" + args "${System.env.MC_SERVER_LOC}\\${System.env.MC_SERVER_JAR}.jar" + jvmArgs "-DIReallyKnowWhatIAmDoingISwear=true" + workingDir "${System.env.MC_SERVER_LOC}" } -} +} \ No newline at end of file From 0acc8204e1b593c91b1942a29f23926343f723dc Mon Sep 17 00:00:00 2001 From: Sekwah Date: Mon, 4 Jun 2018 12:01:58 +0100 Subject: [PATCH 3/3] Changed to proper annotations --- .../java/com/sekwah/advancedportals/core/CoreListeners.java | 3 +-- .../advancedportals/core/repository/ConfigRepositoryImpl.java | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/sekwah/advancedportals/core/CoreListeners.java b/src/main/java/com/sekwah/advancedportals/core/CoreListeners.java index 97fe9dd..2e92ced 100644 --- a/src/main/java/com/sekwah/advancedportals/core/CoreListeners.java +++ b/src/main/java/com/sekwah/advancedportals/core/CoreListeners.java @@ -1,5 +1,6 @@ package com.sekwah.advancedportals.core; +import com.google.inject.Inject; import com.google.inject.name.Named; import com.sekwah.advancedportals.core.api.services.PortalServices; import com.sekwah.advancedportals.core.api.services.PortalTempDataServices; @@ -11,8 +12,6 @@ import com.sekwah.advancedportals.core.util.Lang; import com.sekwah.advancedportals.coreconnector.container.PlayerContainer; import com.sekwah.advancedportals.coreconnector.container.WorldContainer; -import javax.inject.Inject; - public class CoreListeners { private PortalTempDataServices portalTempDataServices; diff --git a/src/main/java/com/sekwah/advancedportals/core/repository/ConfigRepositoryImpl.java b/src/main/java/com/sekwah/advancedportals/core/repository/ConfigRepositoryImpl.java index e0fa687..7129f97 100644 --- a/src/main/java/com/sekwah/advancedportals/core/repository/ConfigRepositoryImpl.java +++ b/src/main/java/com/sekwah/advancedportals/core/repository/ConfigRepositoryImpl.java @@ -1,10 +1,9 @@ package com.sekwah.advancedportals.core.repository; +import com.google.inject.Singleton; import com.sekwah.advancedportals.core.config.Config; import com.sekwah.advancedportals.core.data.DataStorage; -import javax.inject.Singleton; - @Singleton public class ConfigRepositoryImpl implements ConfigRepository {