hudson.model.Run.getRootDir()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(6.1k)|赞(0)|评价(0)|浏览(93)

本文整理了Java中hudson.model.Run.getRootDir方法的一些代码示例,展示了Run.getRootDir的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Run.getRootDir方法的具体详情如下:
包路径:hudson.model.Run
类名称:Run
方法名:getRootDir

Run.getRootDir介绍

[英]Root directory of this Run on the master. Files related to this Run should be stored below this directory.
[中]在主服务器上运行此操作的根目录。与此运行相关的文件应存储在此目录下。

代码示例

代码示例来源:origin: jenkinsci/jenkins

/**
 * Polling log that triggered the build.
 */
public File getPollingLogFile() {
  return new File(run.getRootDir(),"polling.log");
}

代码示例来源:origin: jenkinsci/jenkins

/**
 * Gets the directory where the artifacts are archived.
 * @deprecated Should only be used from {@link StandardArtifactManager} or subclasses.
 */
@Deprecated
public File getArtifactsDir() {
  return new File(getRootDir(),"archive");
}

代码示例来源:origin: jenkinsci/jenkins

/**
 * Returns the log file.
 * @return The file may reference both uncompressed or compressed logs
 */  
public @Nonnull File getLogFile() {
  File rawF = new File(getRootDir(), "log");
  if (rawF.isFile()) {
    return rawF;
  }
  File gzF = new File(getRootDir(), "log.gz");
  if (gzF.isFile()) {
    return gzF;
  }
  //If both fail, return the standard, uncompressed log file
  return rawF;
}

代码示例来源:origin: jenkinsci/jenkins

private @Nonnull XmlFile getDataFile() {
  return new XmlFile(XSTREAM,new File(getRootDir(),"build.xml"));
}

代码示例来源:origin: jenkinsci/jenkins

/**
 * Sets the {@link #getResult} of this build.
 * Has no effect when the result is already set and worse than the proposed result.
 * May only be called after the build has started and before it has moved into post-production
 * (normally meaning both {@link #isInProgress} and {@link #isBuilding} are true).
 * @param r the proposed new result
 * @throws IllegalStateException if the build has not yet started, is in post-production, or is complete
 */
public void setResult(@Nonnull Result r) {
  if (state != State.BUILDING) {
    throw new IllegalStateException("cannot change build result while in " + state);
  }
  // result can only get worse
  if (result==null || r.isWorseThan(result)) {
    result = r;
    LOGGER.log(FINE, this + " in " + getRootDir() + ": result is set to " + r, LOGGER.isLoggable(Level.FINER) ? new Exception() : null);
  }
}

代码示例来源:origin: jenkinsci/jenkins

/**
 * Add a <em>new</em> build to the map.
 * Do not use when loading existing builds (use {@link #put(Integer, Object)}).
 */
@Override
public R put(R r) {
  // Defense against JENKINS-23152 and its ilk.
  File rootDir = r.getRootDir();
  if (rootDir.isDirectory()) {
    throw new IllegalStateException("JENKINS-23152: " + rootDir + " already existed; will not overwrite with " + r);
  }
  if (!r.getClass().getName().equals("hudson.matrix.MatrixRun")) { // JENKINS-26739: grandfathered in
    proposeNewNumber(r.getNumber());
  }
  rootDir.mkdirs();
  return super._put(r);
}

代码示例来源:origin: jenkinsci/jenkins

File rootDir = getRootDir();
if (!rootDir.isDirectory()) {
  throw new IOException(this + ": " + rootDir + " looks to have already been deleted; siblings: " + Arrays.toString(project.getBuildDir().list()));

代码示例来源:origin: org.jvnet.hudson.main/hudson-core

/**
 * Returns the log file.
 */
public File getLogFile() {
  return new File(getRootDir(),"log");
}

代码示例来源:origin: org.eclipse.hudson/hudson-core

/**
 * Gets the directory where the artifacts are archived.
 */
public File getArtifactsDir() {
  return new File(getRootDir(), "archive");
}

代码示例来源:origin: org.jenkins-ci.main/jenkins-core

/**
 * Polling log that triggered the build.
 */
public File getPollingLogFile() {
  return new File(run.getRootDir(),"polling.log");
}

代码示例来源:origin: org.eclipse.hudson/hudson-core

/**
 * Gets the directory where the Javadoc is stored for the given build.
 */
private static File getJavadocDir(Run run) {
  return new File(run.getRootDir(), "javadoc");
}

代码示例来源:origin: org.eclipse.hudson/hudson-core

/**
 * Returns the log file.
 */
public File getLogFile() {
  return new File(getRootDir(), "log");
}

代码示例来源:origin: org.jenkins-ci.plugins/javadoc

/**
 * Gets the directory where the Javadoc is stored for the given build.
 */
private static File getJavadocDir(Run run) {
  return new File(run.getRootDir(),"javadoc");
}

代码示例来源:origin: org.eclipse.hudson.main/hudson-core

/**
 * Gets the directory where the Javadoc is stored for the given build.
 */
private static File getJavadocDir(Run run) {
  return new File(run.getRootDir(),"javadoc");
}

代码示例来源:origin: org.eclipse.hudson.main/hudson-core

/**
 * Gets the directory where the artifacts are archived.
 */
public File getArtifactsDir() {
  return new File(getRootDir(),"archive");
}

代码示例来源:origin: org.jenkins-ci.main/jenkins-core

/**
 * Gets the directory where the artifacts are archived.
 * @deprecated Should only be used from {@link StandardArtifactManager} or subclasses.
 */
@Deprecated
public File getArtifactsDir() {
  return new File(getRootDir(),"archive");
}

代码示例来源:origin: jenkinsci/performance-plugin

public static File[] getPerformanceReportDirectory(Run<?, ?> build, String parserDisplayName,
                          PrintStream logger) {
  File folder = new File(
      build.getRootDir() + "/" + PerformanceReportMap.getPerformanceReportFileRelativePath(parserDisplayName, ""));
  return folder.listFiles();
}

代码示例来源:origin: org.jenkins-ci.plugins.workflow/workflow-cps-global-lib

@Override public void copy(Run<?,?> original, Run<?,?> copy, TaskListener listener) throws IOException, InterruptedException {
  LibrariesAction action = original.getAction(LibrariesAction.class);
  if (action != null) {
    copy.addAction(new LibrariesAction(action.getLibraries()));
    FilePath libs = new FilePath(original.getRootDir()).child("libs");
    if (libs.isDirectory()) {
      libs.copyRecursiveTo(new FilePath(copy.getRootDir()).child("libs"));
    }
  }
}

代码示例来源:origin: org.jenkins-ci.plugins/pipeline-input-step

private Object convert(String name, ParameterValue v) throws IOException, InterruptedException {
  if (v instanceof FileParameterValue) {
    FileParameterValue fv = (FileParameterValue) v;
    FilePath fp = new FilePath(run.getRootDir()).child(name);
    fp.copyFrom(fv.getFile());
    return fp;
  } else {
    return v.getValue();
  }
}

代码示例来源:origin: jenkinsci/warnings-ng-plugin

private AnnotatedReport scanWithTool(final Run<?, ?> run, final FilePath workspace, final TaskListener listener,
    final Tool tool) throws IOException, InterruptedException {
  IssuesScanner issuesScanner = new IssuesScanner(tool, getFilters(),
      getSourceCodeCharset(), new FilePath(run.getRootDir()), blame(run, workspace, listener));
  return issuesScanner.scan(run, workspace, new LogHandler(listener, tool.getActualName()));
}

相关文章

微信公众号

最新文章

更多

Run类方法