Package hudson.model
Class BuildVariableContributor
- java.lang.Object
-
- hudson.model.BuildVariableContributor
-
- All Implemented Interfaces:
ExtensionPoint
public abstract class BuildVariableContributor extends Object implements ExtensionPoint
Contributes build variables to builds.This extension point can be used to externally add build variables, which are then used for various parameter expansions by
Builder
s andPublisher
s. Aside from adding variables of the fixed name, a typical strategy is to look for specificJobProperty
s and other similar configurations ofJob
s to compute values.- Since:
- 1.403
- Author:
- Kohsuke Kawaguchi
- See Also:
EnvironmentContributor
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Constructor Summary
Constructors Constructor Description BuildVariableContributor()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static ExtensionList<BuildVariableContributor>
all()
Returns all the registeredBuildVariableContributor
s.abstract void
buildVariablesFor(AbstractBuild build, Map<String,String> variables)
Contributes build variables used for a build.
-
-
-
Method Detail
-
buildVariablesFor
public abstract void buildVariablesFor(AbstractBuild build, Map<String,String> variables)
Contributes build variables used for a build.This method can be called repeatedly for the same
AbstractBuild
, thus the computation of this method needs to be efficient. If you have a time-consuming computation, one strategy is to take the hit once and then add the result asInvisibleAction
toAbstractBuild
, then reuse those values later on.This method gets invoked concurrently for multiple
Run
s that are being built at the same time, so it must be concurrent-safe.- Parameters:
build
- Build that's being performed. Never null.variables
- Partially built variable map. Implementation of this method is expected to add additional variables here. Never null.
-
all
public static ExtensionList<BuildVariableContributor> all()
Returns all the registeredBuildVariableContributor
s.
-
-