Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

several updates, 1 breaking the implicit call. #3

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions emmaPlugin/emma.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@ class EmmaPluginConvention{
}

EmmaPluginConvention(Project project){
reportPath = "${project.reportsDir.absolutePath}/emma"
reportPath = "${project.reporting.baseDir.absolutePath}/emma"
coverageFileName = "coverage"
tmpDir = "${project.buildDir}/tmp/emma"
instrDir = "${tmpDir}/instr"
tmpDir = "${project.buildDir}/tmp/emma"
instrDir = "${tmpDir}/instr"
metaDataFilePath = "${tmpDir}/metadata.emma"
}
}

test {
task emma(type: Test) {
// add EMMA related JVM args to our tests
jvmArgs "-XX:-UseSplitVerifier", "-Demma.coverage.out.file=$buildDir/tmp/emma/metadata.emma", "-Demma.coverage.out.merge=true"
jvmArgs "-XX:-UseSplitVerifier", "-Demma.coverage.out.file=$metaDataFilePath", "-Demma.coverage.out.merge=true"

doFirst {
println "Instrumenting the classes at " + sourceSets.main.output.classesDir.absolutePath
Expand All @@ -46,7 +46,7 @@ test {
ant.path(id:"run.classpath") {
pathelement(location:sourceSets.main.output.classesDir.absolutePath)
}
def emmaInstDir = new File(sourceSets.main.output.classesDir.parentFile.parentFile, "tmp/emma/instr")
def emmaInstDir = new File(instrDir)
emmaInstDir.mkdirs()
println "Creating $emmaInstDir to instrument from " + sourceSets.main.output.classesDir.absolutePath
// instruct our compiled classes and store them at $buildDir/tmp/emma/instr
Expand All @@ -58,30 +58,30 @@ test {
}
}
}
setClasspath(files("$buildDir/tmp/emma/instr") + configurations.emma + getClasspath())
setClasspath(files(instrDir) + configurations.emma + getClasspath())
}

// The report should be generated directly after the tests are done.
// We create three types (txt, html, xml) of reports here. Running your build script now should
// result in output like that:
doLast {
def srcDir = sourceSets.main.java.srcDirs.toArray()[0]
def srcDir = sourceSets.main.java.srcDirs.join(',')
println "Creating test coverage reports for classes " + srcDir
def emmaInstDir = new File(sourceSets.main.output.classesDir.parentFile.parentFile, "tmp/emma")
ant.emma(enabled:"true"){
new File("$buildDir/reports/emma").mkdirs()
new File(reportPath).mkdirs()
report(sourcepath: srcDir){
fileset(dir: emmaInstDir.absolutePath){
include(name:"**/*.emma")
}
txt(outfile:"$buildDir/reports/emma/coverage.txt")
html(outfile:"$buildDir/reports/emma/coverage.html")
xml(outfile:"$buildDir/reports/emma/coverage.xml")
txt(outfile:"$reportPath/coverage.txt")
html(outfile:"$reportPath/coverage.html")
xml(outfile:"$reportPath/coverage.xml")
}
}
println "Test coverage reports available at $buildDir/reports/emma."
println "txt: $buildDir/reports/emma/coverage.txt"
println "Test $buildDir/reports/emma/coverage.html"
println "Test $buildDir/reports/emma/coverage.xml"
println "Test coverage reports available at $reportPath."
println "txt: $reportPath/coverage.txt"
println "Test $reportPath/coverage.html"
println "Test $reportPath/coverage.xml"
}
}