diff --git a/CarbonChat-API/build.gradle b/CarbonChat-API/build.gradle index 08ddfda1..ee9f435b 100644 --- a/CarbonChat-API/build.gradle +++ b/CarbonChat-API/build.gradle @@ -5,27 +5,30 @@ plugins { description 'CarbonChat-API' dependencies { - compile 'org.checkerframework:checker-qual:3.7.0' + api "org.checkerframework:checker-qual:${vers['checker-qual']}" - compile 'net.kyori:adventure-api:4.1.1' - compile 'net.kyori:adventure-nbt:4.1.1' - compile 'net.kyori:adventure-platform-api:4.0.0-SNAPSHOT' - compile 'net.kyori:adventure-text-serializer-plain:4.1.1' - compile 'net.kyori:adventure-text-serializer-gson:4.1.1' - compile 'net.kyori:adventure-text-serializer-legacy:4.1.1' - compile 'net.kyori:adventure-text-minimessage:4.1.0-SNAPSHOT' + api "net.kyori:adventure-api:${vers['adventure']}" + api "net.kyori:adventure-nbt:${vers['adventure']}" + api "net.kyori:adventure-platform-api:${vers['adventure-platform']}" + api "net.kyori:adventure-text-serializer-plain:${vers['adventure']}" + api("net.kyori:adventure-text-serializer-gson:${vers['adventure']}") { + exclude group: 'com.google.code.gson' + } + api "net.kyori:adventure-text-serializer-legacy:${vers['adventure']}" + api "net.kyori:adventure-text-minimessage:${vers['minimessage']}" - compile 'de.themoep:minedown-adventure:1.6.2-SNAPSHOT' + api "de.themoep:minedown-adventure:${vers['minedown']}" - compile 'net.kyori:event-api:3.0.0' - compile 'net.kyori:registry:1.0.0-SNAPSHOT' + api("net.kyori:event-api:${vers['kyori-event-api']}") + api("net.kyori:registry:${vers['kyori-registry']}") - api 'cloud.commandframework:cloud-core:1.2.0-SNAPSHOT' + api "cloud.commandframework:cloud-core:${vers['cloud']}" - api 'org.spongepowered:configurate-yaml:4.0.0-SNAPSHOT' - api 'org.spongepowered:configurate-hocon:4.0.0-SNAPSHOT' + api "org.spongepowered:configurate-core:${vers['configurate']}" - api 'org.slf4j:slf4j-api:1.7.25' + api "com.google.guava:guava:${vers['guava']}" - api 'net.luckperms:api:5.1' + compileOnlyApi "org.slf4j:slf4j-api:${vers['slf4j-api']}" + + compileOnlyApi "net.luckperms:api:${vers['luckperms-api']}" } diff --git a/CarbonChat-Bukkit/build.gradle b/CarbonChat-Bukkit/build.gradle index 5c247b81..df65e304 100644 --- a/CarbonChat-Bukkit/build.gradle +++ b/CarbonChat-Bukkit/build.gradle @@ -1,42 +1,44 @@ +import java.nio.charset.StandardCharsets + plugins { - id 'com.github.johnrengelman.shadow' version '6.0.0' + id 'com.github.johnrengelman.shadow' version '6.1.0' id 'net.minecrell.plugin-yml.bukkit' version '0.3.0' } description = 'CarbonChat-Bukkit' dependencies { - compile 'org.spongepowered:configurate-yaml:4.0.0-SNAPSHOT' - compile 'org.spongepowered:configurate-hocon:4.0.0-SNAPSHOT' - compile 'org.yaml:snakeyaml:1.27' - - compile 'net.kyori:adventure-text-serializer-bungeecord:4.0.0-SNAPSHOT' - compile 'net.kyori:adventure-platform-bukkit:4.0.0-SNAPSHOT' - - compile project(":CarbonChat-Common") - - // Messaging - compile 'io.github.leonardosnt:bungeechannelapi:1.0.0-SNAPSHOT' - - // Commands - compile "cloud.commandframework:cloud-paper:1.2.0-SNAPSHOT" - - // Plugins - compileOnly('com.gmail.nossr50.mcMMO:mcMMO:2.1.143') { - exclude group: 'org.jetbrains', module: 'annotations' - } - compileOnly 'com.github.TownyAdvanced:Towny:0.96.2.0' - compileOnly('com.sk89q.worldguard:worldguard-bukkit:7.0.4-SNAPSHOT') { - exclude group: 'org.spigotmc', module: 'spigot-api' // Honestly? - } - compileOnly 'me.clip:placeholderapi:2.10.9' - compileOnly 'com.github.TownyAdvanced:Towny:0.96.1.11' - - compileOnly 'net.luckperms:api:5.1' - compileOnly 'com.github.MilkBowl:VaultAPI:1.7' + implementation project(":CarbonChat-Common") // Server - compileOnly 'com.destroystokyo.paper:paper-api:1.16.2-R0.1-SNAPSHOT' + compileOnly "com.destroystokyo.paper:paper-api:${vers['paper-api']}" + + // Adventure + implementation "net.kyori:adventure-platform-bukkit:${vers['adventure-platform']}" + implementation "net.kyori:adventure-text-serializer-bungeecord:${vers['adventure-platform']}" + + // Config + implementation "org.spongepowered:configurate-yaml:${vers['configurate']}" + implementation "org.spongepowered:configurate-hocon:${vers['configurate']}" + implementation "org.yaml:snakeyaml:${vers['snakeyaml']}" + + // Messaging + implementation "io.github.leonardosnt:bungeechannelapi:${vers['bungeechannelapi']}" + + // Commands + implementation "cloud.commandframework:cloud-paper:${vers['cloud']}" + + // Plugins + compileOnly("com.gmail.nossr50.mcMMO:mcMMO:${vers['mcmmo']}") { + exclude group: 'org.jetbrains', module: 'annotations' + } + compileOnly "com.github.TownyAdvanced:Towny:${vers['towny']}" + compileOnly("com.sk89q.worldguard:worldguard-bukkit:${vers['worldguard']}") { + exclude group: 'org.spigotmc', module: 'spigot-api' // Honestly? + } + compileOnly "me.clip:placeholderapi:${vers['placeholder-api']}" + compileOnly "net.luckperms:api:${vers['luckperms-api']}" + compileOnly "com.github.MilkBowl:VaultAPI:${vers['vault']}" } // Generates plugin.yml automatically @@ -62,14 +64,14 @@ bukkit { checkstyle { def configRoot = new File(rootProject.projectDir, '.checkstyle') - toolVersion = '8.34' + toolVersion = vers['checkstyle'] configDirectory = configRoot configProperties = [basedir: configRoot.getAbsolutePath()] } // Set output directory and encoding tasks.withType(JavaCompile) { - options.encoding = 'UTF-8' + options.encoding = StandardCharsets.UTF_8.name() options.compilerArgs += ['-Xlint:all'] } @@ -82,7 +84,23 @@ shadowJar { archiveFileName.set(project.description + "-" + project.property('projectVersion') + ".jar") destinationDirectory = rootProject.getBuildDir() relocate("org.yaml", "net.draycia.carbon.libs.org.yaml") - relocate("net.kyori.adventure.text.minimessage", "net.draycia.carbon.libs.minimessage") + relocate("net.kyori", "net.draycia.carbon.libs.kyori") + relocate("org.spongepowered.configurate", "net.draycia.carbon.libs.configurate") + relocate("org.checkerframework", "net.draycia.carbon.libs.checkerframework") + relocate("org.reactivestreams", "net.draycia.carbon.libs.reactivestreams") + relocate("org.codehaus", "net.draycia.carbon.libs.codehaus") + relocate("org.slf4j", "net.draycia.carbon.libs.slf4j") + relocate("io.leangen.geantyref", "net.draycia.carbon.libs.typereference") + relocate("io.lettuce", "net.draycia.carbon.libs.lettuce") + relocate("io.github.leonardosnt.bungeechannelapi", "net.draycia.carbon.libs.bungeechannelapi") + relocate("co.aikar.idb", "net.draycia.carbon.libs.idb") + relocate("cloud.commandframework", "net.draycia.carbon.libs.cloud") + relocate("com.zaxxer.hikari", "net.draycia.carbon.libs.hikari") + relocate("com.typesafe.config", "net.draycia.carbon.libs.typesafe.config") + relocate("com.google", "net.draycia.carbon.libs.google") + relocate("de.themoep.minedown", "net.draycia.carbon.libs.minedown") + relocate("reactor", "net.draycia.carbon.libs.reactor") + relocate("javax.annotation", "net.draycia.carbon.libs.javax.annotation") } jar { diff --git a/CarbonChat-Common/build.gradle b/CarbonChat-Common/build.gradle index 8c8ff873..a71af34a 100644 --- a/CarbonChat-Common/build.gradle +++ b/CarbonChat-Common/build.gradle @@ -1,21 +1,21 @@ description 'CarbonChat-Common' dependencies { - checkstyle("ca.stellardrift:stylecheck:0.1-SNAPSHOT") + checkstyle("ca.stellardrift:stylecheck:${vers['stylecheck']}") - compile project(':CarbonChat-API') + api project(':CarbonChat-API') - compile('io.lettuce:lettuce-core:6.0.0.M1') { + implementation("io.lettuce:lettuce-core:${vers['lettuce-core']}") { exclude group: 'io.netty' } - compileOnly 'com.google.code.gson:gson:2.8.0' + implementation "org.spongepowered:configurate-hocon:${vers['configurate']}" + implementation "org.spongepowered:configurate-yaml:${vers['configurate']}" - compile 'org.spongepowered:configurate-hocon:4.0.0-SNAPSHOT' - compile 'org.spongepowered:configurate-yaml:4.0.0-SNAPSHOT' + implementation "co.aikar:idb-core:${vers['idb-core']}" + implementation "com.zaxxer:HikariCP:${vers['hikari']}" - compile 'co.aikar:idb-core:1.0.0-SNAPSHOT' - compile 'com.zaxxer:HikariCP:2.4.1' + compileOnly "com.google.code.gson:gson:${vers['gson']}" - compileOnly 'org.slf4j:slf4j-api:1.7.25' + compileOnly "org.slf4j:slf4j-api:${vers['slf4j-api']}" } diff --git a/build.gradle b/build.gradle index c4b24053..b995714f 100644 --- a/build.gradle +++ b/build.gradle @@ -3,6 +3,9 @@ plugins { id 'org.checkerframework' version '0.5.11' } +// Get dependency versions from a centralized location +apply from: 'dependencies.gradle' + // Gets the git commit hash of the latest commit, used for version string ext.projectVersion = '1.0' def gitHash = versionDetails().gitHash @@ -15,14 +18,12 @@ subprojects { apply plugin: 'checkstyle' apply plugin: 'java' apply plugin: 'java-library' - apply plugin: 'maven' apply plugin: 'maven-publish' apply plugin: 'org.checkerframework' repositories { mavenCentral() - maven { url = 'https://mvn.intellectualsites.com/content/repositories/snapshots' } maven { url = 'https://repo.maven.apache.org/maven2' } maven { url = 'https://oss.sonatype.org/content/groups/public/' } maven { url = 'https://maven.enginehub.org/repo/' } @@ -32,17 +33,16 @@ subprojects { maven { url = 'https://dl.bintray.com/ichbinjoe/public/' } maven { url = 'https://repo.codemc.org/repository/maven-public/' } maven { url = "https://repo.aikar.co/content/groups/aikar/" } - maven { url = 'https://raw.githubusercontent.com/JorelAli/CommandAPI/mvn-repo/' } maven { url = 'https://repo.minebench.de/' } } dependencies { - checkstyle("ca.stellardrift:stylecheck:0.1-SNAPSHOT") + checkstyle("ca.stellardrift:stylecheck:${vers['stylecheck']}") } checkstyle { def configRoot = new File(rootProject.projectDir, '.checkstyle') - toolVersion = '8.34' + toolVersion = vers['checkstyle'] configDirectory = configRoot configProperties = [basedir: configRoot.getAbsolutePath()] } diff --git a/dependencies.gradle b/dependencies.gradle new file mode 100644 index 00000000..0437b8c3 --- /dev/null +++ b/dependencies.gradle @@ -0,0 +1,34 @@ +ext { + vers = [ + 'checkstyle' : '8.34', + 'stylecheck' : '0.1-SNAPSHOT', + 'checker-qual' : '3.8.0', + 'guava' : '26.0-jre', + 'slf4j-api' : '1.7.25', + 'adventure' : '4.3.0', + 'adventure-platform': '4.0.0-SNAPSHOT', + 'minimessage' : '4.1.0-SNAPSHOT', + 'kyori-event-api' : '3.0.0', + 'kyori-registry' : '1.0.0-SNAPSHOT', + 'minedown' : '1.6.2-SNAPSHOT', + 'cloud' : '1.2.0', + 'configurate' : '4.0.0', + 'luckperms-api' : '5.1', + + // Common + 'lettuce-core' : '6.0.0.M1', + 'idb-core' : '1.0.0-SNAPSHOT', + 'hikari' : '2.4.1', + 'gson' : '2.8.0', + + // Bukkit + 'paper-api' : '1.16.4-R0.1-SNAPSHOT', + 'snakeyaml' : '1.27', + 'bungeechannelapi' : '1.0.0-SNAPSHOT', + 'mcmmo' : '2.1.143', + 'towny' : '0.96.2.0', + 'worldguard' : '7.0.4-SNAPSHOT', + 'placeholder-api' : '2.10.9', + 'vault' : '1.7', + ] +} diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 62d4c053..e708b1c0 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 3c2788ff..4d9ca164 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,5 @@ -#Tue Jul 21 04:25:42 PDT 2020 -distributionUrl=https\://services.gradle.org/distributions/gradle-6.5.1-all.zip distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index fbd7c515..4f906e0c 100755 --- a/gradlew +++ b/gradlew @@ -130,7 +130,7 @@ fi if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then APP_HOME=`cygpath --path --mixed "$APP_HOME"` CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - + JAVACMD=`cygpath --unix "$JAVACMD"` # We build the pattern for arguments to be converted via cygpath diff --git a/gradlew.bat b/gradlew.bat index 5093609d..107acd32 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init +if "%ERRORLEVEL%" == "0" goto execute echo. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. @@ -54,7 +54,7 @@ goto fail set JAVA_HOME=%JAVA_HOME:"=% set JAVA_EXE=%JAVA_HOME%/bin/java.exe -if exist "%JAVA_EXE%" goto init +if exist "%JAVA_EXE%" goto execute echo. echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% @@ -64,21 +64,6 @@ echo location of your Java installation. goto fail -:init -@rem Get command-line arguments, handling Windows variants - -if not "%OS%" == "Windows_NT" goto win9xME_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* - :execute @rem Setup the command line @@ -86,7 +71,7 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* :end @rem End local scope for the variables with windows NT shell