Class GroovyShellDecorator
java.lang.Object
org.jenkinsci.plugins.workflow.cps.GroovyShellDecorator
- All Implemented Interfaces:
ExtensionPoint
Hook to customize the behaviour of
GroovyShell
used to run workflow scripts.- Author:
- Kohsuke Kawaguchi
-
Nested Class Summary
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Field Summary
Modifier and TypeFieldDescriptionstatic final GroovyShellDecorator
GroovyShellDecorator
that doesn't do anything. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic ExtensionList<GroovyShellDecorator>
all()
void
configureCompiler
(CpsFlowExecution context, org.codehaus.groovy.control.CompilerConfiguration cc) Called withCompilerConfiguration
to provide opportunity to tweak the runtime environment further.void
configureShell
(CpsFlowExecution context, groovy.lang.GroovyShell shell) Called with a configuredGroovyShell
to further tweak its behaviours.void
customizeImports
(CpsFlowExecution context, org.codehaus.groovy.control.customizers.ImportCustomizer ic) Called withImportCustomizer
to auto-import more packages, etc.Obtains a contextualizedGroovyShellDecorator
used to decorate the trusted shell.
-
Field Details
-
NULL
GroovyShellDecorator
that doesn't do anything.
-
-
Constructor Details
-
GroovyShellDecorator
public GroovyShellDecorator()
-
-
Method Details
-
customizeImports
public void customizeImports(@CheckForNull CpsFlowExecution context, org.codehaus.groovy.control.customizers.ImportCustomizer ic) Called withImportCustomizer
to auto-import more packages, etc.- Parameters:
context
- null ifGroovyShell
is created just to test the parsing of the script.
-
configureCompiler
public void configureCompiler(@CheckForNull CpsFlowExecution context, org.codehaus.groovy.control.CompilerConfiguration cc) Called withCompilerConfiguration
to provide opportunity to tweak the runtime environment further.- Parameters:
context
- null ifGroovyShell
is created just to test the parsing of the script.
-
configureShell
Called with a configuredGroovyShell
to further tweak its behaviours.- Parameters:
context
- null ifGroovyShell
is created just to test the parsing of the script.
-
forTrusted
Obtains a contextualizedGroovyShellDecorator
used to decorate the trusted shell.By default, this method returns null decorator that doesn't do anything.
See
classloader.md
for details. -
all
-