public abstract class BuildVariableContributor extends Object implements ExtensionPoint
This extension point can be used to externally add build variables, which are then used for
various parameter expansions by Builder
s and Publisher
s. Aside from adding variables
of the fixed name, a typical strategy is to look for specific JobProperty
s and other similar configurations
of Job
s to compute values.
EnvironmentContributor
ExtensionPoint.LegacyInstancesAreScopedToHudson
Constructor and Description |
---|
BuildVariableContributor() |
Modifier and Type | Method and Description |
---|---|
static ExtensionList<BuildVariableContributor> |
all()
Returns all the registered
BuildVariableContributor s. |
abstract void |
buildVariablesFor(AbstractBuild build,
Map<String,String> variables)
Contributes build variables used for a build.
|
public abstract void buildVariablesFor(AbstractBuild build, Map<String,String> variables)
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 as InvisibleAction
to AbstractBuild
, 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.
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.public static ExtensionList<BuildVariableContributor> all()
BuildVariableContributor
s.Copyright © 2004–2021. All rights reserved.