annotate scripts/antall.groovy @ 144:7fead80bdd6a

handle merge working directories (multiple parent branches)
author Dave Smith <smith@nwoca.org>
date Fri, 25 Oct 2013 21:27:11 +0100
parents f351338a3b3a
children
rev   line source
93
f351338a3b3a adding useful scripts
smith@nwoca.org
parents:
diff changeset
1
f351338a3b3a adding useful scripts
smith@nwoca.org
parents:
diff changeset
2 def targets = 'clean default'
f351338a3b3a adding useful scripts
smith@nwoca.org
parents:
diff changeset
3 if (args) {
f351338a3b3a adding useful scripts
smith@nwoca.org
parents:
diff changeset
4 targets = args.join(' ')
f351338a3b3a adding useful scripts
smith@nwoca.org
parents:
diff changeset
5 }
f351338a3b3a adding useful scripts
smith@nwoca.org
parents:
diff changeset
6
f351338a3b3a adding useful scripts
smith@nwoca.org
parents:
diff changeset
7 new File('.').traverse([type: groovy.io.FileType.DIRECTORIES, maxDepth:2]) { project ->
f351338a3b3a adding useful scripts
smith@nwoca.org
parents:
diff changeset
8 def script = new File(project,'build.xml')
f351338a3b3a adding useful scripts
smith@nwoca.org
parents:
diff changeset
9 if (script.exists() ) {
f351338a3b3a adding useful scripts
smith@nwoca.org
parents:
diff changeset
10
f351338a3b3a adding useful scripts
smith@nwoca.org
parents:
diff changeset
11 def out = new StringBuffer()
f351338a3b3a adding useful scripts
smith@nwoca.org
parents:
diff changeset
12 def err = new StringBuffer()
f351338a3b3a adding useful scripts
smith@nwoca.org
parents:
diff changeset
13 println "-" * 50
f351338a3b3a adding useful scripts
smith@nwoca.org
parents:
diff changeset
14 println "processing: $script ($targets)"
f351338a3b3a adding useful scripts
smith@nwoca.org
parents:
diff changeset
15 def proc = "cmd /C ant $targets".execute(null,project)
f351338a3b3a adding useful scripts
smith@nwoca.org
parents:
diff changeset
16 proc.consumeProcessOutput(out,out)
f351338a3b3a adding useful scripts
smith@nwoca.org
parents:
diff changeset
17 proc.waitForOrKill(480 * 1000)
f351338a3b3a adding useful scripts
smith@nwoca.org
parents:
diff changeset
18 new File(project,"build.log").text = out.toString()
f351338a3b3a adding useful scripts
smith@nwoca.org
parents:
diff changeset
19 println out
f351338a3b3a adding useful scripts
smith@nwoca.org
parents:
diff changeset
20 }
f351338a3b3a adding useful scripts
smith@nwoca.org
parents:
diff changeset
21 }