I'm pretty new to Jenkins though not to Groovy .. 

I have the Groovy plugin installed and i'm using Groovy 2.2 .. Is this 
supported ? . I have a system Groovy script with which i'm trying to find 
the checked in source in SVN .. 
  
import hudson.model.* 
import hudson.util.* 
import hudson.scm.* 
  
import hudson.scm.SubversionChangeLogSet.LogEntry 

println "Start Build .." 

  
  def myMap = binding.variables 
  
  println "-" * 20 
  myMap.each{k,v-> 
    println("${k}:${v}") 
  } 
  
    
  def parameters = build?.actions.find{ it instanceof ParametersAction 
}?.parameters 
  
  parameters.each { 
   println "parameter ${it.name}:" 
   println it.dump() 
   println "-" * 80 
  } 
    
  println "-" *20 
    
  SubversionChangeLogSet changeSet= build.getChangeSet() 
  
  if(changeSet.isEmptySet()){ 
    println "No changes found" 
  } 
  else{ 
        
    List<LogEntry> items = changeSet.getItems() 
    println items.size()   
    
    def affectedFiles = items.collect { it.paths } 
    def fileNames = affectedFiles.flatten() 
  
    fileNames.each { 
      println it.path 
    } 
                                            
   } 
    
  } 

println "End Build .."   

This results in a build log  .. . 

Started by user anonymous 
Building in workspace C:\.jenkins\jobs\SampleBuild\workspace 
Updating https://Rob-VAIO/svn/sample <https://rob-vaio/svn/sample> at 
revision '2014-03-18T07:22:02.893 +0000' 
U         trunk\src\com\example\vaadin\VaadinUI.java 
At revision 22 
no revision recorded for 
https://Rob-VAIO/svn/sample<https://rob-vaio/svn/sample> in 
the previous build 
Start Build .. 
--------------------------- 
out:java.io.PrintStream@3915700e 
listener:hudson.model.StreamBuildListener@2e6fc469 
build:SampleBuild #149 
launcher:hudson.Launcher$LocalLauncher@2bc7e150 
--------------------------- 
No changes found 
End Build .. 
Finished: SUCCESS 


Why can't i get at the change via my build.getChangeSet call ? What am i 
doing wrong ? Also, assuming I can get at the source file  is it possible 
to open it via Groovy and extract some metaData  ? I'm doing a proof of 
concept and I need to extract and process info held in the individual 
source file. 

Thanks for looking .. 

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to