2019-02-16 18:39:44 -08:00
|
|
|
import com.github.jengelman.gradle.plugins.shadow.tasks.ConfigureShadowRelocation
|
2019-02-07 19:55:52 -08:00
|
|
|
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
|
|
|
|
2019-02-07 16:09:35 -08:00
|
|
|
buildscript {
|
2019-02-07 19:55:52 -08:00
|
|
|
repositories {
|
|
|
|
jcenter()
|
2019-02-16 18:39:44 -08:00
|
|
|
maven("https://files.minecraftforge.net/maven/")
|
|
|
|
}
|
|
|
|
dependencies {
|
|
|
|
classpath("net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT")
|
2019-02-07 16:09:35 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-02-16 18:39:44 -08:00
|
|
|
// Things used by other projects
|
|
|
|
Projects.core = project("core")
|
|
|
|
Projects.bukkit = project("bukkit")
|
|
|
|
Projects.sponge = project("sponge")
|
|
|
|
var core: Project by extra { project("core") }
|
2019-02-07 19:55:52 -08:00
|
|
|
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") }
|
|
|
|
val sponge by extra { project("sponge") }
|
|
|
|
val sponge_7 by extra { sponge.project("api7") }
|
|
|
|
|
2019-02-16 18:39:44 -08:00
|
|
|
val configurate by extra { ""}
|
2019-02-07 19:55:52 -08:00
|
|
|
|
2019-02-07 16:09:35 -08:00
|
|
|
group = properties["pluginGroup"]!!
|
|
|
|
version = properties["pluginVersion"]!!
|
|
|
|
|
|
|
|
plugins {
|
|
|
|
`java-library`
|
2019-02-16 18:39:44 -08:00
|
|
|
`maven-publish`
|
2019-02-07 19:55:52 -08:00
|
|
|
id("com.github.johnrengelman.shadow") version "4.0.4"
|
2019-02-07 16:09:35 -08:00
|
|
|
}
|
|
|
|
|
2019-02-16 18:39:44 -08:00
|
|
|
configurations {
|
|
|
|
create("childJars")
|
|
|
|
}
|
|
|
|
val childJars: Configuration by configurations
|
|
|
|
|
|
|
|
|
2019-02-07 17:10:08 -08:00
|
|
|
// Set up defaults for all projects, maven repositories, java compatibility level and compiling encoding
|
2019-02-07 16:09:35 -08:00
|
|
|
allprojects {
|
|
|
|
apply(plugin="java-library")
|
2019-02-07 19:55:52 -08:00
|
|
|
apply(plugin="com.github.johnrengelman.shadow")
|
2019-02-07 16:09:35 -08:00
|
|
|
|
|
|
|
repositories {
|
|
|
|
mavenCentral()
|
|
|
|
// World Edit
|
2019-02-16 18:39:44 -08:00
|
|
|
maven(Repos.sk89q)
|
2019-02-07 16:09:35 -08:00
|
|
|
// bStats
|
2019-02-16 18:39:44 -08:00
|
|
|
maven(Repos.bstats)
|
|
|
|
// configurate
|
|
|
|
maven(Repos.sponge)
|
|
|
|
// spigot
|
|
|
|
maven(Repos.spigot)
|
|
|
|
maven(Repos.sonatype)
|
|
|
|
mavenLocal()
|
2019-02-07 16:09:35 -08:00
|
|
|
}
|
2019-02-07 19:55:52 -08:00
|
|
|
|
2019-02-07 16:09:35 -08:00
|
|
|
java {
|
|
|
|
sourceCompatibility = JavaVersion.VERSION_1_8
|
|
|
|
targetCompatibility = JavaVersion.VERSION_1_8
|
|
|
|
}
|
2019-02-07 17:10:08 -08:00
|
|
|
tasks.getting(JavaCompile::class) {
|
|
|
|
options.encoding = "UTF-8"
|
|
|
|
}
|
2019-02-16 18:39:44 -08:00
|
|
|
val shadowJar by tasks.getting(ShadowJar::class) { // Configure basics of relocation
|
|
|
|
relocate(Shadow.Origin.juli, Shadow.Target.juli)
|
|
|
|
relocate(Shadow.Origin.tomcat, Shadow.Target.tomcat)
|
|
|
|
exclude(Shadow.Exclude.ForgeGradle.dummyThing)
|
|
|
|
exclude(Shadow.Exclude.ForgeGradle.template)
|
|
|
|
}
|
|
|
|
|
2019-02-07 19:55:52 -08:00
|
|
|
}
|
|
|
|
|
2019-02-16 18:39:44 -08:00
|
|
|
// Sub projects don't need to shadow their dependencies. This eliminates common ones
|
|
|
|
subprojects {
|
|
|
|
val shadowJar by tasks.getting(ShadowJar::class) {
|
|
|
|
dependencies {
|
|
|
|
exclude(dependency("${Deps.Groups.sponge}:${Deps.Modules.configurate_yaml}"))
|
|
|
|
exclude(dependency(Shadow.Exclude.guava))
|
|
|
|
exclude(dependency(Shadow.Exclude.snakeyaml))
|
|
|
|
exclude(dependency(Shadow.Exclude.tomcat))
|
|
|
|
exclude(dependency(Shadow.Exclude.juli))
|
|
|
|
}
|
2019-02-07 19:55:52 -08:00
|
|
|
}
|
|
|
|
}
|
2019-02-07 17:10:08 -08:00
|
|
|
|
2019-02-16 18:39:44 -08:00
|
|
|
dependencies {
|
|
|
|
compile(bukkit)
|
|
|
|
compile(sponge)
|
|
|
|
compile(bukkit_18)
|
|
|
|
compile(bukkit_112)
|
|
|
|
compile(bukkit_113)
|
|
|
|
compile(sponge_7)
|
|
|
|
}
|
|
|
|
val shadowJar by tasks.getting(ShadowJar::class) { // Root shadow relocation
|
|
|
|
|
|
|
|
relocate(Shadow.Origin.bstatsBukkit, Shadow.Target.bstatsBukkit)
|
|
|
|
|
|
|
|
baseName = "mcMMO"
|
|
|
|
classifier = "bundle"
|
2019-02-07 16:09:35 -08:00
|
|
|
}
|
2019-02-16 18:39:44 -08:00
|
|
|
val build by tasks
|
|
|
|
build.dependsOn(shadowJar)
|