You can return a new instance of the class using the load command and use the object to call "doStuff"
So, you would get it in "Thing.groovy"
class Thing { def doStuff() { return "HI" } } return new Thing();
And you would get this in your dsl script:
node { def thing = load 'Thing.groovy' echo thing.doStuff() }
To do this, type βHIβ at the console output.
Does this fit your requirements?
source share