def s1=System.currentTimeMillis()
def f = new File('c:/all_build_files.txt')
def counter=0
def error=0
def noDebug=0
def noJavac=0
def debug=Boolean.getBoolean("debug")
f.eachLine{
try{
def file=it
def project = new XmlSlurper().parse(new File(file))
def tasks = project.target.javac
if( tasks.size() > 0){
noJavac++
if(debug) println "javac tasks: ${tasks.size()}"
def found=true
def nfound=0
tasks.each{
def flag=it.@debug
if (!( flag =~ /yes/ || flag =~ /true/ )) {
nfound++
found=false
}
}
if(!found) {
noDebug++
println "${nfound} : ${file}"
}
}
counter++
}catch(Exception e){
error++
if(debug) println "${it} --> ${e}"
}
}
def s2=System.currentTimeMillis()
def sd=s2-s1
println "Parsed files:${counter}, Errors:${error}, noDebug:${noDebug}, Javac:${noJavac} Time in millis:${sd}"
Run the above script(buildFile.groovy) using:
C:\>groovy -Ddebug=1true buildFile.groovy 2>nul
...
1 : C:\src\nb-src\main\xtest\build.xml
2 : C:\src\nb-src\main\xtest\pes\build.xml
2 : C:\src\nb-src\main\xtest\plugins_src\ide\build.xml
1 : C:\src\nb-src\main\xtest\plugins_src\jvm\build.xml
Parsed files:4866, Errors:29, noDebug:722, Javac:839 Time in millis:11859
No comments:
Post a Comment