I have a groovy script that needs to parse a class from an external groovy script. I am not sure how to pass parameters. Here is what works:
Groovy script I am running is using this line to parse the external class from external.groovy:
new GroovyShell().parse(new File('External.groovy'))
Here is what external.groovy looks like:
class External {
public external() {
println "Hello"
}
}
It works.
The problem I am having, I cant find a way to pass parameters to the external method. Here is what external.groovy should look like:
class External {
public external(String name) {
println name
}
}
How do I add parameters to the running script:
new GroovyShell().parse(new File('external.groovy')) //need to include the 'Name' parameter to this