Convert build scripts to Kotlin

Also added some new tasks to only build/install to maven local certain platforms
`buildMinecraft`, `installMinecraft`, `buildDiscord`, `installDiscord`, `buildIRC`, `installIRC`
This commit is contained in:
jmp 2020-12-31 21:26:53 -08:00 committed by Alexander Söderberg
parent d812ea633a
commit 2c188eb130
48 changed files with 519 additions and 499 deletions

View file

@ -1,206 +0,0 @@
import java.nio.charset.StandardCharsets
buildscript {
repositories {
mavenCentral()
maven { url = 'https://oss.sonatype.org/content/repositories/snapshots/' }
jcenter()
}
dependencies {
classpath 'com.bmuschko:gradle-nexus-plugin:2.3.1'
}
}
plugins {
id 'checkstyle'
id 'com.github.hierynomus.license' version '0.15.0'
id 'java-library'
id 'com.github.johnrengelman.shadow' version '6.1.0'
id 'de.marcphilipp.nexus-publish' version '0.4.0'
id 'net.ltgt.errorprone' version '1.3.0'
}
apply from: 'scripts/dependencies.gradle'
checkstyle {
configFile file('config/checkstyle/checkstyle.xml')
}
gradle.taskGraph.whenReady {
gradle.taskGraph.allTasks.each {
if (it.project.name.contains('example')) {
it.onlyIf {
project.hasProperty('compile-examples')
}
}
}
}
allprojects {
apply plugin: 'idea'
apply plugin: 'checkstyle'
apply plugin: 'com.github.hierynomus.license'
group = 'cloud.commandframework'
version = '1.4.0-SNAPSHOT'
description = 'Command framework and dispatcher for the JVM'
/* Disable checkstyle on tests */
project.gradle.startParameter.excludedTaskNames.add('checkstyleTest')
license {
header rootProject.file('HEADER')
mapping 'java', 'DOUBLESLASH_STYLE'
mapping 'kt', 'DOUBLESLASH_STYLE'
includes(["**/*.java", "**/*.kt"])
}
build.dependsOn(checkstyleMain)
}
subprojects {
apply plugin: 'java'
apply plugin: 'java-library'
apply plugin: 'signing'
apply plugin: 'de.marcphilipp.nexus-publish'
apply plugin: 'net.ltgt.errorprone'
test {
useJUnitPlatform()
}
java {
withSourcesJar()
withJavadocJar()
}
tasks.withType(JavaCompile).configureEach {
options.compilerArgs << "-Xlint:all" << "-Xlint:-processing" << "-Werror"
options.errorprone {
/* These are just annoying */
disable(
"JdkObsolete",
"FutureReturnValueIgnored",
"ImmutableEnumChecker",
"StringSplitter",
"EqualsGetClass",
"CatchAndPrintStackTrace"
)
}
}
repositories {
mavenLocal()
mavenCentral()
jcenter()
maven {
/* Sonatype Snapshots */
url = 'https://oss.sonatype.org/content/repositories/snapshots'
}
maven {
/* ViaVersion, used for adventure */
url = 'https://repo.viaversion.com/'
}
maven {
/* Velocity, used for cloud-velocity */
url = 'https://repo.velocitypowered.com/snapshots/'
}
maven {
/* The Minecraft repository, used for cloud-brigadier */
url = 'https://libraries.minecraft.net/'
}
maven {
/* The current Sponge repository */
url = 'https://repo-new.spongepowered.org/repository/maven-public/'
}
maven {
/* The Spigot repository, used for cloud-bukkit */
url = 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/'
}
maven {
/* The paper repository, used for cloud-paper */
url = 'https://papermc.io/repo/repository/maven-public/'
}
maven {
/* The NukkitX repository, used for cloud-cloudburst */
url = 'https://repo.nukkitx.com/maven-snapshots'
}
maven {
/* JitPack, used for random dependencies */
url = 'https://jitpack.io'
}
}
dependencies {
compileOnly "org.checkerframework:checker-qual:${vers['checker-qual']}"
api "io.leangen.geantyref:geantyref:${vers['geantyref']}"
testImplementation "org.junit.jupiter:junit-jupiter-engine:${vers['jupiter-engine']}"
errorprone "com.google.errorprone:error_prone_core:${vers['errorprone']}"
errorproneJavac "com.google.errorprone:javac:9+181-r4173-1"
}
nexusPublishing {
repositories {
sonatype()
}
}
sourceCompatibility = '1.8'
[JavaCompile, Javadoc].forEach { taskType ->
tasks.withType(taskType) {
options.encoding(StandardCharsets.UTF_8.name())
}
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
pom {
name = project.name
url = 'https://github.com/Incendo/cloud'
description = project.description
developers {
developer {
id = 'Sauilitired'
name = 'Alexander Söderberg'
url = 'https://alexander-soderberg.com'
email = 'contact@alexander-soderberg.com'
}
}
issueManagement {
system = 'GitHub Issues'
url = 'https://github.com/Incendo/cloud/issues'
}
licenses {
license {
name = 'MIT License'
url = 'https://opensource.org/licenses/MIT'
}
}
scm {
connection = 'scm:git@github.com:Incendo/cloud.git'
developerConnection = 'scm:git@github.com:Incendo/cloud.git'
url = 'https://github.com/Incendo/cloud/'
}
}
}
}
}
signing {
required {
project.hasProperty('signing.keyId') && (gradle.taskGraph.hasTask(':publish')
|| gradle.taskGraph.hasTask(':publishToSonatype')
|| gradle.taskGraph.hasTask(':publishToMavenLocal'))
}
sign publishing.publications.mavenJava
}
}

191
build.gradle.kts Normal file
View file

@ -0,0 +1,191 @@
import com.hierynomus.gradle.license.LicenseBasePlugin
import de.marcphilipp.gradle.nexus.NexusPublishPlugin
import net.ltgt.gradle.errorprone.ErrorPronePlugin
import net.ltgt.gradle.errorprone.errorprone
buildscript {
repositories {
mavenCentral()
maven("https://oss.sonatype.org/content/repositories/snapshots/")
jcenter()
}
dependencies {
classpath("com.bmuschko", "gradle-nexus-plugin", "2.3.1")
}
}
plugins {
`java-library`
signing
id("checkstyle")
id("com.github.hierynomus.license") version "0.15.0"
id("com.github.johnrengelman.shadow") version "6.1.0"
id("de.marcphilipp.nexus-publish") version "0.4.0"
id("net.ltgt.errorprone") version "1.3.0"
}
checkstyle {
configFile = file("config/checkstyle/checkstyle.xml")
}
buildGroups("Minecraft", "Discord", "IRC")
gradle.taskGraph.whenReady {
gradle.taskGraph.allTasks.forEach {
if (it.project.name.contains("example")) {
it.onlyIf {
project.hasProperty("compile-examples")
}
}
}
}
allprojects {
apply<IdeaPlugin>()
apply<CheckstylePlugin>()
apply<LicenseBasePlugin>()
group = "cloud.commandframework"
version = "1.4.0-SNAPSHOT"
description = "Command framework and dispatcher for the JVM"
/* Disable checkstyle on tests */
project.gradle.startParameter.excludedTaskNames.add("checkstyleTest")
license {
header = rootProject.file("HEADER")
mapping("java", "DOUBLESLASH_STYLE")
mapping("kotlin", "DOUBLESLASH_STYLE")
includes(listOf("**/*.java", "**/*.kt"))
}
}
subprojects {
apply<JavaLibraryPlugin>()
apply<SigningPlugin>()
apply<NexusPublishPlugin>()
apply<ErrorPronePlugin>()
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
withSourcesJar()
withJavadocJar()
}
tasks {
withType<Test> {
useJUnitPlatform()
}
withType<JavaCompile>() {
options.encoding = Charsets.UTF_8.name()
options.compilerArgs.addAll(setOf("-Xlint:all", "-Xlint:-processing", "-Werror"))
options.errorprone {
/* These are just annoying */
disable(
"JdkObsolete",
"FutureReturnValueIgnored",
"ImmutableEnumChecker",
"StringSplitter",
"EqualsGetClass",
"CatchAndPrintStackTrace"
)
}
}
withType<Javadoc> {
options.encoding = Charsets.UTF_8.name()
}
build {
dependsOn(checkstyleMain)
}
}
repositories {
mavenLocal()
mavenCentral()
jcenter()
/* Sonatype Snapshots */
maven("https://oss.sonatype.org/content/repositories/snapshots")
/* ViaVersion, used for adventure */
maven("https://repo.viaversion.com/")
/* Velocity, used for cloud-velocity */
maven("https://repo.velocitypowered.com/snapshots/")
/* The Minecraft repository, used for cloud-brigadier */
maven("https://libraries.minecraft.net/")
/* The current Sponge repository */
maven("https://repo-new.spongepowered.org/repository/maven-public/")
/* The Spigot repository, used for cloud-bukkit */
maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots/")
/* The paper repository, used for cloud-paper */
maven("https://papermc.io/repo/repository/maven-public/")
/* The NukkitX repository, used for cloud-cloudburst */
maven("https://repo.nukkitx.com/maven-snapshots")
/* JitPack, used for random dependencies */
maven("https://jitpack.io")
}
dependencies {
compileOnly("org.checkerframework", "checker-qual", vers["checker-qual"])
api("io.leangen.geantyref", "geantyref", vers["geantyref"])
testImplementation("org.junit.jupiter", "junit-jupiter-engine", vers["jupiter-engine"])
errorprone("com.google.errorprone", "error_prone_core", vers["errorprone"])
errorproneJavac("com.google.errorprone", "javac", vers["errorprone_javac"])
compileOnly("com.google.errorprone", "error_prone_annotations", vers["errorprone"])
}
nexusPublishing {
repositories {
sonatype()
}
}
publishing {
publications {
create<MavenPublication>("mavenJava") {
from(components["java"])
pom {
name.set(project.name)
url.set("https://github.com/Incendo/cloud")
description.set(project.description)
developers {
developer {
id.set("Sauilitired")
name.set("Alexander Söderberg")
url.set("https://alexander-soderberg.com")
email.set("contact@alexander-soderberg.com")
}
}
issueManagement {
system.set("GitHub Issues")
url.set("https://github.com/Incendo/cloud/issues")
}
licenses {
license {
name.set("MIT License")
url.set("https://opensource.org/licenses/MIT")
}
}
scm {
connection.set("scm:git@github.com:Incendo/cloud.git")
developerConnection.set("scm:git@github.com:Incendo/cloud.git")
url.set("https://github.com/Incendo/cloud/")
}
}
}
}
}
signing {
isRequired = project.hasProperty("signing.keyId")
&& (gradle.taskGraph.hasTask(":publish")
|| gradle.taskGraph.hasTask(":publishToSonatype")
|| gradle.taskGraph.hasTask(":publishToMavenLocal"))
sign(publishing.publications["mavenJava"])
}
}

View file

@ -0,0 +1,7 @@
plugins {
`kotlin-dsl`
}
repositories {
jcenter()
}

View file

@ -0,0 +1,29 @@
val versions = mapOf(
"checker-qual" to "3.8.0",
"geantyref" to "1.3.11",
"errorprone" to "2.4.0",
"errorprone_javac" to "9+181-r4173-1",
// DISCORD DEPENDENCIES
"javacord" to "3.1.1",
"jda" to "4.2.0_209",
// MINECRAFT DEPENDENCIES
"brigadier" to "1.0.17",
"bukkit" to "1.13.2-R0.1-SNAPSHOT",
"commodore" to "1.9",
"bungeecord" to "1.8-SNAPSHOT",
"cloudburst" to "1.0.0-SNAPSHOT",
"adventure-api" to "4.3.0",
"adventure-platform" to "4.0.0-SNAPSHOT",
"paper-api" to "1.15.2-R0.1-SNAPSHOT",
"velocity-api" to "1.1.0",
"jb-annotations" to "20.1.0",
"guava" to "21.0-jre",
// IRC DEPENDENCIES
"pircbotx" to "83a4c22e80",
// TEST DEPENDENCIES
"jupiter-engine" to "5.7.0",
"jhm" to "1.25.2"
)
val vers
get() = versions

View file

@ -0,0 +1,24 @@
import org.gradle.api.Project
import org.gradle.kotlin.dsl.invoke
fun Project.buildGroups(vararg groupNames: String) =
groupNames.forEach(this::buildGroup)
fun Project.buildGroup(groupName: String) {
tasks {
register("build$groupName") {
group = "cloud"
rootProject.subprojects
.filter { it.projectDir.parentFile.name == "cloud-${groupName.toLowerCase()}" }
.map { it.tasks.getByName("build") }
.forEach { dependsOn(it) }
}
register("install$groupName") {
group = "cloud"
rootProject.subprojects
.filter { it.projectDir.parentFile.name == "cloud-${groupName.toLowerCase()}" }
.map { it.tasks.getByName("publishToMavenLocal") }
.forEach { dependsOn(it) }
}
}
}

View file

@ -1,3 +0,0 @@
dependencies {
implementation project(':cloud-core')
}

View file

@ -0,0 +1,3 @@
dependencies {
implementation(project(":cloud-core"))
}

View file

@ -1,5 +0,0 @@
dependencies {
api project(':cloud-services')
testImplementation "org.openjdk.jmh:jmh-core:${vers['jhm']}"
testImplementation "org.openjdk.jmh:jmh-generator-annprocess:${vers['jhm']}"
}

View file

@ -0,0 +1,5 @@
dependencies {
api(project(":cloud-services"))
testImplementation("org.openjdk.jmh", "jmh-core", vers["jhm"])
testImplementation("org.openjdk.jmh", "jmh-generator-annprocess", vers["jhm"])
}

View file

@ -1,4 +0,0 @@
dependencies {
api project(':cloud-core')
implementation "org.javacord:javacord:${vers['javacord']}"
}

View file

@ -0,0 +1,4 @@
dependencies {
api(project(":cloud-core"))
implementation("org.javacord", "javacord", vers["javacord"])
}

View file

@ -1,4 +0,0 @@
dependencies {
api project(':cloud-core')
compileOnly "net.dv8tion:JDA:${vers['jda']}"
}

View file

@ -0,0 +1,4 @@
dependencies {
api(project(":cloud-core"))
compileOnly ("net.dv8tion", "JDA", vers["jda"])
}

View file

@ -1,4 +0,0 @@
dependencies {
api project(':cloud-core')
implementation "com.github.pircbotx:pircbotx:${vers['pircbotx']}"
}

View file

@ -0,0 +1,4 @@
dependencies {
api(project(":cloud-core"))
implementation("com.github.pircbotx", "pircbotx", vers["pircbotx"])
}

View file

@ -1,43 +0,0 @@
import org.jetbrains.dokka.gradle.DokkaTask
plugins {
id 'org.jetbrains.kotlin.jvm' version '1.4.21-2'
id 'org.jetbrains.dokka' version '1.4.20'
}
kotlin {
explicitApi()
}
compileKotlin {
kotlinOptions {
jvmTarget = "1.8"
}
}
compileTestKotlin {
kotlinOptions {
jvmTarget = "1.8"
}
}
dependencies {
api project(':cloud-core')
testImplementation "org.jetbrains.kotlin:kotlin-test-junit5"
}
javadocJar {
from dokkaHtml
}
tasks.withType(DokkaTask).configureEach {
dokkaSourceSets {
main {
includes.from(layout.projectDirectory.file("src/main/descriptions.md").toString())
externalDocumentationLink {
url.set(new URL("https://javadoc.commandframework.cloud/")) //todo fix KDoc linking to JavaDoc
packageListUrl.set(new URL("https://javadoc.commandframework.cloud/allpackages-index.html"))
}
}
}
}

View file

@ -0,0 +1,37 @@
import org.jetbrains.dokka.gradle.DokkaTask
import java.net.URL
plugins {
kotlin("jvm") version "1.4.21-2"
id("org.jetbrains.dokka") version "1.4.20"
}
tasks {
withType<DokkaTask>().configureEach {
dokkaSourceSets.getByName("main") {
includes.from(layout.projectDirectory.file("src/main/descriptions.md").toString())
externalDocumentationLink {
url.set(URL("https://javadoc.commandframework.cloud/")) //todo fix KDoc linking to JavaDoc
packageListUrl.set(URL("https://javadoc.commandframework.cloud/allpackages-index.html"))
}
}
}
javadocJar {
from(dokkaHtml)
}
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}
}
kotlin {
explicitApi()
}
dependencies {
api(project(":cloud-core"))
testImplementation("org.jetbrains.kotlin", "kotlin-test-junit5")
}

View file

@ -1,5 +0,0 @@
dependencies {
implementation project(':cloud-core')
/* Needs to be provided by the platform */
compileOnly "com.mojang:brigadier:${vers['brigadier']}"
}

View file

@ -0,0 +1,5 @@
dependencies {
implementation(project(":cloud-core"))
/* Needs to be provided by the platform */
compileOnly("com.mojang", "brigadier", vers["brigadier"])
}

View file

@ -1,9 +0,0 @@
dependencies {
api project(':cloud-core')
api project(':cloud-brigadier')
api project(':cloud-tasks')
compileOnly "org.bukkit:bukkit:${vers['bukkit']}"
compileOnly "me.lucko:commodore:${vers['commodore']}"
compileOnly "org.jetbrains:annotations:${vers['jb-annotations']}"
compileOnly "com.google.guava:guava:${vers['guava']}"
}

View file

@ -0,0 +1,9 @@
dependencies {
api(project(":cloud-core"))
api(project(":cloud-brigadier"))
api(project(":cloud-tasks"))
compileOnly("org.bukkit", "bukkit", vers["bukkit"])
compileOnly("me.lucko", "commodore", vers["commodore"])
compileOnly("org.jetbrains", "annotations", vers["jb-annotations"])
compileOnly("com.google.guava", "guava", vers["guava"])
}

View file

@ -1,4 +0,0 @@
dependencies {
api project(':cloud-core')
compileOnly "net.md-5:bungeecord-api:${vers['bungeecord']}"
}

View file

@ -0,0 +1,4 @@
dependencies {
api(project(":cloud-core"))
compileOnly("net.md-5", "bungeecord-api", vers["bungeecord"])
}

View file

@ -1,4 +0,0 @@
dependencies {
api project(':cloud-core')
compileOnly "org.cloudburstmc:cloudburst-server:${vers['cloudburst']}"
}

View file

@ -0,0 +1,4 @@
dependencies {
api(project(":cloud-core"))
compileOnly("org.cloudburstmc", "cloudburst-server", vers["cloudburst"])
}

View file

@ -1,4 +0,0 @@
dependencies {
api project(':cloud-core')
api "net.kyori:adventure-api:${vers['adventure-api']}"
}

View file

@ -0,0 +1,4 @@
dependencies {
api(project(":cloud-core"))
api("net.kyori", "adventure-api", vers["adventure-api"])
}

View file

@ -1,7 +0,0 @@
dependencies {
api project(':cloud-bukkit')
compileOnly "com.destroystokyo.paper:paper-api:${vers['paper-api']}"
compileOnly "com.destroystokyo.paper:paper-mojangapi:${vers['paper-api']}"
compileOnly "org.jetbrains:annotations:${vers['jb-annotations']}"
compileOnly "com.google.guava:guava:${vers['guava']}"
}

View file

@ -0,0 +1,7 @@
dependencies {
api(project(":cloud-bukkit"))
compileOnly("com.destroystokyo.paper", "paper-api", vers["paper-api"])
compileOnly("com.destroystokyo.paper", "paper-mojangapi", vers["paper-api"])
compileOnly("org.jetbrains", "annotations", vers["jb-annotations"])
compileOnly("com.google.guava", "guava", vers["guava"])
}

View file

@ -1,5 +0,0 @@
dependencies {
api project(':cloud-core')
api project(':cloud-brigadier')
compileOnly "com.velocitypowered:velocity-api:${vers['velocity-api']}"
}

View file

@ -0,0 +1,5 @@
dependencies {
api(project(":cloud-core"))
api(project(":cloud-brigadier"))
compileOnly("com.velocitypowered", "velocity-api", vers["velocity-api"])
}

View file

@ -1,23 +0,0 @@
apply plugin: "com.github.johnrengelman.shadow"
def adventureVersion = "4.0.0-SNAPSHOT"
shadowJar {
dependencies {
exclude(dependency("org.bukkit:bukkit:1.8.8-R0.1-SNAPSHOT"))
}
}
build.dependsOn(shadowJar)
dependencies {
/* Cloud */
implementation project(":cloud-paper")
implementation project(":cloud-annotations")
implementation project(":cloud-minecraft-extras")
/* Extras */
implementation "me.lucko:commodore:1.9"
implementation "net.kyori:adventure-platform-bukkit:$adventureVersion"
/* Bukkit */
compileOnly "org.bukkit:bukkit:1.8.8-R0.1-SNAPSHOT"
}

View file

@ -0,0 +1,26 @@
plugins {
id("com.github.johnrengelman.shadow")
}
tasks {
shadowJar {
dependencies {
exclude(dependency("org.bukkit:bukkit:1.8.8-R0.1-SNAPSHOT"))
}
}
build {
dependsOn(shadowJar)
}
}
dependencies {
/* Cloud */
implementation(project(":cloud-paper"))
implementation(project(":cloud-annotations"))
implementation(project(":cloud-minecraft-extras"))
/* Extras */
implementation("me.lucko", "commodore", vers["commodore"])
implementation("net.kyori", "adventure-platform-bukkit", vers["adventure-platform"])
/* Bukkit */
compileOnly("org.bukkit", "bukkit", "1.8.8-R0.1-SNAPSHOT")
}

View file

@ -1,22 +0,0 @@
apply plugin: "com.github.johnrengelman.shadow"
def adventureVersion = "4.0.0-SNAPSHOT"
shadowJar {
dependencies {
exclude(dependency("net.md-5:bungeecord-api:1.8-SNAPSHOT"))
}
}
build.dependsOn(shadowJar)
dependencies {
/* Cloud */
implementation project(":cloud-bungee")
implementation project(":cloud-annotations")
implementation project(":cloud-minecraft-extras")
/* Extras */
implementation "net.kyori:adventure-platform-bungeecord:$adventureVersion"
/* Bungee*/
compileOnly 'net.md-5:bungeecord-api:1.8-SNAPSHOT'
}

View file

@ -0,0 +1,25 @@
plugins {
id ("com.github.johnrengelman.shadow")
}
tasks {
shadowJar {
dependencies {
exclude(dependency("net.md-5:bungeecord-api:1.8-SNAPSHOT"))
}
}
build {
dependsOn(shadowJar)
}
}
dependencies {
/* Cloud */
implementation(project(":cloud-bungee"))
implementation(project(":cloud-annotations"))
implementation(project(":cloud-minecraft-extras"))
/* Extras */
implementation("net.kyori", "adventure-platform-bungeecord", vers["adventure-platform"])
/* Bungee*/
compileOnly("net.md-5", "bungeecord-api", "1.8-SNAPSHOT")
}

View file

@ -1,18 +0,0 @@
apply plugin: "application"
apply plugin: "com.github.johnrengelman.shadow"
application {
mainClassName = "cloud.commandframework.examples.jda.ExampleBot"
}
repositories {
jcenter()
}
dependencies {
implementation project(":cloud-jda")
implementation 'net.dv8tion:JDA:4.2.0_212'
implementation 'org.slf4j:slf4j-simple:1.7.30'
}
build.dependsOn(shadowJar)

View file

@ -0,0 +1,24 @@
plugins {
application
id("com.github.johnrengelman.shadow")
}
application {
mainClass.set("cloud.commandframework.examples.jda.ExampleBot")
}
repositories {
jcenter()
}
dependencies {
implementation(project(":cloud-jda"))
implementation("net.dv8tion:JDA:4.2.0_212")
implementation("org.slf4j:slf4j-simple:1.7.30")
}
tasks {
build {
dependsOn(shadowJar)
}
}

View file

@ -1,17 +0,0 @@
apply plugin: "com.github.johnrengelman.shadow"
shadowJar {
dependencies {
exclude(dependency('com.velocitypowered:velocity-api'))
}
}
build.dependsOn(shadowJar)
dependencies {
api project(':cloud-velocity')
api project(':cloud-minecraft-extras')
api project(':cloud-annotations')
compileOnly('com.velocitypowered:velocity-api:1.1.0')
annotationProcessor('com.velocitypowered:velocity-api:1.1.0')
}

View file

@ -0,0 +1,22 @@
plugins {
id ("com.github.johnrengelman.shadow")
}
tasks {
shadowJar {
dependencies {
exclude(dependency("com.velocitypowered:velocity-api"))
}
}
build {
dependsOn(shadowJar)
}
}
dependencies {
api(project(":cloud-velocity"))
api(project(":cloud-minecraft-extras"))
api(project(":cloud-annotations"))
compileOnly("com.velocitypowered:velocity-api:1.1.0")
annotationProcessor("com.velocitypowered:velocity-api:1.1.0")
}

Binary file not shown.

View file

@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

31
gradlew vendored
View file

@ -82,6 +82,7 @@ esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
@ -129,6 +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
@ -154,19 +156,19 @@ if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
i=`expr $i + 1`
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
0) set -- ;;
1) set -- "$args0" ;;
2) set -- "$args0" "$args1" ;;
3) set -- "$args0" "$args1" "$args2" ;;
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
@ -175,14 +177,9 @@ save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=$(save "$@")
APP_ARGS=`save "$@"`
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi
exec "$JAVACMD" "$@"

25
gradlew.bat vendored
View file

@ -29,6 +29,9 @@ if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@ -37,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.
@ -51,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%
@ -61,28 +64,14 @@ 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
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

View file

@ -1,26 +0,0 @@
ext {
vers = [
'checker-qual' : '3.7.0',
'geantyref' : '1.3.11',
'errorprone' : '2.4.0',
// DISCORD DEPENDENCIES
'javacord' : '3.1.1',
'jda' : '4.2.0_209',
// MINECRAFT DEPENDENCIES
'brigadier' : '1.0.17',
'bukkit' : '1.13.2-R0.1-SNAPSHOT',
'commodore' : '1.9',
'bungeecord' : '1.8-SNAPSHOT',
'cloudburst' : '1.0.0-SNAPSHOT',
'adventure-api' : '4.3.0',
'paper-api' : '1.15.2-R0.1-SNAPSHOT',
'velocity-api' : '1.1.0',
'jb-annotations': '20.1.0',
'guava' : '30.0-jre',
// IRC DEPENDENCIES
'pircbotx' : '83a4c22e80',
// TEST DEPENDENCIES
'jupiter-engine': '5.7.0',
'jhm' : '1.25.2'
]
}

View file

@ -1,50 +0,0 @@
rootProject.name = 'cloud'
//
// Core Modules
//
include(':cloud-annotations')
include(':cloud-core')
include(':cloud-services')
include(':cloud-tasks')
// Kotlin
include(':cloud-kotlin-extensions')
//
//Discord Modules
//
include(':cloud-javacord')
project(':cloud-javacord').projectDir = file('cloud-discord/cloud-javacord')
include(':cloud-jda')
project(':cloud-jda').projectDir = file('cloud-discord/cloud-jda')
//
// Minecraft Modules
//
include(':cloud-brigadier')
project(':cloud-brigadier').projectDir = file('cloud-minecraft/cloud-brigadier')
include(':cloud-bukkit')
project(':cloud-bukkit').projectDir = file('cloud-minecraft/cloud-bukkit')
include(':cloud-bungee')
project(':cloud-bungee').projectDir = file('cloud-minecraft/cloud-bungee')
include(':cloud-cloudburst')
project(':cloud-cloudburst').projectDir = file('cloud-minecraft/cloud-cloudburst')
include(':cloud-minecraft-extras')
project(':cloud-minecraft-extras').projectDir = file('cloud-minecraft/cloud-minecraft-extras')
include(':cloud-paper')
project(':cloud-paper').projectDir = file('cloud-minecraft/cloud-paper')
include(':cloud-sponge')
project(':cloud-sponge').projectDir = file('cloud-minecraft/cloud-sponge')
include(':cloud-velocity')
project(':cloud-velocity').projectDir = file('cloud-minecraft/cloud-velocity')
// IRC Modules
include(':cloud-pircbotx')
project(':cloud-pircbotx').projectDir = file('cloud-irc/cloud-pircbotx')
//
// Example Modules
//
include(':example-bukkit')
project(':example-bukkit').projectDir = file('examples/example-bukkit')
include(':example-bungee')
project(':example-bungee').projectDir = file('examples/example-bungee')
include(':example-jda')
project(':example-jda').projectDir = file('examples/example-jda')
include(':example-velocity')
project(':example-velocity').projectDir = file('examples/example-velocity')

54
settings.gradle.kts Normal file
View file

@ -0,0 +1,54 @@
rootProject.name = "cloud"
// Core Modules
include(":cloud-core")
include(":cloud-services")
include(":cloud-tasks")
include(":cloud-annotations")
// Extension Modules
include(":cloud-kotlin-extensions")
// Discord Modules
setupDiscordModule("cloud-javacord")
setupDiscordModule("cloud-jda")
// Minecraft Modules
setupMinecraftModule("cloud-brigadier")
setupMinecraftModule("cloud-bukkit")
setupMinecraftModule("cloud-paper")
setupMinecraftModule("cloud-velocity")
setupMinecraftModule("cloud-sponge")
setupMinecraftModule("cloud-bungee")
setupMinecraftModule("cloud-cloudburst")
setupMinecraftModule("cloud-minecraft-extras")
// IRC Modules
setupIrcModule("cloud-pircbotx")
// Example Modules
setupExampleModule("example-bukkit")
setupExampleModule("example-bungee")
setupExampleModule("example-jda")
setupExampleModule("example-velocity")
fun setupIrcModule(name: String) =
setupSubproject(name, file("cloud-irc/$name"))
fun setupDiscordModule(name: String) =
setupSubproject(name, file("cloud-discord/$name"))
fun setupMinecraftModule(name: String) =
setupSubproject(name, file("cloud-minecraft/$name"))
fun setupExampleModule(name: String) =
setupSubproject(name, file("examples/$name"))
fun setupSubproject(name: String, projectDirectory: File) = setupSubproject(name) {
projectDir = projectDirectory
}
inline fun setupSubproject(name: String, block: ProjectDescriptor.() -> Unit) {
include(name)
project(":$name").apply(block)
}