Commit d3e0975a authored by Eric Bruneton's avatar Eric Bruneton
Browse files

Merge branch 'add-sigtest-task' into 'master'

Add a task to generate a sigtest file for the current version.

See merge request asm/asm!167
parents 779c361a b9cfb329
......@@ -40,6 +40,7 @@ description = 'ASM, a very small and fast Java bytecode manipulation framework'
subprojects {
repositories { mavenCentral() }
apply plugin: 'java'
apply plugin: 'jacoco'
def snapshotSuffix = rootProject.hasProperty('release') ? '' : '-SNAPSHOT'
group = 'org.ow2.asm'
version = '6.1.2' + snapshotSuffix
......@@ -194,7 +195,6 @@ def jacocoClasses(project) {
// and uploaded to Maven with a POM, sources and Javadoc.
configure(subprojects.findAll { it.provides }) {
// Code coverage configuration.
apply plugin: 'jacoco'
jacocoTestReport {
afterEvaluate { classDirectories = jacocoClasses(project) }
}
......@@ -233,16 +233,31 @@ configure(subprojects.findAll { it.provides }) {
File.pathSeparator + 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
ignoreExitValue true // The exit value is 95 in case of success...
doLast {
if (!outputs.getFiles()[0].readLines().find {it =~ /STATUS:Passed/}) {
throw new GradleException('Sigtest FAILED')
}
if (!outputs.getFiles()[0].readLines().find {it =~ /STATUS:Passed/})
throw new GradleException()
}
}
check.dependsOn f.name
}
// Define a task to create a sigtest file for the current version.
task "buildSigtest" (type: JavaExec, dependsOn: 'classes') {
inputs.files(sourceSets.main.java)
outputs.file("src/test/resources/sigtest-${version}")
classpath configurations.sigtest
main 'com.sun.tdk.signaturetest.Main'
args 'Setup', '-ApiVersion', version, '-FileName', outputs.getFiles()[0],
'-Classpath', project(':tools').file('jdk8-api.jar').path +
File.pathSeparator + sourceSets.main.output.classesDirs.asPath +
File.pathSeparator + sourceSets.main.compileClasspath.asPath,
'-Package'
args provides
ignoreExitValue true // The exit value is 95 in case of success...
doLast {
if (!outputs.getFiles()[0].exists()) throw new GradleException()
}
}
}
// Apply the biz.aQute.bnd plugin to package the project as an OSGi bundle,
......
Supports Markdown
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