mcMMO/build.gradle.kts
Gabriel Harris-Rouquette 196ace4b81
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>
2019-02-07 19:58:53 -08:00

75 lines
2.0 KiB
Plaintext

import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
buildscript {
repositories {
jcenter()
}
}
// Extras
var core by extra { project("core") }
// Bukkit/Spigot plugins
val bukkit by extra { project("bukkit") }
val bukkit_18 by extra { bukkit.project("1_8_8") }
val bukkit_112 by extra { bukkit.project("1_12") }
val bukkit_113 by extra { bukkit.project("1_13") }
// Sponge plugins
val sponge by extra { project("sponge") }
val sponge_7 by extra { sponge.project("api7") }
group = properties["pluginGroup"]!!
version = properties["pluginVersion"]!!
plugins {
`java-library`
java
id("com.github.johnrengelman.shadow") version "4.0.4"
}
// Set up defaults for all projects, maven repositories, java compatibility level and compiling encoding
allprojects {
apply(plugin="java-library")
apply(plugin="com.github.johnrengelman.shadow")
repositories {
mavenCentral()
// World Edit
maven("https://maven.sk89q.com/repo")
// bStats
maven("https://repo.codemc.org/repository/maven-public")
}
dependencies {
compile("org.apache.tomcat", "tomcat-jdbc", "7.0.52") // tomcat JDBC
compile("org.apache.tomcat", "tomcat-juli", "7.0.52") // tomcat juli
testCompile("junit", "junit", "4.12")
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
tasks.getting(JavaCompile::class) {
options.encoding = "UTF-8"
}
}
val jar by tasks.getting(Jar::class) {
manifest {
attributes(mapOf(
"Implementation-Title" to "mcMMO",
"Implementation-Version" to rootProject.properties["pluginVersion"]!!,
"Main-Class" to "com.gmail.nossr50.mcMMO" // Main plugin class for bukkit
))
}
}
val shadowJar by tasks.getting(ShadowJar::class) {
dependencies {
include(project("core"))
include(dependency("org.bstats:bstats-bukkit:1.4"))
}
relocate("org.bstats", "com.gmail.nossr50.metrics.bstat")
}