bukman/build.gradle
Frank van der Heijden 64c37d567d
v2.5.4
2021-05-19 23:56:13 +02:00

89 lines
2.4 KiB
Groovy

plugins {
id 'java'
id 'com.github.johnrengelman.shadow' version '6.1.0'
}
group = 'net.frankheijden.serverutils'
String dependencyDir = group + '.dependencies'
version = '2.5.4'
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_1_8
subprojects {
apply plugin: 'java'
apply plugin: 'checkstyle'
apply plugin: 'com.github.johnrengelman.shadow'
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_1_8
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
maven { url 'https://repo.aikar.co/content/groups/aikar/' }
maven { url 'https://papermc.io/repo/repository/maven-public/' }
}
dependencies {
implementation 'com.github.FrankHeijden:MinecraftReflection:1.0.0'
testCompile 'org.assertj:assertj-core:3.18.1'
testCompile 'org.junit.jupiter:junit-jupiter-api:5.7.0'
testCompile 'org.junit.jupiter:junit-jupiter-params:5.7.0'
testCompile 'org.junit.jupiter:junit-jupiter-engine:5.7.0'
}
compileJava {
options.compilerArgs += ["-parameters"]
options.fork = true
options.forkOptions.executable = 'javac'
}
test {
useJUnitPlatform()
}
checkstyle {
toolVersion "8.38"
configFile = file("${rootDir}/config/checkstyle/checkstyle.xml")
ignoreFailures = false
maxErrors = 0
maxWarnings = 0
}
shadowJar.dependsOn checkstyleMain, checkstyleTest, test
}
repositories {
mavenCentral()
}
dependencies {
implementation project(path: ':Common', configuration: 'shadow')
implementation project(path: ':Bukkit', configuration: 'shadow')
implementation project(path: ':Bungee', configuration: 'shadow')
}
shadowJar {
relocate 'org.apache.commons.codec', dependencyDir + '.codec'
relocate 'dev.frankheijden.minecraftreflection', dependencyDir + '.minecraftreflection'
archiveFileName = "${archiveBaseName.orNull}-${archiveVersion.orNull}.${archiveExtension.orNull}"
}
def outputTasks() {
["shadowJar", ":Bukkit:shadowJar", ":Bungee:shadowJar"].stream().map({ tasks.findByPath(it) })
}
task copyJars(type: Copy) {
outputTasks().forEach({ from(it) })
rename '(.*)-all.jar', '$1.jar'
into file('jars')
}
task cleanJars() {
delete file('jars')
}
clean.dependsOn cleanJars
build.dependsOn shadowJar
build.dependsOn copyJars