Start documenting some of the bradle scripts.

Signed-off-by: Gabriel Harris-Rouquette <gabizou@me.com>
This commit is contained in:
Gabriel Harris-Rouquette
2019-02-17 23:32:17 -08:00
parent 925ef21a8e
commit 5dcdacee07
10 changed files with 224 additions and 75 deletions

View File

@ -1,12 +1,27 @@
import Config.Libs.Bukkit.`1_12` as Bukkit
// Config is located in <root>/buildSrc/src/main/java/Config.kt
// It provides a bunch of constant values we use as dependency
// strings, so we don't have to duplicate a bunch of them in
// various scripts.
plugins {
java
java // This is already provided, but for static compilation,
// we declare it here so we can use the IDE static type references
}
/*
Dependency inheritance is as follows
- ":core", which provides
configurate, tomcat jdbc/juli, and flowmath. It excludes sub
dependencies like guava and apache commons lang.
- ":bukkit", which provides nothing on it's own, except the
core bukkit classes that can be built on 1.13.2 API (which may change).
It also defines all subprojects to depend on ":core", and ":bukkit",
and bstats-bukkit.
*/
dependencies {
compileOnly(Bukkit.api) // Bukkit API
compileOnly(Bukkit.nms)
compileOnly(Bukkit.wgLegacy) // WorldGuard
compileOnly(Bukkit.api) // Bukkit API for 1.12.2
compileOnly(Bukkit.nms) // CraftBukkit for 1.12.2
compileOnly(Bukkit.wgLegacy) // WorldGuard for 1.12.2 bukkit
}

View File

@ -1,12 +1,27 @@
import Config.Libs.Bukkit.`1_13` as Bukkit
// Config is located in <root>/buildSrc/src/main/java/Config.kt
// It provides a bunch of constant values we use as dependency
// strings, so we don't have to duplicate a bunch of them in
// various scripts. The import allows us to "import as" for shorthand
plugins {
`java-library`
`java-library` // This is already provided, but for static compilation,
// we declare it here so we can use the IDE static type references
}
/*
Dependency inheritance is as follows
- ":core", which provides
configurate, tomcat jdbc/juli, and flowmath. It excludes sub
dependencies like guava and apache commons lang.
- ":bukkit", which provides nothing on it's own, except the
core bukkit classes that can be built on 1.13.2 API (which may change).
It also defines all subprojects to depend on ":core", and ":bukkit",
and bstats-bukkit.
*/
dependencies {
compileOnly(Bukkit.api) // Bukkit API
compileOnly(Bukkit.nms)
compileOnly(Bukkit.wgCore) // WorldGuard
compileOnly(Bukkit.wgLegacy) // WG for Bukkit
compileOnly(Bukkit.api) // Bukkit API for 1.13.2 - Defined in <root>/buildSrc/src/main/java/Config.kt
compileOnly(Bukkit.nms) // CraftBukkit-1.13.2-R0.1-SNAPSHOT - Defined in <root>/buildSrc/src/main/java/Config.kt
compileOnly(Bukkit.wgCore) // WorldGuard-core - Defined in <root>/buildSrc/src/main/java/Config.kt
compileOnly(Bukkit.wgLegacy) // WorldGuard-legacy - Defined in <root>/buildSrc/src/main/java/Config.kt
}

View File

@ -4,9 +4,20 @@ plugins {
java
}
/*
Dependency inheritance is as follows
- ":core", which provides
configurate, tomcat jdbc/juli, and flowmath. It excludes sub
dependencies like guava and apache commons lang.
- ":bukkit", which provides nothing on it's own, except the
core bukkit classes that can be built on 1.13.2 API (which may change).
It also defines all subprojects to depend on ":core", and ":bukkit",
and bstats-bukkit.
*/
dependencies {
compileOnly(Bukkit.api) // Spigot API
compileOnly(Bukkit.wgLegacy) // Old worldguard
compileOnly(Bukkit.nms)
compileOnly(Bukkit.api) // Bukkit API for 1.8.8 - Defined in <root>/buildSrc/src/main/java/Config.kt
compileOnly(Bukkit.nms) // CraftBukkit-1.8.8-R0.3-SNAPSHOT - Defined in <root>/buildSrc/src/main/java/Config.kt
compileOnly(Bukkit.wgLegacy) // Old worldguard - Defined in <root>/buildSrc/src/main/java/Config.kt
}

View File

@ -1,9 +1,21 @@
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import Config.Libs.Bukkit as Bukkit
// Config is located in <root>/buildSrc/src/main/java/Config.kt
// It provides a bunch of constant values we use as dependency
// strings, so we don't have to duplicate a bunch of them in
// various scripts. The import as allows for shorthand.
val bukkit: Project = Projects.bukkit!!
val core: Project = Projects.core!!
val bukkit: Project = Projects.bukkit!! // Static project references
val core: Project = Projects.core!! // Stored by Config.kt and created in <root>/build.gradle.kts
/* This configures ":bukkit" and it's dependent projects:
- ":bukkit:1_8_8"
- ":bukkit:1_12"
- ":bukkit:1_13"
Basically sets up all projects to depend on ":core" and
bstats-bukkit. Also sets up shadow to relocate bukkit related
packages to limit platform interference
*/
allprojects {
dependencies {
@ -13,13 +25,20 @@ allprojects {
// TODO dunno if this works yet... project needs to compile.
val shadowJar by tasks.getting(ShadowJar::class) {
// Relocate bstats for bukkit, as per requirement for bstats
relocate(Shadow.Origin.bstatsBukkit, Shadow.Target.bstatsBukkit)
// Relocate the bukkit platform classes of mcmmo so we don't
// interfere with other platform classes (or core)
relocate(Deps.Groups.nossr, "${Deps.Groups.nossr}.bukkit") {
exclude("${Deps.Groups.nossr}.core")
}
}
}
// Tells all subprojects of ":bukkit" (":bukkit:1_8_8", ":bukkit:1_12",etc.)
// to depend on this project (":bukkit") to inherit the dependencies, and
// does NOT inherit the same configurations (anything configured outside
// here does not persist to child projects).
subprojects {
dependencies {
// Provide the base bukkit plugin dependency for plugin classloading.
@ -28,19 +47,20 @@ subprojects {
}
}
plugins {
java
`java-library` // This is already provided, but for static compilation,
// we declare it here so we can use the IDE static type references
}
dependencies {
// Temporary dependencies while things are being moved.
compileOnly(Bukkit.`1_13`.spigotApi) { // Spigot API
isTransitive = true
compileOnly(Bukkit.`1_13`.spigotApi) { // Spigot API for generic usage. Based on 1.13.2
isTransitive = true // We don't want the dependencies
}
compileOnly(Bukkit.`1_13`.api) { // Spigot API
isTransitive = true
compileOnly(Bukkit.`1_13`.api) { // Bukkit API for generic usage. Based on 1.13.2
isTransitive = true // We don't want the dependencies
}
compileOnly(Bukkit.`1_13`.wgCore) {
isTransitive = true
compileOnly(Bukkit.`1_13`.wgCore) { // WorldGuard dependency, again, for 1.13.2
isTransitive = true // We don't want the dependencies
exclude(group = Shadow.Exclude.sk89q)
exclude(group = Shadow.Exclude.intake, module = "intake")
exclude(group = Shadow.Exclude.sk89q, module = "squirrelid")
@ -49,7 +69,7 @@ dependencies {
exclude(group = Shadow.Exclude.findbugs)
}
compileOnly(Bukkit.`1_13`.wgLegacy) {
isTransitive = true
isTransitive = true // We don't want the dependencies
exclude(group = Shadow.Exclude.bukkit)
exclude(group = Shadow.Exclude.sk89q, module = "commandbook")
exclude(group = Shadow.Exclude.bstats)