Skip to content
Browse files

removed findbugs/ switched emma script to gist

  • Loading branch information...
1 parent 2a55017 commit fc3346174ca7d43acb70655eebafd0e67451ef65 @bendisposto committed Jan 27, 2012
Showing with 1 addition and 128 deletions.
  1. +1 −2 build.gradle
  2. +0 −73 scripts/emma.gradle
  3. +0 −53 scripts/findbugs.gradle
View
3 build.gradle
@@ -43,8 +43,7 @@ allprojects {
subprojects {
apply plugin: 'eclipse'
- apply from: rootDir.getAbsolutePath()+'/scripts/emma.gradle'
- apply from: rootDir.getAbsolutePath()+'/scripts/findbugs.gradle'
+ apply from: 'https://raw.github.com/gist/1527604/c0376aa40de59a0481cb33f17ebe5a26ee4f59d0/emma.gradle'
group = 'de.prob'
version = global_version;
repositories {
View
73 scripts/emma.gradle
@@ -1,73 +0,0 @@
-configurations{
- emma
-}
-
-dependencies{
- emma "emma:emma:2.0.5312"
- emma "emma:emma_ant:2.0.5312"
-}
-
-def emmaConvention = new EmmaPluginConvention(project)
-project.convention.plugins.emma = emmaConvention
-
-class EmmaPluginConvention{
- def verbosityLevel = "info"
- def reportPath;
- def coverageFileName;
- def tmpDir;
- def instrDir;
- def metaDataFilePath;
-
- def emma(Closure close){
- close.delegate = this;
- close.run()
- }
-
- EmmaPluginConvention(Project project){
- reportPath = "${project.reportsDir.absolutePath}/emma"
- coverageFileName = "coverage"
- tmpDir = "${project.buildDir}/tmp/emma"
- instrDir = "${tmpDir}/instr"
- metaDataFilePath = "${tmpDir}/metadata.emma"
- }
-}
-
-test{
- //setup JVM Arguments for emma coverage
- jvmArgs "-Demma.coverage.out.file=${emmaConvention.metaDataFilePath}", "-Demma.coverage.out.merge=true"
-
- //add
- doFirst{
- ant.taskdef( resource:"emma_ant.properties", classpath: configurations.emma.asPath)
- ant.path(id:"run.classpath"){
- pathelement(location:sourceSets.main.classesDir.absolutePath )
- }
- ant.emma(verbosity:"${emmaConvention.verbosityLevel}"){
- instr(merge:"true", destdir:"${emmaConvention.instrDir}", instrpathref:"run.classpath", metadatafile:"${emmaConvention.metaDataFilePath}"){
- instrpath{
- fileset(dir:sourceSets.main.classesDir.absolutePath, includes:"*.class")
- }
- }
- }
- setClasspath(files("${emmaConvention.instrDir}") + configurations.emma + getClasspath())
- }
-
- doLast{
- ant.path(id:"src.path"){
- sourceSets.main.java.srcDirs.each{
- pathelement(location:it.absolutePath )
- }
- }
- ant.emma(enabled:"true"){
-
- report(sourcepathref:"src.path"){
- fileset(dir:"${emmaConvention.tmpDir}"){
- include(name:"*.emma")
- }
- txt(outfile:"${emmaConvention.reportPath}/coverage.txt")
- html(outfile:"${emmaConvention.reportPath}/coverage.html")
- xml(outfile:"${emmaConvention.reportPath}/coverage.xml")
- }
- }
- }
-}
View
53 scripts/findbugs.gradle
@@ -1,53 +0,0 @@
-configurations{
- findbugs
-}
-
-dependencies {
- findbugs 'com.google.code.findbugs:findbugs:1.3.9'
- //findbugs 'com.google.code.findbugs:findbugs-ant:1.3.9'
-}
-
-
-def findbugsConvention = new FindBugsPluginConvention(project)
-project.convention.plugins.findbugs = findbugsConvention
-
-class FindBugsPluginConvention {
- def verbosityLevel = "info"
- def findbugsSrc;
- def findBugsReport;
- def findbugs_home;
- def jarFile;
-
- def findbugs(Closure close){
- close.delegate = this;
- close.run()
- }
-
- FindBugsPluginConvention(Project project){
- findBugsReport = "${project.buildDir}/reports/findbugs"
- findbugs_home = "${project.buildDir}/lib"
- jarFile = "${project.libsDir}/${project.jar.archiveName}"
- }
-}
-
-
-
-
-test {
- doFirst{
- new File("${findBugsReport}").mkdirs()
- }
- doLast{
- println "Running FindBugs"
-println configurations.testCompile.asPath
- javaexec {
- aux = configurations.testCompile.asPath;
- srcs = sourceSets.main.java.srcDirs.iterator().next()
- main = 'edu.umd.cs.findbugs.FindBugs2'
- classpath = configurations.findbugs
- maxHeapSize = '1024m'
- args = ["-release", "-textui", "-xml", "-output","${findBugsReport}/findbugs.xml","-auxclasspath",aux,"-sourcepath",srcs,"${project.buildDir}/classes"]
- }
- println "Report created in ${findBugsReport}/findbugs.xml"
- }
-}

0 comments on commit fc33461

Please sign in to comment.
Something went wrong with that request. Please try again.