Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. // jenkins/Application.groovy
  2. package jenkins
  3.  
  4. class Application{
  5. String name
  6. Application(name){
  7. this.name = name
  8. }
  9. }
  10.  
  11. final GroovyScriptEngineImpl engine = (GroovyScriptEngineImpl) this.scriptingEngines.getEngineByName("groovy");
  12. GroovyClassLoader classLoader = engine.getClassLoader();
  13. classLoader.parseClass(new GroovyCodeSource("./jenkins/Application.groovy"))
  14. engine.setClassLoader(classLoader)
  15.  
  16. // jenkins/Application.groovy
  17. // Added
  18. return { Application }
  19. // jenkins/Test.groovy
  20. app = load "./jenkins/Application.groovy"
  21.  
  22. def dna = new app.Application("blah")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement