コード例 #1
0
  private void printUsedBaselines(ClearCaseLogger logger, List<Baseline> latestBls) {
    for (Baseline bl : latestBls) {
      String blString;

      if (bl.isCreated()) {
        blString = "* baseline: %s (created on component %s)";
      } else {
        blString = "  baseline: %s (component %s unmodified)";
      }

      logger.log(String.format(blString, bl.toString(), bl.getComponent().toString()));
    }
  }
コード例 #2
0
  /**
   * Publish the names of all the baselines created so that other plugins can use them.
   *
   * @param build the build where to publish the parameters
   */
  private void publishBaselinesAsParams(AbstractBuild<?, ?> build, List<Baseline> baselines) {
    if (baselines != null && !baselines.isEmpty()) {
      int i = 1;
      for (Baseline bl : baselines) {
        String paramKey = ENV_CC_BASELINE + i++;

        String description = "";
        if (bl.isCreated()) {
          description += "<b>CREATED</b> ";
        }
        description += "on component: " + bl.getComponent().toString();
        if (bl.getComponent().isComposite()) {
          description += " <i><b>(COMPOSITE)</b></i>";
        } else {
          if (bl.getComponent().isReadOnly()) {
            description += " <i><b>(READ ONLY)</b></i>";
          }
        }
        CCParametersAction.addBuildParameter(
            build, new StringParameterValue(paramKey, bl.toString(), description));
      }
    }
  }