| So the best bet I've come up with so far is to translate something like:
triggers {
cron('@daily')
}
properties {
buildDiscarder(logRotator(numToKeepStr: '1'))
disableConcurrentBuilds()
}
into a quasi-AST that we can then re-assemble and invoke at runtime. If I could somehow tease each line out into their own closures directly, then we'd be good to go, but I don't see a way to do that currently. And something more like buildDiscarder logRotator(numToKeepStr: '1') (i.e., the syntax we use for tools, agent, etc) doesn't work because logRotator(numToKeepStr: '1') ends up being invoked at parse/config-time. The delegate-fallback approach used in the environment section doesn't, I think, work right here due to the fact that the symbol resolution only works in the right context. Soooooo. More experimentation to come. |