Closed snowch closed 8 years ago
E.g.
this
// task to run the groovy script task('Ls', type: JavaExec) { environment 'gateway', props.gateway environment 'username', props.username environment 'password', props.password main = 'Ls' classpath = sourceSets.main.runtimeClasspath } task('Mkdir', type: JavaExec) { environment 'gateway', props.gateway environment 'username', props.username environment 'password', props.password main = 'Mkdir' classpath = sourceSets.main.runtimeClasspath } task('Put', type: JavaExec) { environment 'gateway', props.gateway environment 'username', props.username environment 'password', props.password main = 'Put' classpath = sourceSets.main.runtimeClasspath }
can become this:
['Ls', 'Mkdir', 'Put'].each { taskName -> task "$taskName"(type: JavaExec) { environment 'gateway', props.gateway environment 'username', props.username environment 'password', props.password main = taskName classpath = sourceSets.main.runtimeClasspath } }
Nice way to simplify Chris. Did one commit for ambari dir. Will do one dir at a time next.
E.g.
this
can become this: