2020-11-17 15:42:37 +01:00
|
|
|
plugins {
|
|
|
|
id 'java-library'
|
2020-12-22 02:41:37 +01:00
|
|
|
id 'com.github.johnrengelman.shadow' version '5.2.0'
|
2020-11-17 15:42:37 +01:00
|
|
|
id 'maven-publish'
|
|
|
|
id 'java'
|
|
|
|
}
|
|
|
|
|
2020-12-22 02:41:37 +01:00
|
|
|
dependencies {
|
|
|
|
implementation getSubprojects()
|
|
|
|
}
|
|
|
|
|
2020-11-17 15:42:37 +01:00
|
|
|
allprojects {
|
2020-11-19 09:44:26 +01:00
|
|
|
apply plugin: 'java'
|
2020-12-13 19:09:28 +01:00
|
|
|
apply plugin: 'maven-publish'
|
2020-12-22 02:41:37 +01:00
|
|
|
apply plugin: 'com.github.johnrengelman.shadow'
|
|
|
|
|
2020-11-17 15:42:37 +01:00
|
|
|
repositories {
|
|
|
|
mavenCentral()
|
|
|
|
jcenter()
|
2020-12-12 13:24:39 +01:00
|
|
|
mavenLocal()
|
2020-12-22 02:41:37 +01:00
|
|
|
maven { url 'https://jitpack.io' }
|
2020-12-12 13:09:53 +01:00
|
|
|
maven { url 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/' }
|
2020-12-12 20:06:44 +01:00
|
|
|
maven { url 'https://repo.codemc.org/repository/nms/' }
|
2020-12-22 02:41:37 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
compileOnly 'org.jetbrains:annotations:19.0.0'
|
2020-11-17 15:42:37 +01:00
|
|
|
}
|
2020-11-17 16:22:15 +01:00
|
|
|
|
|
|
|
tasks.withType(JavaCompile) {
|
2020-11-17 16:33:44 +01:00
|
|
|
options.deprecation = true
|
2020-11-17 16:22:15 +01:00
|
|
|
options.encoding = 'UTF-8'
|
|
|
|
}
|
2020-12-22 02:41:37 +01:00
|
|
|
|
|
|
|
tasks.withType(Jar) {
|
|
|
|
destinationDirectory = file("$rootDir/bin/")
|
|
|
|
}
|
|
|
|
|
|
|
|
processResources {
|
|
|
|
filesNotMatching(["**/*.png", "**/models/**", "**/textures/**"]) {
|
|
|
|
expand projectVersion: findProperty("version")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-11-17 16:22:15 +01:00
|
|
|
compileJava.options.encoding = 'UTF-8'
|
2020-11-21 13:02:35 +01:00
|
|
|
compileJava.dependsOn clean
|
2020-11-17 15:42:37 +01:00
|
|
|
}
|
|
|
|
|
2020-11-20 13:50:33 +01:00
|
|
|
clean.doLast {
|
|
|
|
file("${rootDir}/bin").deleteDir()
|
|
|
|
}
|
|
|
|
|
2020-12-22 02:41:37 +01:00
|
|
|
shadowJar {
|
2020-12-22 03:32:28 +01:00
|
|
|
relocate('org.bstats.bukkit', 'com.willfp.eco.core.util.shaded.bstats')
|
|
|
|
relocate('org.apache.maven', 'com.willfp.eco.core.util.shaded.maven')
|
2020-12-22 02:41:37 +01:00
|
|
|
archiveFileName = findProperty("plugin-name") + " v" + findProperty("version") + ".jar"
|
|
|
|
}
|
|
|
|
|
|
|
|
jar {
|
|
|
|
archiveFileName = findProperty("plugin-name") + " v" + findProperty("version") + " " + "unshaded" + ".jar"
|
|
|
|
}
|
|
|
|
|
|
|
|
group = 'com.willfp'
|
2020-11-17 15:42:37 +01:00
|
|
|
archivesBaseName = project.name
|
|
|
|
version = project.version
|
|
|
|
java.sourceCompatibility = JavaVersion.VERSION_1_8
|
|
|
|
|
2020-12-22 02:41:37 +01:00
|
|
|
compileJava.options.encoding = 'UTF-8'
|
|
|
|
|
|
|
|
build.dependsOn shadowJar
|
|
|
|
|
2020-11-17 15:42:37 +01:00
|
|
|
publishing {
|
|
|
|
publications {
|
|
|
|
maven(MavenPublication) {
|
|
|
|
from(components.java)
|
|
|
|
}
|
|
|
|
}
|
2020-11-17 16:22:15 +01:00
|
|
|
}
|