Commit 4022c44d authored by Eric Bruneton's avatar Eric Bruneton

Fix bug when src/test/resources dir does not exist.

parent 23f751e1
......@@ -245,27 +245,29 @@ configure(subprojects.findAll { it.provides }) {
// Create one backward compatibility checking task for each 'sigtest-*' file
// in test/resources, and make the 'test' task depend on all these tasks.
configurations { sigtest }
dependencies { sigtest 'org.netbeans.tools:sigtest-maven-plugin:1.0' }
file('src/test/resources/').eachFileMatch(~/sigtest-.*/) { f ->
task "${f.name}" (type: JavaExec, dependsOn: 'classes') {
inputs.file(f)
outputs.file("build/${f.name}")
classpath configurations.sigtest
main 'com.sun.tdk.signaturetest.Main'
args 'Test', '-ApiVersion', version, '-Backward', '-Static', '-Mode',
'bin', '-Classpath', sourceSets.main.output.classesDirs.asPath,
'-FileName', f, '-Out', outputs.getFiles()[0], '-Package'
args provides
// The exit value is not 0 in case of success, but 95...
ignoreExitValue true
doLast {
if (!outputs.getFiles()[0].readLines().find { it =~ /STATUS:Passed/ }) {
throw new GradleException('Sigtest FAILED')
if (file('src/test/resources/').exists()) {
configurations { sigtest }
dependencies { sigtest 'org.netbeans.tools:sigtest-maven-plugin:1.0' }
file('src/test/resources/').eachFileMatch(~/sigtest-.*/) { f ->
task "${f.name}" (type: JavaExec, dependsOn: 'classes') {
inputs.file(f)
outputs.file("build/${f.name}")
classpath configurations.sigtest
main 'com.sun.tdk.signaturetest.Main'
args 'Test', '-ApiVersion', version, '-Backward', '-Static', '-Mode',
'bin', '-Classpath', sourceSets.main.output.classesDirs.asPath,
'-FileName', f, '-Out', outputs.getFiles()[0], '-Package'
args provides
// The exit value is not 0 in case of success, but 95...
ignoreExitValue true
doLast {
if (!outputs.getFiles()[0].readLines().find {it =~ /STATUS:Passed/}) {
throw new GradleException('Sigtest FAILED')
}
}
}
test.dependsOn f.name
}
test.dependsOn f.name
}
// Apply the biz.aQute.bnd plugin to package the project as an OSGi bundle,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment