public List<Descriptor<Publisher>> getPotentialPublisherDescriptors() { List<Descriptor<Publisher>> publishers = Lists.<Descriptor<Publisher>>newArrayList(MasterMailer.DESCRIPTOR); if (hudson.getPlugin("ircbot") != null) { publishers.add(IrcPublisher.DESCRIPTOR); } if (hudson.getPlugin("postbuild-task") != null) { publishers.add(hudson.getPublisher("PostbuildTask")); } if (hudson.getPlugin("build-pipeline-plugin") != null) { publishers.add(hudson.getPublisher("BuildPipelineTrigger")); } return publishers; }
/** * Returns if the plugin is installed or not. * * @return true, if the plugin is installed; false otherwise. */ @Override public boolean isAvailable() { return (Hudson.getInstance().getPlugin(pluginName) != null); }
/** * Returns if the plugin is installed or not. * * @return true, if the plugin is installed; false otherwise. */ @Override public boolean isAvailable() { return (Hudson.getInstance().getPlugin(pluginName) != null); }
/** * Returns whether the specified plug-in is installed. * * @param shortName * the plug-in to check * @return <code>true</code> if the specified plug-in is installed, * <code>false</code> if not. */ public static boolean isPluginInstalled(final String shortName) { Hudson instance = Hudson.getInstance(); if (instance != null) { return instance.getPlugin(shortName) != null; } return true; }
public static PluginImpl get() { return Hudson.getInstance().getPlugin(PluginImpl.class); }
public static GlobalBuildStatsPlugin getInstance(){ return Hudson.getInstance().getPlugin(GlobalBuildStatsPlugin.class); }
@Extension(optional = true) public static DescriptorImpl newInstance() { if (Hudson.getInstance().getPlugin("dashboard-view") != null) { return new DescriptorImpl(); } else { return null; } }
@Extension(optional = true) public static DescriptorImpl newInstance() { if (Hudson.getInstance().getPlugin("dashboard-view") != null) { return new DescriptorImpl(); } else { return null; } }
if (Hudson.getInstance().getPlugin("promoted-builds") != null) {
@SuppressWarnings("unchecked") public ArrayList<Descriptor<IvyBuilderType>> getBuilderTypeDescriptors() { ArrayList<Descriptor<IvyBuilderType>> buildTypeDescriptors = new ArrayList<Descriptor<IvyBuilderType>>(); buildTypeDescriptors.add(Hudson.getInstance().getDescriptor(AntIvyBuilderType.class)); if (Hudson.getInstance().getPlugin("nant") != null) { buildTypeDescriptors.add(Hudson.getInstance().getDescriptor(NAntIvyBuilderType.class)); } return buildTypeDescriptors; }
@SuppressWarnings("unchecked") public ArrayList<Descriptor<IvyBuilderType>> getBuilderTypeDescriptors() { ArrayList<Descriptor<IvyBuilderType>> buildTypeDescriptors = new ArrayList<Descriptor<IvyBuilderType>>(); buildTypeDescriptors.add(Hudson.getInstance().getDescriptor(AntIvyBuilderType.class)); if (Hudson.getInstance().getPlugin("nant") != null) { buildTypeDescriptors.add(Hudson.getInstance().getDescriptor(NAntIvyBuilderType.class)); } return buildTypeDescriptors; }
@SuppressWarnings("unchecked") public ArrayList<Descriptor<IvyBuilderType>> getBuilderTypeDescriptors() { ArrayList<Descriptor<IvyBuilderType>> buildTypeDescriptors = new ArrayList<Descriptor<IvyBuilderType>>(); buildTypeDescriptors.add(Hudson.getInstance().getDescriptor(AntIvyBuilderType.class)); if (Hudson.getInstance().getPlugin("nant") != null) { buildTypeDescriptors.add(Hudson.getInstance().getDescriptor(NAntIvyBuilderType.class)); } return buildTypeDescriptors; }
public String interpret(AbstractBuild<?,?> build, TaskListener listener) throws IOException, InterruptedException { Map<String, String> envVars; if (Hudson.getInstance().getPlugin("promoted-builds") != null && build.getClass().equals(Promotion.class)) { // if this is a promoted build, get the env vars from // the original build Promotion promotion = Promotion.class.cast(build); envVars = promotion.getTarget().getEnvironment(listener); } else { envVars = build.getEnvironment(listener); } //XXX should this use envVars instead of build.getEnv.... ? return CommonUtil.getInterpreted(envVars, value); }
if (Hudson.getInstance().getPlugin("ci-game") != null) { UserScoreProperty property = user.getProperty(UserScoreProperty.class); if (property != null) {
if (Hudson.getInstance().getPlugin("ci-game") != null) { UserScoreProperty property = user.getProperty(UserScoreProperty.class); if (property != null) {
/** * Translates a string that may contain build vars like ${BUILD_VAR} to * a string with those vars interpreted. * * @param build the Jenkins build. * @param str the string to be interpreted. * @return the interpreted string. * @throws IllegalArgumentException if the env var is not found. */ private String getInterpreted(AbstractBuild<?, ?> build, String str) throws IOException, InterruptedException { Map<String, String> envVars = null; if (Hudson.getInstance().getPlugin("promoted-builds") != null && build.getClass().equals(Promotion.class)) { // if this is a promoted build, get the env vars from // the original build Promotion promotion = Promotion.class.cast(build); envVars = promotion.getTarget().getEnvironment(TaskListener.NULL); } else { envVars = build.getEnvironment(TaskListener.NULL); } try { //XXX should this use envVars instead of build.getEnv.... ? return CommonUtil.getInterpreted(build.getEnvironment(TaskListener.NULL), str); } catch (IllegalArgumentException iae) { this.log(iae.getMessage()); throw iae; } }
pbList.add(newPB); if (Hudson.getInstance().getPlugin("parameterized-trigger") != null) { for (SubProjectsAction action : Util.filter(currentProject.getActions(), SubProjectsAction.class)) { for (BlockableBuildTriggerConfig config : action.getConfigs()) {
private void rebuildNotify() { if (masterBuild.getNotifyOnRebuild() && hudson.getPlugin("slack") != null && hudson.getPlugin("slack").getWrapper().isActive()) { if (masterBuild.getResult() == Result.SUCCESS) { SlackNotifier notifier = null; Map<Descriptor<Publisher>, Publisher> map = masterBuild.getProject().getPublishersList().toMap(); for (Publisher publisher : map.values()) { if (publisher instanceof SlackNotifier) { notifier = (SlackNotifier) publisher; } } ActiveNotifier.MessageBuilder messageBuilder = new ActiveNotifier.MessageBuilder(notifier, masterBuild); String message = messageBuilder.append(" Rebuild was successful").appendOpenLink().toString(); notifier.newSlackService(masterBuild, new StreamBuildListener(new NullOutputStream())).publish(message, "good"); } } }
if (Hudson.getInstance().getPlugin("parameterized-trigger") != null) { for (SubProjectsAction action : Util.filter(project.getActions(), SubProjectsAction.class)) { for (hudson.plugins.parameterizedtrigger.BlockableBuildTriggerConfig config : action.getConfigs()) {