2019-02-16 21:35:54 -08:00
|
|
|
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
2019-02-16 18:39:44 -08:00
|
|
|
import Config.Libs.Sponge as Sponge
|
2019-02-17 23:32:17 -08: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-16 18:39:44 -08:00
|
|
|
|
2019-02-07 16:09:35 -08:00
|
|
|
plugins {
|
2019-02-17 23:32:17 -08: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-07 16:09:35 -08:00
|
|
|
}
|
|
|
|
|
2019-02-16 18:39:44 -08:00
|
|
|
val core = Projects.core!! // because it's a var and potentially null by declaration
|
|
|
|
val sponge = Projects.sponge!! // because it's a var and potentially null by declaration
|
2019-02-07 16:09:35 -08:00
|
|
|
|
|
|
|
description = "mcMMO for Sponge"
|
|
|
|
|
2019-02-17 23:32:17 -08:00
|
|
|
/*
|
|
|
|
These dependencies are minimalized. SpongeAPI is not inherited by subprojects.
|
|
|
|
Bstats-sponge is api version agnostic for the moment.
|
|
|
|
*/
|
2019-02-07 19:55:52 -08:00
|
|
|
dependencies {
|
2019-02-16 18:39:44 -08:00
|
|
|
compile(Sponge.bstats) // Bstats is used for all sponge versions
|
2019-02-17 23:32:17 -08:00
|
|
|
compileOnly(Sponge.API7.api) // Base version for common plugin class
|
2019-02-07 19:55:52 -08:00
|
|
|
}
|
|
|
|
|
2019-02-17 23:32:17 -08:00
|
|
|
/* This configures ":sponge" and it's dependent projects:
|
|
|
|
- ":sponge:api7"
|
|
|
|
Basically sets up all projects to depend on ":core" and
|
|
|
|
bstats-sponge. Bstatss-sponge should not be relocated
|
|
|
|
*/
|
2019-02-07 19:55:52 -08:00
|
|
|
allprojects {
|
|
|
|
dependencies {
|
2019-02-16 18:39:44 -08:00
|
|
|
compile(Projects.core!!)
|
2019-02-07 16:09:35 -08:00
|
|
|
}
|
2019-02-16 21:35:54 -08:00
|
|
|
// TODO dunno if this works yet... project needs to compile.
|
2019-02-17 23:32:17 -08:00
|
|
|
val shadowJar by tasks.getting(ShadowJar::class) { // We set this up so we relocate all sponge projects, not just ":sponge"
|
2019-02-16 21:35:54 -08:00
|
|
|
relocate(Deps.Groups.nossr, "${Deps.Groups.nossr}.sponge") {
|
|
|
|
exclude("${Deps.Groups.nossr}.core")
|
|
|
|
}
|
|
|
|
}
|
2019-02-07 17:10:08 -08:00
|
|
|
}
|
|
|
|
|
2019-02-17 23:32:17 -08:00
|
|
|
// Tells all subprojects of ":sponge" (":sponge:api7")
|
|
|
|
// to depend on this project (":sponge") to inherit the dependencies, and
|
|
|
|
// does NOT inherit the same configurations (anything configured outside
|
|
|
|
// here does not persist to child projects).
|
2019-02-07 19:55:52 -08:00
|
|
|
subprojects {
|
2019-02-07 17:10:08 -08:00
|
|
|
dependencies {
|
2019-02-16 18:39:44 -08:00
|
|
|
(compileOnly(sponge) as ModuleDependency).apply {
|
|
|
|
exclude(Sponge.Exclude.group, Sponge.Exclude.module)
|
2019-02-07 19:55:52 -08:00
|
|
|
}
|
2019-02-07 17:10:08 -08:00
|
|
|
}
|
2019-02-07 19:55:52 -08:00
|
|
|
}
|
|
|
|
|