/** * @deprecated as of 1.305 use {@link #getEnvironment(TaskListener)} */ @Deprecated public EnvVars getEnvironment() throws IOException, InterruptedException { LOGGER.log(WARNING, "deprecated call to Run.getEnvironment\n\tat {0}", new Throwable().getStackTrace()[1]); return getEnvironment(new LogTaskListener(LOGGER, Level.INFO)); }
/** * @deprecated as of 1.292 * Use {@link #getEnvironment(TaskListener)} instead. */ @Deprecated public Map<String,String> getEnvVars() { LOGGER.log(WARNING, "deprecated call to Run.getEnvVars\n\tat {0}", new Throwable().getStackTrace()[1]); try { return getEnvironment(new LogTaskListener(LOGGER, Level.INFO)); } catch (IOException e) { return new EnvVars(); } catch (InterruptedException e) { return new EnvVars(); } }
for (ComputerListener cl : ComputerListener.all()) { try { cl.onOnline(c, new LogTaskListener(LOGGER, INFO)); } catch (Throwable t) { if (t instanceof Error) {
/** * @deprecated as of 1.305 use {@link #getEnvironment(TaskListener)} */ @Deprecated public EnvVars getEnvironment() throws IOException, InterruptedException { LOGGER.log(WARNING, "deprecated call to Run.getEnvironment\n\tat {0}", new Throwable().getStackTrace()[1]); return getEnvironment(new LogTaskListener(LOGGER, Level.INFO)); }
@Deprecated public List<RemoteConfig> getParamExpandedRepos(Run<?, ?> build) throws IOException, InterruptedException { return getParamExpandedRepos(build, new LogTaskListener(LOGGER, Level.INFO)); }
/** * @deprecated as of 1.305 use {@link #getEnvironment(TaskListener)} */ public EnvVars getEnvironment() throws IOException, InterruptedException { return getEnvironment(new LogTaskListener(LOGGER, Level.INFO)); }
/** * @deprecated as of 1.305 use {@link #getEnvironment(TaskListener)} */ public EnvVars getEnvironment() throws IOException, InterruptedException { return getEnvironment(new LogTaskListener(LOGGER, Level.INFO)); }
/** * @deprecated as of 1.305 use {@link #getEnvironment(TaskListener)} */ public EnvVars getEnvironment() throws IOException, InterruptedException { return getEnvironment(new LogTaskListener(LOGGER, Level.INFO)); }
/** * @deprecated as of 1.305 use {@link #getEnvironment(TaskListener)} */ public EnvVars getEnvironment() throws IOException, InterruptedException { return getEnvironment(new LogTaskListener(LOGGER, Level.INFO)); }
@Deprecated public String getParamLocalBranch(Run<?, ?> build) throws IOException, InterruptedException { return getParamLocalBranch(build, new LogTaskListener(LOGGER, Level.INFO)); }
public PollRunner(AbstractProject p, Cause cause, List<Action> actions) { this.project = p; this.cause = cause; this.buildActions = actions; // workaround for HUDSON-5406: // some (all?) SCMs require a serializable TaskListener for AbstractProject#pollSCMChanges // LogTaskListener is not serializable (at least not up until Hudson 1.352) TaskListener tl = new LogTaskListener(LOGGER, Level.INFO); if (tl instanceof Serializable) { this.taskListener = tl; } else { this.taskListener = StreamTaskListener.fromStdout(); } }
@Deprecated public FlowExecution create(FlowExecutionOwner handle, List<? extends Action> actions) throws IOException { if (Util.isOverridden(FlowDefinition.class, getClass(), "create", FlowExecutionOwner.class, TaskListener.class, List.class)) { try { return create(handle, new LogTaskListener(Logger.getLogger(FlowDefinition.class.getName()), Level.INFO), actions); } catch (IOException x) { throw x; } catch (RuntimeException x) { throw x; } catch (Exception x) { throw new IOException(x); } } else { throw new NoSuchMethodError(); } }
private PrintStream logger() { TaskListener l = null; StepContext context = getContext(); try { l = context.get(TaskListener.class); } catch (Exception x) { LOGGER.log(Level.WARNING, "Failed to find TaskListener in context"); } finally { if (l == null) { l = new LogTaskListener(LOGGER, Level.FINE); } } return l.getLogger(); }
private void updateSymlink(String name, AbstractBuild<?,?> newTarget) throws InterruptedException { if (newTarget != null) newTarget.createSymlink(new LogTaskListener(LOGGER, Level.WARNING), name); else new File(getProject().getBuildDir(), "../"+name).delete(); }
/** * @deprecated as of 1.292 * Use {@link #getEnvironment(TaskListener)} instead. */ @Deprecated public Map<String,String> getEnvVars() { LOGGER.log(WARNING, "deprecated call to Run.getEnvVars\n\tat {0}", new Throwable().getStackTrace()[1]); try { return getEnvironment(new LogTaskListener(LOGGER, Level.INFO)); } catch (IOException e) { return new EnvVars(); } catch (InterruptedException e) { return new EnvVars(); } }
private void updateSymlink(String name, AbstractBuild<?,?> newTarget) throws InterruptedException { if (newTarget != null) newTarget.createSymlink(new LogTaskListener(LOGGER, Level.WARNING), name); else new File(getProject().getBuildDir(), "../"+name).delete(); }
private void updateSymlink(String name, AbstractBuild<?, ?> newTarget) throws InterruptedException { if (newTarget != null) { newTarget.createSymlink(new LogTaskListener(LOGGER, Level.WARNING), name); } else { new File(getProject().getBuildDir(), "../" + name).delete(); } }
private void updateSymlink(String name, AbstractBuild<?,?> newTarget) throws InterruptedException { if (newTarget != null) newTarget.createSymlink(new LogTaskListener(LOGGER, Level.WARNING), name); else new File(getProject().getBuildDir(), "../"+name).delete(); }
public static String buildVar(final AbstractBuild<?, ?> build, final String toResolve) { if (toResolve == null) return null; if (build == null) // is null when called from config page to test connection return toResolve; VariableResolver<String> vr = build.getBuildVariableResolver(); String resolved = Util.replaceMacro(toResolve, vr); try { EnvVars env = build.getEnvironment(new LogTaskListener(LOG, Level.INFO)); resolved = env.expand(resolved); } catch (Exception e) { //TODO no-op? } return resolved; }
@Override public void onLeft(LeftItem item) { if (item.isCancelled() && item.task instanceof Job) { for (Cause cause : item.getCauses()) { if (cause instanceof GerritCause && !((GerritCause)cause).isSilentMode()) { GerritCause gerritCause = (GerritCause)cause; GerritTriggeredEvent event = gerritCause.getEvent(); ToGerritRunListener runListener = ToGerritRunListener.getInstance(); runListener.setQueueCancelled((Job)item.task, event); TaskListener taskListener = new LogTaskListener(logger, Level.WARNING); runListener.allBuildsCompleted(event, gerritCause, taskListener); } } } }