Address review issues

This commit is contained in:
Mariell Hoversholm 2020-10-08 11:49:05 +02:00 committed by Alexander Söderberg
parent c3069a425d
commit d97f68eec0

View File

@ -1,3 +1,4 @@
import com.github.jengelman.gradle.plugins.shadow.ShadowPlugin import com.github.jengelman.gradle.plugins.shadow.ShadowPlugin
import net.minecrell.gradle.licenser.LicenseExtension import net.minecrell.gradle.licenser.LicenseExtension
import net.minecrell.gradle.licenser.Licenser import net.minecrell.gradle.licenser.Licenser
@ -76,10 +77,14 @@ subprojects {
} }
tasks { tasks {
named<Delete>("clean") { // This is to create the target dir under the root project with all jars.
doFirst { val assembleTargetDir = create<Copy>("assembleTargetDirectory") {
delete("../target") destinationDir = rootDir.resolve("target")
into(destinationDir)
from(withType<Jar>())
} }
named("build") {
dependsOn(assembleTargetDir)
} }
} }
} }
@ -106,7 +111,15 @@ allprojects {
withJavadocJar() withJavadocJar()
} }
val javadocDir = rootDir.resolve("docs").resolve("javadoc").resolve(project.name)
tasks { tasks {
named<Delete>("clean") {
doFirst {
delete(rootDir.resolve("target"))
delete(javadocDir)
}
}
compileJava { compileJava {
options.compilerArgs.addAll(arrayOf("-Xmaxerrs", "1000")) options.compilerArgs.addAll(arrayOf("-Xmaxerrs", "1000"))
options.compilerArgs.add("-Xlint:all") options.compilerArgs.add("-Xlint:all")
@ -124,6 +137,7 @@ allprojects {
"implSpec:a:Implementation Requirements:", "implSpec:a:Implementation Requirements:",
"implNote:a:Implementation Note:" "implNote:a:Implementation Note:"
) )
opt.destinationDirectory = javadocDir
} }
shadowJar { shadowJar {