task groovy << {}
def noArgs(){
println "Called the no args function"
}
def oneArg(x) {
println "Called the 1 arg function with $x"
x
}
def twoArgs(x, y){
println "Called the 2 arg function with $x and $y"
x + y
}
oneArg 500
[vagrant@localhost ud867]$ gradle groovy
Called the 1 arg function with 500
:groovy
BUILD SUCCESSFUL
Total time: 7.983 secs
Hey, what?
task groovy << {}
def noArgs(){
println "Called the no args function"
}
def oneArg(x) {
println "Called the 1 arg function with $x"
x
}
def twoArgs(x, y){
println "Called the 2 arg function with $x and $y"
x + y
}
twoArgs 200, 300
[vagrant@localhost ud867]$ gradle groovy
Called the 2 arg function with 200 and 300
:groovy
BUILD SUCCESSFUL
Total time: 6.671 secs
task groovy << {}
def noArgs(){
println "Called the no args function"
}
def oneArg(x) {
println "Called the 1 arg function with $x"
x
}
def twoArgs(x, y){
println "Called the 2 arg function with $x and $y"
x + y
}
twoArgs oneArg(500), 100
[vagrant@localhost ud867]$ gradle groovy
Called the 1 arg function with 500
Called the 2 arg function with 500 and 100
:groovy
BUILD SUCCESSFUL
Total time: 6.277 secs