本文整理汇总了Java中hudson.tasks.BuildWrapper类的典型用法代码示例。如果您正苦于以下问题:Java BuildWrapper类的具体用法?Java BuildWrapper怎么用?Java BuildWrapper使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BuildWrapper类属于hudson.tasks包,在下文中一共展示了BuildWrapper类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: findItemWithBuildWrapper
import hudson.tasks.BuildWrapper; //导入依赖的package包/类
private static <T extends BuildWrapper> BuildWrapperItem<T> findItemWithBuildWrapper(final AbstractItem buildItem, Class<T> buildWrapperClass) {
if (buildItem == null) {
return null;
}
if (buildItem instanceof BuildableItemWithBuildWrappers) {
BuildableItemWithBuildWrappers buildWrapper = (BuildableItemWithBuildWrappers) buildItem;
DescribableList<BuildWrapper, Descriptor<BuildWrapper>> buildWrappersList = buildWrapper.getBuildWrappersList();
if (buildWrappersList != null && !buildWrappersList.isEmpty()) {
return new BuildWrapperItem<T>(buildWrappersList.get(buildWrapperClass), buildItem);
}
}
if (buildItem.getParent() instanceof AbstractItem) {
return findItemWithBuildWrapper((AbstractItem) buildItem.getParent(), buildWrapperClass);
}
return null;
}
示例2: executeCheck
import hudson.tasks.BuildWrapper; //导入依赖的package包/类
public boolean executeCheck(Item item) {
boolean notfound = true;
if (Jenkins.getInstance().pluginManager.getPlugin("build-timeout") != null) {
if (item.getClass().getName().endsWith("hudson.maven.MavenModuleSet")) {
try {
Method method = item.getClass().getMethod("getBuildWrappersList");
DescribableList<BuildWrapper,Descriptor<BuildWrapper>> buildWrapperList = ((DescribableList<BuildWrapper,Descriptor<BuildWrapper>>) method.invoke(item));
notfound = !isTimeout(buildWrapperList);
} catch (Exception e) {
LOG.log(Level.WARNING, "Exception " + e.getMessage(), e.getCause());
notfound = false;
}
}
if (item instanceof Project) {
notfound = !isTimeout(((Project) item).getBuildWrappersList());
}
if (item instanceof MatrixProject) {
notfound = !isTimeout(((MatrixProject) item).getBuildWrappersList());
}
}
return notfound;
}
示例3: setUp
import hudson.tasks.BuildWrapper; //导入依赖的package包/类
@Override
public BuildWrapper.Environment setUp(
@SuppressWarnings("rawtypes") final AbstractBuild build,
final Launcher launcher, final BuildListener listener)
throws IOException, InterruptedException
{
EnvVars env = build.getEnvironment(listener);
env.put("RavelloUsername", Util.fixEmptyAndTrim(userId));
env.put("RavelloPassword", Scrambler.scramble(Util.fixEmptyAndTrim(authKey)));
return new Environment()
{
/* empty implementation */
};
}
示例4: getBuildWrapperParameterDefinitions
import hudson.tasks.BuildWrapper; //导入依赖的package包/类
/**
* Get parameter definitions associated with {@link BuildWrapper}s of the given {@link Project}.
* @param project the project for which the parameter definitions should be found
* @return Map
*/
public static @Nonnull Map<BuildWrapper, List<ParameterDefinition>> getBuildWrapperParameterDefinitions(@Nonnull Project<?, ?> project) {
final List<BuildWrapper> buildWrappersList = project.getBuildWrappersList();
final Map<BuildWrapper, List<ParameterDefinition>> result = new LinkedHashMap<BuildWrapper, List<ParameterDefinition>>();
List<ParameterDefinition> value = new ArrayList<ParameterDefinition>();
for (BuildWrapper buildWrapper : buildWrappersList) {
final PropertyDescriptor[] propertyDescriptors;
try {
propertyDescriptors = Introspector.getBeanInfo(buildWrapper.getClass()).getPropertyDescriptors();
} catch (IntrospectionException e) {
continue;
}
for (PropertyDescriptor propertyDescriptor : propertyDescriptors) {
addParameterDefinitionsTo(value, buildWrapper, propertyDescriptor);
}
if (!value.isEmpty()) {
result.put(buildWrapper, value);
value = new ArrayList<ParameterDefinition>();
}
}
return result.isEmpty() ? Collections.<BuildWrapper, List<ParameterDefinition>> emptyMap() : result;
}
示例5: getBuildWrappersList
import hudson.tasks.BuildWrapper; //导入依赖的package包/类
public DescribableList<BuildWrapper, Descriptor<BuildWrapper>> getBuildWrappersList(
IMode mode) {
InheritanceGovernor<DescribableList<BuildWrapper, Descriptor<BuildWrapper>>> gov =
new InheritanceGovernor<DescribableList<BuildWrapper, Descriptor<BuildWrapper>>>(
"buildWrappersList", SELECTOR.BUILD_WRAPPER, this) {
@Override
protected DescribableList<BuildWrapper, Descriptor<BuildWrapper>> castToDestinationType(Object o) {
return castToDescribableList(o);
}
@Override
public DescribableList<BuildWrapper, Descriptor<BuildWrapper>> getRawField(
InheritanceProject ip) {
return ip.getRawBuildWrappersList();
}
@Override
protected DescribableList<BuildWrapper, Descriptor<BuildWrapper>> reduceFromFullInheritance(
Deque<DescribableList<BuildWrapper, Descriptor<BuildWrapper>>> list) {
return InheritanceGovernor.reduceDescribableByMergeWithoutDuplicates(list);
}
};
return gov.retrieveFullyDerivedField(this, mode);
}
示例6: isTimeout
import hudson.tasks.BuildWrapper; //导入依赖的package包/类
private boolean isTimeout(List<BuildWrapper> builders) {
boolean status = false;
if (builders != null && builders.size() > 0 ) {
for (BuildWrapper builder : builders) {
if (builder.getClass().getName().endsWith("BuildTimeoutWrapper")) {
status = true;
}
}
}
return status;
}
示例7: getBuildWrappersList
import hudson.tasks.BuildWrapper; //导入依赖的package包/类
public DescribableList<BuildWrapper, Descriptor<BuildWrapper>>
getBuildWrappersList() {
if (buildWrappers == null) {
buildWrappersSetter.compareAndSet(this, null,
new DescribableList<BuildWrapper, Descriptor<BuildWrapper>>(this));
}
return buildWrappers;
}
示例8: setupWrappers
import hudson.tasks.BuildWrapper; //导入依赖的package包/类
public boolean setupWrappers(final List<BuildWrapper> wrappers) throws IOException, InterruptedException {
for (final BuildWrapper w : wrappers) {
final Environment e = w.setUp((AbstractBuild<?, ?>) this.build, this.launcher, this.listener);
if (e == null) {
return false;
}
final List<Environment> buildEnvironments = getBuildEnvironments();
buildEnvironments.add(e);
}
return true;
}
示例9: initialize
import hudson.tasks.BuildWrapper; //导入依赖的package包/类
public boolean initialize() throws IOException, InterruptedException {
final List<BuildWrapper> wrappers = new ArrayList<>(getProject().getBuildWrappers().values());
final ParametersAction parameters = getAction(ParametersAction.class);
if (parameters != null) {
parameters.createBuildWrappers(this.build, wrappers);
}
return setupWrappers(wrappers);
}
示例10: setDockerClient
import hudson.tasks.BuildWrapper; //导入依赖的package包/类
@Inject
public BuildWrapper setDockerClient(DockerClient client) {
replacementDockerClient = client;
return this;
}
示例11: GsshDescriptorImpl
import hudson.tasks.BuildWrapper; //导入依赖的package包/类
public GsshDescriptorImpl(Class<? extends BuildWrapper> clazz) {
super(clazz);
load();
}
示例12: newInstance
import hudson.tasks.BuildWrapper; //导入依赖的package包/类
@Override
public BuildWrapper newInstance(StaplerRequest req, JSONObject formData) {
GsshBuilderWrapper pub = new GsshBuilderWrapper();
req.bindParameters(pub, "gssh.wrapp.");
return pub;
}
示例13: queryProject
import hudson.tasks.BuildWrapper; //导入依赖的package包/类
private void queryProject(Project job, Hashtable<String, InstalledPlugin> installedPluginSet) {
if (job != null) {
// Query Builders
if (job.getBuilders() != null && job.getBuilders().size() > 0) {
for (int i = 0; i < job.getBuilders().size(); i++) {
LOG.log(Level.FINE, "getBuilders " + addJob(job.getName(), job.getShortUrl(), job.getBuilders().get(i).getClass(), installedPluginSet));
}
} else {
LOG.log(Level.FINE, "getBuilders is empty");
}
if (job.getBuildWrappersList() != null && job.getBuildWrappersList().size() > 0) {
DescribableList<BuildWrapper, Descriptor<BuildWrapper>> wrappersList = job.getBuildWrappersList();
Iterator<BuildWrapper> buildWrapperIterator = wrappersList.iterator();
while (buildWrapperIterator.hasNext()) {
BuildWrapper buildWrapper = buildWrapperIterator.next();
LOG.log(Level.FINE, "getBuildWrappers " + addJob(job.getName(), job.getShortUrl(), buildWrapper.getClass(), installedPluginSet));
}
} else {
LOG.log(Level.FINE, "getBuildWrappers is empty");
}
if (job.getPublishersList() != null && job.getPublishersList().size() > 0) {
DescribableList<Publisher, Descriptor<Publisher>> publisherList = job.getPublishersList();
Iterator<Publisher> publisherIterator = publisherList.iterator();
while (publisherIterator.hasNext()) {
Publisher publisher = publisherIterator.next();
LOG.log(Level.FINE, "getPublishersList " + addJob(job.getName(), job.getShortUrl(), publisher.getClass(), installedPluginSet));
}
} else {
LOG.log(Level.FINE, "getPublishersList is empty");
}
if (job.getScm() != null) {
LOG.log(Level.FINE, "getScm " + addJob(job.getName(), job.getShortUrl(), job.getScm().getClass(), installedPluginSet));
} else {
LOG.log(Level.FINE, "getScm is empty");
}
if (job.getTriggers() != null && job.getTriggers().size() > 0) {
Iterator<Trigger> triggerIterator = job.getTriggers().values().iterator();
while (triggerIterator.hasNext()) {
Trigger trigger = triggerIterator.next();
LOG.log(Level.FINE, "getTriggers " + addJob(job.getName(), job.getShortUrl(), trigger.getClass(), installedPluginSet));
}
} else {
LOG.log(Level.FINE, "getTriggers is empty");
}
if (job.getProperties() !=null && job.getProperties().size() > 0){
Map<JobPropertyDescriptor,JobProperty> properties = job.getProperties();
for (Map.Entry<JobPropertyDescriptor,JobProperty> entry : properties.entrySet()) {
LOG.log(Level.FINE, "getProperties " + addJob(job.getName(), job.getShortUrl(), entry.getKey().getClass(), installedPluginSet));
}
}else {
LOG.log(Level.FINE, "getProperties is empty");
}
if (job.getAllActions() != null && job.getAllActions().size() > 0) {
for (Action action : job.getAllActions()) {
LOG.log(Level.FINE, "getAllActions " + addJob(job.getName(), job.getShortUrl(), action.getClass(), installedPluginSet));
}
} else {
LOG.log(Level.FINE, "getAllActions is empty");
}
} else {
LOG.log(Level.FINE, "PROJECT is null");
}
}
示例14: queryMatrixProject
import hudson.tasks.BuildWrapper; //导入依赖的package包/类
private void queryMatrixProject(MatrixProject job, Hashtable<String, InstalledPlugin> installedPluginSet) {
if (job != null) {
if (job.getBuilders() != null && job.getBuilders().size() > 0) {
for (int i = 0; i < job.getBuilders().size(); i++) {
LOG.log(Level.FINE, "getBuilders " + addJob(job.getName(), job.getShortUrl(), job.getBuilders().get(i).getClass(), installedPluginSet));
}
} else {
LOG.log(Level.FINE, "getBuilders is empty");
}
if (job.getBuildWrappersList() != null && job.getBuildWrappersList().size() > 0) {
DescribableList<BuildWrapper, Descriptor<BuildWrapper>> wrappersList = job.getBuildWrappersList();
Iterator<BuildWrapper> buildWrapperIterator = wrappersList.iterator();
while (buildWrapperIterator.hasNext()) {
BuildWrapper buildWrapper = buildWrapperIterator.next();
LOG.log(Level.FINE, "getBuildWrappers " + addJob(job.getName(), job.getShortUrl(), buildWrapper.getClass(), installedPluginSet));
}
} else {
LOG.log(Level.FINE, "getBuildWrappers is empty");
}
if (job.getPublishersList() != null && job.getPublishersList().size() > 0) {
DescribableList<Publisher, Descriptor<Publisher>> publisherList = job.getPublishersList();
Iterator<Publisher> publisherIterator = publisherList.iterator();
while (publisherIterator.hasNext()) {
Publisher publisher = publisherIterator.next();
LOG.log(Level.FINE, "getPublishersList " + addJob(job.getName(), job.getShortUrl(), publisher.getClass(), installedPluginSet));
}
} else {
LOG.log(Level.FINE, "getPublishersList is empty");
}
if (job.getScm() != null) {
LOG.log(Level.FINE, "getScm " + addJob(job.getName(), job.getShortUrl(), job.getScm().getClass(), installedPluginSet));
} else {
LOG.log(Level.FINE, "getScm is empty");
}
if (job.getTriggers() != null && job.getTriggers().size() > 0) {
Iterator<Trigger<?>> triggerIterator = job.getTriggers().values().iterator();
while (triggerIterator.hasNext()) {
Trigger trigger = triggerIterator.next();
LOG.log(Level.FINE, "getTriggers " + addJob(job.getName(), job.getShortUrl(), trigger.getClass(), installedPluginSet));
}
} else {
LOG.log(Level.FINE, "getTriggers is empty");
}
// TODO: Query Properties
if (job.getProperties() !=null && job.getProperties().size() > 0){
LOG.log(Level.FINE, "getProperties is " + job.getProperties().size());
for (int j = 0; j < job.getProperties().size(); j++) {
LOG.log(Level.FINE, "getProperties " +job.getProperties().get(j));//+ /+ addJob(job, job.getProperties().get(j).getClass(), installedPluginSet));
}
}else {
LOG.log(Level.FINE, "getProperties is empty");
}
if (job.getAllActions() != null && job.getAllActions().size() > 0) {
for (Action action : job.getAllActions()) {
LOG.log(Level.FINE, "getAllActions " + addJob(job.getName(), job.getShortUrl(), action.getClass(), installedPluginSet));
}
} else {
LOG.log(Level.FINE, "getAllActions is empty");
}
} else {
LOG.log(Level.FINE, "PROJECT is null");
}
}
示例15: queryMavenProject
import hudson.tasks.BuildWrapper; //导入依赖的package包/类
private void queryMavenProject(MavenModuleSet job, Hashtable<String, InstalledPlugin> installedPluginSet) {
if (job != null) {
if (job.getBuildWrappersList() != null && job.getBuildWrappersList().size() > 0) {
DescribableList<BuildWrapper, Descriptor<BuildWrapper>> wrappersList = job.getBuildWrappersList();
Iterator<BuildWrapper> buildWrapperIterator = wrappersList.iterator();
while (buildWrapperIterator.hasNext()) {
BuildWrapper buildWrapper = buildWrapperIterator.next();
LOG.log(Level.FINE, "getBuildWrappers " + addJob(job.getName(), job.getShortUrl(), buildWrapper.getClass(), installedPluginSet));
}
} else {
LOG.log(Level.FINE, "getBuildWrappers is empty");
}
if (job.getPublishersList() != null && job.getPublishersList().size() > 0) {
DescribableList<Publisher, Descriptor<Publisher>> publisherList = job.getPublishersList();
Iterator<Publisher> publisherIterator = publisherList.iterator();
while (publisherIterator.hasNext()) {
Publisher publisher = publisherIterator.next();
LOG.log(Level.FINE, "getPublishersList " + addJob(job.getName(), job.getShortUrl(), publisher.getClass(), installedPluginSet));
}
} else {
LOG.log(Level.FINE, "getPublishersList is empty");
}
if (job.getScm() != null) {
LOG.log(Level.FINE, "getScm " + addJob(job.getName(), job.getShortUrl(), job.getScm().getClass(), installedPluginSet));
} else {
LOG.log(Level.FINE, "getScm is empty");
}
if (job.getTriggers() != null && job.getTriggers().size() > 0) {
Iterator<Trigger<?>> triggerIterator = job.getTriggers().values().iterator();
while (triggerIterator.hasNext()) {
Trigger trigger = triggerIterator.next();
LOG.log(Level.FINE, "getTriggers " + addJob(job.getName(), job.getShortUrl(), trigger.getClass(), installedPluginSet));
}
} else {
LOG.log(Level.FINE, "getTriggers is empty");
}
if (job.getProperties() !=null && job.getProperties().size() > 0){
Map<JobPropertyDescriptor, JobProperty<? super MavenModuleSet>> properties = job.getProperties();
for (Map.Entry<JobPropertyDescriptor, JobProperty<? super MavenModuleSet>> entry : properties.entrySet()) {
LOG.log(Level.FINE, "getProperties " + addJob(job.getName(), job.getShortUrl(), entry.getKey().getClass(), installedPluginSet));
}
}else {
LOG.log(Level.FINE, "getProperties is empty");
}
if (job.getAllActions() != null && job.getAllActions().size() > 0) {
for (Action action : job.getAllActions()) {
LOG.log(Level.FINE, "getAllActions " + addJob(job.getName(), job.getShortUrl(), action.getClass(), installedPluginSet));
}
} else {
LOG.log(Level.FINE, "getAllActions is empty");
}
} else {
LOG.log(Level.FINE, "PROJECT is null");
}
}