Fix Gradle warnings about task output

As of Gradle 4.0, project SourceSets can have multiple output
directories (one per programming language).
This commit fixes warnings that are logged when a single output dir
is considered by tasks.

Issue: SPR-15885
This commit is contained in:
Brian Clozel 2017-08-21 14:42:12 +02:00
parent cc3d7d2d48
commit 5460c0095b
3 changed files with 24 additions and 25 deletions

View File

@ -44,7 +44,7 @@ task sniff {
dependsOn compileJava
dependsOn copyJavaApiSignature
inputs.dir sourceSets.main.output.classesDir
sourceSets.main.output.classesDirs.each { inputs.dir it }
inputs.dir copyJavaApiSignature.to
doLast {

View File

@ -18,7 +18,7 @@ compileJava {
actions = []
dependsOn configurations.ajc.getTaskDependencyFromProjectDependency(true, "compileJava")
def outputDir = project.sourceSets.main.output.classesDir
def outputDir = project.sourceSets.main.java.outputDir
inputs.files(project.sourceSets.main.allSource + project.sourceSets.main.compileClasspath)
outputs.dir outputDir
@ -54,7 +54,7 @@ compileTestJava {
dependsOn configurations.ajc.getTaskDependencyFromProjectDependency(true, "compileTestJava")
dependsOn jar
def outputDir = project.sourceSets.test.output.classesDir
def outputDir = project.sourceSets.test.java.outputDir
inputs.files(project.sourceSets.test.allSource + project.sourceSets.test.compileClasspath)
outputs.dir outputDir

View File

@ -95,28 +95,6 @@ task genJaxb {
}
}
// JiBX compiler is currently not compatible with JDK 9
if (JavaVersion.current() == JavaVersion.VERSION_1_8) {
compileTestJava {
def bindingXml = "${projectDir}/src/test/resources/org/springframework/oxm/jibx/binding.xml"
doLast() {
project.ant {
taskdef(name: "jibx",
classname: "org.jibx.binding.ant.CompileTask",
classpath: configurations.jibx.asPath)
jibx(verbose: true, load: true, binding: bindingXml) {
classpathset(dir: sourceSets.test.output.classesDir) {
include(name: "**/jibx/**/*")
}
}
}
}
}
}
dependencies {
compile(project(":spring-beans"))
compile(project(":spring-core"))
@ -142,4 +120,25 @@ dependencies {
testRuntime("xerces:xercesImpl:2.11.0") // for Castor
testRuntime("com.sun.xml.bind:jaxb-core:${jaxbVersion}")
testRuntime("com.sun.xml.bind:jaxb-impl:${jaxbVersion}")
}
// JiBX compiler is currently not compatible with JDK 9
if (JavaVersion.current() == JavaVersion.VERSION_1_8) {
compileTestJava {
def bindingXml = "${projectDir}/src/test/resources/org/springframework/oxm/jibx/binding.xml"
doLast() {
project.ant {
taskdef(name: "jibx",
classname: "org.jibx.binding.ant.CompileTask",
classpath: configurations.jibx.asPath)
jibx(verbose: true, load: true, binding: bindingXml) {
classpathset(dir: sourceSets.test.java.outputDir) {
include(name: "**/jibx/**/*")
}
}
}
}
}
}