Hi,

This is what I'm doing  to report all compilation error or anything else :

def showLastLog(def job, def pattern){
    log.debug("Analyze job $job with pattern $pattern")
    def build = job.lastBuild
    log.debug("Analyze last build $build of job $job")

    if(job instanceof hudson.matrix.MatrixProject){
      build?.runs.each{run->
        log.debug("run:$run")
        def file = run.getLogFile()
        log.debug("file $file")
        if(file.exists()){
          file.text.eachLine{line->
            if(line ==~ pattern){
              log.info("$run\t$line")
            }
          }
        }
      }

    }else{
      def file = build.getLogFile()
      log.debug("file $file")
      if(file.exists()){
        file.text.eachLine{line->
          if(line ==~ pattern){
            log.info("$build\t$line")
          }
        }
      }
    }
  }

I hope this can help.

BR,
Vincent

________________________________
From: [email protected] [[email protected]] on behalf 
of Renjith V [[email protected]]
Sent: Tuesday, June 05, 2012 2:11 PM
To: [email protected]
Subject: Accessing plugin build data in Groovy

I am looking at a way to pull out the warnings information from jobs using 
groovy scripts for some centralized post processing. Specifically I am looking 
at getting the compiler warnings per run for a set of jobs.

Any hints?

Reply via email to