2019-02-17 03:39:44 +01:00
|
|
|
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
|
|
|
import Config.Libs.Bukkit as Bukkit
|
2019-02-18 08:32:17 +01:00
|
|
|
// 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.
|
2019-02-17 03:39:44 +01:00
|
|
|
|
2019-02-18 08:32:17 +01:00
|
|
|
val bukkit: Project = Projects.bukkit!! // Static project references
|
|
|
|
val core: Project = Projects.core!! // Stored by Config.kt and created in <root>/build.gradle.kts
|
2019-02-17 03:39:44 +01:00
|
|
|
|
2019-02-18 08:32:17 +01:00
|
|
|
/* 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
|
|
|
|
*/
|
2019-02-08 04:55:52 +01:00
|
|
|
allprojects {
|
|
|
|
|
2019-02-08 02:10:08 +01:00
|
|
|
dependencies {
|
2019-02-08 04:55:52 +01:00
|
|
|
compile(core) // includes junit for tests
|
2019-02-17 03:39:44 +01:00
|
|
|
implementation(Bukkit.bstats) // Bukkit bstats
|
|
|
|
}
|
|
|
|
|
2019-02-17 06:35:54 +01:00
|
|
|
// TODO dunno if this works yet... project needs to compile.
|
2019-02-17 03:39:44 +01:00
|
|
|
val shadowJar by tasks.getting(ShadowJar::class) {
|
2019-02-18 08:32:17 +01:00
|
|
|
// Relocate bstats for bukkit, as per requirement for bstats
|
2019-02-17 03:39:44 +01:00
|
|
|
relocate(Shadow.Origin.bstatsBukkit, Shadow.Target.bstatsBukkit)
|
2019-02-18 08:32:17 +01:00
|
|
|
// Relocate the bukkit platform classes of mcmmo so we don't
|
|
|
|
// interfere with other platform classes (or core)
|
2019-02-17 06:35:54 +01:00
|
|
|
relocate(Deps.Groups.nossr, "${Deps.Groups.nossr}.bukkit") {
|
|
|
|
exclude("${Deps.Groups.nossr}.core")
|
|
|
|
}
|
2019-02-08 02:10:08 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-02-18 08:32:17 +01:00
|
|
|
// 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).
|
2019-02-08 04:55:52 +01:00
|
|
|
subprojects {
|
|
|
|
dependencies {
|
|
|
|
// Provide the base bukkit plugin dependency for plugin classloading.
|
|
|
|
// All "versioned" implementations will be properly classloaded by the bukkit parent
|
2019-02-17 03:39:44 +01:00
|
|
|
compileOnly(bukkit)
|
2019-02-08 04:55:52 +01:00
|
|
|
}
|
2019-02-08 01:09:35 +01:00
|
|
|
}
|
|
|
|
plugins {
|
2019-02-18 08:32:17 +01:00
|
|
|
`java-library` // This is already provided, but for static compilation,
|
|
|
|
// we declare it here so we can use the IDE static type references
|
2019-02-08 01:09:35 +01:00
|
|
|
}
|
|
|
|
dependencies {
|
2019-02-17 03:39:44 +01:00
|
|
|
// Temporary dependencies while things are being moved.
|
2019-02-18 08:32:17 +01:00
|
|
|
compileOnly(Bukkit.`1_13`.spigotApi) { // Spigot API for generic usage. Based on 1.13.2
|
|
|
|
isTransitive = true // We don't want the dependencies
|
2019-02-17 03:39:44 +01:00
|
|
|
}
|
2019-02-18 08:32:17 +01:00
|
|
|
compileOnly(Bukkit.`1_13`.api) { // Bukkit API for generic usage. Based on 1.13.2
|
|
|
|
isTransitive = true // We don't want the dependencies
|
2019-02-17 03:39:44 +01:00
|
|
|
|
|
|
|
}
|
2019-02-18 08:32:17 +01:00
|
|
|
compileOnly(Bukkit.`1_13`.wgCore) { // WorldGuard dependency, again, for 1.13.2
|
|
|
|
isTransitive = true // We don't want the dependencies
|
2019-02-17 03:39:44 +01:00
|
|
|
exclude(group = Shadow.Exclude.sk89q)
|
|
|
|
exclude(group = Shadow.Exclude.intake, module = "intake")
|
|
|
|
exclude(group = Shadow.Exclude.sk89q, module = "squirrelid")
|
|
|
|
exclude(group = Shadow.Exclude.flyway)
|
|
|
|
exclude(group = Shadow.Exclude.khelekore)
|
|
|
|
exclude(group = Shadow.Exclude.findbugs)
|
|
|
|
}
|
|
|
|
compileOnly(Bukkit.`1_13`.wgLegacy) {
|
2019-02-18 08:32:17 +01:00
|
|
|
isTransitive = true // We don't want the dependencies
|
2019-02-17 03:39:44 +01:00
|
|
|
exclude(group = Shadow.Exclude.bukkit)
|
|
|
|
exclude(group = Shadow.Exclude.sk89q, module = "commandbook")
|
|
|
|
exclude(group = Shadow.Exclude.bstats)
|
|
|
|
}
|
2019-02-08 01:09:35 +01:00
|
|
|
}
|