You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make GroovyScript simpler by separating the parts meant only for the
controller into a new class that extends GroovyScript. This also makes
the intention of each class and the differences between them clearer
from the names themselves.
* This constructor can only be used when the script is executed on the controller, because launcher and build can not be transferred to an agent and therefore the execution will fail
22
+
* @param script the script to be executed
23
+
* @param parameters the parameters to be passed to the script
24
+
* @param failWithException should the job fail with an exception
@@ -50,56 +41,30 @@ public class GroovyScript extends MasterToSlaveCallable<Object, RuntimeException
50
41
}
51
42
52
43
/**
53
-
* This constructor can only be used when the script is executed on the controller, because launcher and build can not be transferred to an agent and the execution will fail
44
+
* Constructor
54
45
* @param script the script to be executed
55
46
* @param parameters the parameters to be passed to the script
56
47
* @param failWithException should the job fail with an exception
57
48
* @param listener access to logging via listener
58
-
* @param launcher the launcher
59
-
* @param build the current build
60
49
*/
61
50
publicGroovyScript(
62
51
Stringscript,
63
52
@NonNullCollection<Parameter> parameters,
64
53
booleanfailWithException,
65
-
TaskListenerlistener,
66
-
Launcherlauncher,
67
-
AbstractBuild<?, ?> build) {
54
+
TaskListenerlistener) {
68
55
this.script = script;
69
56
this.parameters = newArrayList<>(parameters);
70
57
this.failWithException = failWithException;
71
58
this.listener = listener;
72
-
this.cl = getClassLoader();
73
-
this.build = build;
74
-
this.launcher = launcher;
75
-
}
76
-
77
-
/**
78
-
* Constructor
79
-
* @param script the script to be executed
80
-
* @param parameters the parameters to be passed to the script
81
-
* @param failWithException should the job fail with an exception
0 commit comments