Split up dependencies for multiple version support.

The "core" module will house the entire abstraction layer of mcMMO, while
the "bukkit" and "sponge" modules will house common code to share between
the various versions being supported for each platform. Specifically,
spigot will be split up based on the listener handlers being registered,
and will be shadow packaged according to their targeted Minecraft version.
Sponge's multi-version dependency will be based on the API version, since
the only constant known between the various API versions is the plugin
annotations and basic listener annotations.

Signed-off-by: Gabriel Harris-Rouquette <gabizou@me.com>
This commit is contained in:
Gabriel Harris-Rouquette
2019-02-07 19:55:52 -08:00
parent b14871d499
commit 196ace4b81
10 changed files with 142 additions and 83 deletions

View File

@ -0,0 +1,12 @@
plugins {
java
// Apply the spongegradle plugin to generate the metadata file
id("org.spongepowered.plugin") version "0.9.0" // supplies sponge repo and plugin metadata creation tasks
}
dependencies {
compile("org.spongepowered", "spongeapi", "7.1.0") // SpongeAPI
compile("org.bstats", "bstats-sponge", "1.4") // Sponge bstats
}
description = "mcMMO for Sponge"

View File

@ -1,30 +1,32 @@
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
plugins {
java
id("org.spongepowered.plugin") version "0.9.0" // supplies sponge repo and plugin metadata creation tasks
id("com.github.johnrengelman.shadow")
}
dependencies {
compile("org.spongepowered", "spongeapi", "7.1.0") // SpongeAPI
compile(project(":core"))
compile("org.bstats", "bstats-sponge", "1.4") // Sponge bstats
}
val core: Project by rootProject.extra
val sponge: Project by rootProject.extra
description = "mcMMO for Sponge"
val jar by tasks.getting(Jar::class) {
manifest {
attributes(mapOf(
"Implementation-Title" to "mcMMO",
"Implementation-Version" to rootProject.properties["pluginVersion"]!!
))
repositories {
// sponge
maven("https://repo.spongepowered.org/maven")
}
dependencies {
implementation(group="org.spongepowered", name="spongeapi", version="7.1.0") // Base version
}
allprojects {
dependencies {
compile(core)
}
}
val shadowJar by tasks.getting(ShadowJar::class) {
subprojects {
dependencies {
include(project(":core"))
(compile(sponge) as ModuleDependency).apply {
exclude("org.spongepowered")
}
}
}
}