1
0
mirror of synced 2026-08-06 02:08:01 +00:00

Pull in changes to convert emma, aspectj and bundlor usage to plugins

This commit is contained in:
Luke Taylor
2011-02-16 15:57:22 +00:00
parent fd1a70edc2
commit db6edfb512
11 changed files with 351 additions and 117 deletions
-39
View File
@@ -1,39 +0,0 @@
apply plugin: 'java'
configurations {
bundlor
}
dependencies {
bundlor 'com.springsource.bundlor:com.springsource.bundlor.ant:1.0.0.RELEASE',
'com.springsource.bundlor:com.springsource.bundlor:1.0.0.RELEASE',
'com.springsource.bundlor:com.springsource.bundlor.blint:1.0.0.RELEASE'
}
task bundlor(dependsOn: compileJava) {
def template = new File(projectDir, 'template.mf')
def bundlorDir = new File("${project.buildDir}/bundlor")
def manifest = file("${bundlorDir}/META-INF/MANIFEST.MF")
outputs.dir bundlorDir
outputs.files manifest
inputs.files template, project.sourceSets.main.runtimeClasspath
jar.manifest.from manifest
jar.inputs.files manifest
doFirst {
ant.taskdef(resource: 'com/springsource/bundlor/ant/antlib.xml', classpath: configurations.bundlor.asPath)
logging.captureStandardOutput(LogLevel.INFO)
mkdir(bundlorDir)
ant.bundlor(inputPath: sourceSets.main.classesDir, outputPath: "$buildDir/bundlor", manifestTemplatePath: template) {
for (p in bundlorProperties) {
property(name: p.key, value: p.value)
}
}
}
}
jar.dependsOn bundlor
-74
View File
@@ -1,74 +0,0 @@
configurations{
emma
}
dependencies{
emma "emma:emma:2.0.5312"
emma "emma:emma_ant:2.0.5312"
}
def emmaMetaDataFile = "${rootProject.buildDir}/emma/emma.em"
def emmaCoverageFile = "${rootProject.buildDir}/emma/emma.ec"
task emmaInstrument {
dependsOn classes
doFirst {
ant.taskdef(resource:"emma_ant.properties", classpath: configurations.emma.asPath)
ant.path(id: "emmarun.classpath") {
pathelement(location: sourceSets.main.classesDir.absolutePath)
}
ant.emma(verbosity: "quiet") { // use "info, verbose, trace1, trace2, trace3 for more info"
instr(merge: "true", destdir: "$buildDir/emma/classes", instrpathref: "emmarun.classpath", metadatafile: "$emmaMetaDataFile") {
instrpath {
fileset(dir: sourceSets.main.classesDir.absolutePath, includes: "*.class")
}
}
}
}
}
// Modify test tasks in the project to generate coverage data
afterEvaluate {
if (project.hasProperty('coverage') && ['on','true'].contains(project.properties.coverage)) {
tasks.withType(Test.class).each { task ->
task.dependsOn emmaInstrument
task.configure() {
jvmArgs '-Dsec.log.level=DEBUG', "-Demma.coverage.out.file=$emmaCoverageFile"
jvmArgs '-Demma.verbosity.level=quiet'
}
task.doFirst {
classpath = files("$buildDir/emma/classes") + configurations.emma + classpath
}
}
}
}
if (rootProject.getTasksByName('coverageReport', false).isEmpty()) {
rootProject.task('coverageReport') << {
ant.taskdef(resource:"emma_ant.properties", classpath: configurations.emma.asPath)
ant.path(id: "src.path") {
coreModuleProjects.each {module->
module.sourceSets.main.java.srcDirs.each {
pathelement(location: it.absolutePath )
}
}
}
if (!rootProject.buildDir.exists()) {
throw new GradleException("No coverage data. Run gradle with -Pcoverage=on if using coverageRepor");
}
ant.emma(enabled: "true", verbosity: "info") {
report(sourcepathref:"src.path") {
fileset(dir: rootProject.buildDir) {
include: '*.ec'
include: '*.emma'
}
txt(outfile: "$rootProject.buildDir/emma/coverage.txt")
html(outfile: "$rootProject.buildDir/emma/coverage.html")
// xml(outfile: "$rootProject.buildDir/emma/coverage.xml")
}
}
}
}
+1
View File
@@ -92,6 +92,7 @@ sourceSets.main.compileClasspath += configurations.provided
test {
jvmArgs = ['-ea', '-Xmx500m']
maxParallelForks = guessMaxForks()
logging.captureStandardOutput(LogLevel.INFO)
testReport = false
}