import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar import org.gradle.api.internal.HasConvention plugins { id("java-library") id("net.ltgt.apt-eclipse") id("net.ltgt.apt-idea") } applyPlatformAndCoreConfiguration() applyShadowConfiguration() repositories { maven { name = "spigot" url = uri("https://hub.spigotmc.org/nexus/content/groups/public") } maven { name = "paper" url = uri("https://papermc.io/repo/repository/maven-public/") } maven { name = "bstats" url = uri("https://repo.codemc.org/repository/maven-public") } } dependencies { "compile"(project(":worldguard-core")) //"compile"(project(":worldguard-libs:bukkit")) "api"("com.destroystokyo.paper:paper-api:1.14.4-R0.1-SNAPSHOT") "implementation"("io.papermc:paperlib:1.0.2") "api"("com.sk89q.worldedit:worldedit-bukkit:7.0.1-SNAPSHOT") { isTransitive = false } "implementation"("com.sk89q:commandbook:2.3") { isTransitive = false } "implementation"("org.bstats:bstats-bukkit:1.5") } tasks.named("install") { (repositories as HasConvention).convention.getPlugin().mavenInstaller { pom.whenConfigured { dependencies.firstOrNull { dep -> dep!!.withGroovyBuilder { getProperty("groupId") == "com.destroystokyo.paper" && getProperty("artifactId") == "paper-api" } }?.withGroovyBuilder { setProperty("groupId", "org.bukkit") setProperty("artifactId", "bukkit") } } } } tasks.named("processResources") { filesMatching("plugin.yml") { expand("internalVersion" to project.ext["internalVersion"]) } } tasks.named("jar") { manifest { attributes("Implementation-Version" to project.version) } } tasks.named("shadowJar") { dependencies { relocate("org.bstats", "com.sk89q.worldguard.bukkit.bstats") { include(dependency("org.bstats:bstats-bukkit:1.5")) } relocate ("io.papermc.lib", "com.sk89q.worldguard.bukkit.paperlib") { include(dependency("io.papermc:paperlib:1.0.2")) } } } tasks.named("assemble").configure { dependsOn("shadowJar") }