public boolean containsGreaterThan(VersionID paramVersionID) {
   for (int i = 0; i < this._versionIds.size(); i++) {
     VersionID localVersionID = (VersionID) this._versionIds.get(i);
     boolean bool = localVersionID.isGreaterThan(paramVersionID);
     if (bool) return true;
   }
   return false;
 }
  /**
   * Stuff the third and fourth numbers of a Derby release id into the encoded format expected by
   * the Derby release machinery.
   */
  private String encodeFixpackAndPoint(VersionID versionID) {
    int result = (versionID.getFixpack() * MAINT_ENCODING) + versionID.getPoint();

    // the convention is to represent the number as 7 digits even
    // if the number is 0
    String retval = Integer.toString(result);
    int length = retval.length();

    int count = MAINT_LENGTH - length;
    for (int i = 0; i < count; i++) {
      retval = "0" + retval;
    }

    return retval;
  }
  /**
   * Create the release properties file from the release id. Sets the property derby.release.id.new
   * equal to the resulting release id.
   */
  public void execute() throws BuildException {
    File target = new File(_releasePropertiesFileName);
    FileWriter propertiesFW = null;
    PrintWriter propertiesPW = null;

    try {
      VersionID versionID = new VersionID(_releaseID);
      if (_bump) {
        versionID.bump();
      }

      int major = versionID.getMajor();
      int minor = versionID.getMinor();
      int currentYear = getCurrentYear();

      propertiesFW = new FileWriter(target);
      propertiesPW = new PrintWriter(propertiesFW);

      propertiesPW.println(APACHE_LICENSE_HEADER);

      propertiesPW.println("drdamaint=0");
      propertiesPW.println("maint=" + encodeFixpackAndPoint(versionID));
      propertiesPW.println("major=" + major);
      propertiesPW.println("minor=" + minor);
      propertiesPW.println("eversion=" + versionID.getBranchName());
      propertiesPW.println("beta=" + versionID.isBeta());
      propertiesPW.println(
          "copyright.comment=Copyright 1997, "
              + currentYear
              + " The Apache Software Foundation or its licensors, as applicable.");
      propertiesPW.println("vendor=The Apache Software Foundation");
      propertiesPW.println("copyright.year=" + currentYear);
      propertiesPW.println("release.id.long=" + versionID.toString());

      setProperty(NEW_RELEASE_ID, versionID.toString());
    } catch (Exception e) {
      throw new BuildException("Could not generate release properties: " + e.getMessage(), e);
    } finally {
      try {
        finishWriting(propertiesFW, propertiesPW);
      } catch (Exception ex) {
        throw new BuildException("Error closing file writers.", ex);
      }
    }
  }
示例#4
0
  /**
   * Get list of each asset to be replaced, and the shots it's in.
   *
   * @return
   * @throws PipelineException
   */
  private boolean getShotsUsingAssets() throws PipelineException {
    ArrayList<ArchiveInfo> archive = mclient.archiveQuery(shotPattern, null);

    logLine("Looking for shots using lo-res assets.");
    for (ArchiveInfo curArc : archive) {
      String name = curArc.getName();
      VersionID vid = curArc.getVersionID();
      TreeSet<VersionID> allVers = mclient.getCheckedInVersionIDs(name);
      if (!vid.equals(allVers.last())) continue;

      NodeVersion ver = mclient.getCheckedInVersion(name, vid);
      Set<String> srcs = ver.getSourceNames();

      for (String loResAsset : pAssetManager.keySet()) {
        if (srcs.contains(loResAsset)) {
          // TODO chec if latest.

          logLine("\t" + getShortName(loResAsset) + ": " + getShortName(name));

          AssetInfo tempInfo = pAssetManager.get(loResAsset);

          if (!tempInfo.getLoHiResShots().containsKey(name))
            tempInfo.getLoHiResShots().put(name, null);
        } // end if
      } // end for
    } // end for

    logLine("Looking for shots using hi-res assets");
    /* - Populate lo-res */
    for (ArchiveInfo curArc : archive) {
      String name = curArc.getName();
      VersionID vid = curArc.getVersionID();
      TreeSet<VersionID> allVers = mclient.getCheckedInVersionIDs(name);
      if (!vid.equals(allVers.last())) continue;

      NodeVersion ver = mclient.getCheckedInVersion(name, vid);
      Set<String> srcs = ver.getSourceNames();

      for (String updateAsset : pAssetManager.keySet()) {
        String hiResAsset = updateAsset.replace(lr, "");
        if (srcs.contains(hiResAsset)) {
          logLine("\t" + getShortName(hiResAsset) + ": " + getShortName(name));
          AssetInfo tempInfo = pAssetManager.get(updateAsset);

          String loRes = tempInfo.getMatchingLoResShot(name);
          if (loRes == null) {
            logLine(
                "!!!\nWARNING:"
                    + getShortName(hiResAsset)
                    + " is used in the "
                    + getShortName(name)
                    + " node which has no matching lo-res model in an anim node."
                    + " So it will not be changed\n!!!");
            continue;
          }

          tempInfo.getLoHiResShots().put(loRes, name);
        } // end if
      } // end for
    } // end for(ArchiveInfo)

    logLine("");

    for (String updateAsset : potentialUpdates) {
      TreeMap<String, String> shots = pAssetManager.get(updateAsset).getLoHiResShots();
      if (shots.isEmpty()) {
        logLine(getShortName(updateAsset) + " is not used in any shots");
        pAssetManager.remove(updateAsset);
      }
      for (String loRes : shots.keySet()) {
        if (shots.get(loRes) == null)
          logLine(
              getShortName(updateAsset)
                  + " is in a hi-res shot, "
                  + getShortName(loRes)
                  + ", but doesn't have a matching hi-res"
                  + "model in the lgt node.");
      }
    }

    if (pAssetManager.isEmpty()) return false;

    return true;
  } // end getShotsUsingAssets