Examples of RevisionRef


Examples of aQute.service.library.Library.RevisionRef

    map.put("Inspect Revision", new Runnable() {
      public void run() {
        open("https://www.jpm4j.org#!/p/sha/" + Hex.toHexString(resource.revision) + "//0.0.0");
      }
    });
    RevisionRef update = findUpdate(p, version);
    if (update != null) {
      map.put("Update to " + update.version, new Runnable() {
        public void run() {
          try {
            update(p, bsn, version);
View Full Code Here

Examples of aQute.service.library.Library.RevisionRef

    Map<String,Runnable> map = new LinkedHashMap<String,Runnable>();

    if (p != null) {
      Set<Version> update = new TreeSet<Version>();
      for (Version v : index.getVersions(bsn)) {
        RevisionRef ref = findUpdate(p, v);
        if (ref != null) {
          update.add(toVersion(ref.baseline, ref.qualifier));
        }
      }

      map.put("Inspect Program", new Runnable() {
        public void run() {
          open("https://www.jpm4j.org#/p/osgi/" + bsn);
        }
      });

      RevisionRef ref = p.revisions.get(0);
      Version latest = toVersion(ref.baseline, ref.qualifier);
      for (Version v : index.getVersions(bsn)) {
        if (v.equals(latest)) {
          latest = null;
          break;
View Full Code Here

Examples of aQute.service.library.Library.RevisionRef

    }
    return null;
  }

  private String revisionTooltip(String bsn, Version version) throws Exception {
    RevisionRef r = getRevisionRef(bsn, version);

    if (r == null)
      return null;

    Formatter sb = new Formatter();
    try {
      sb.format("[%s:%s", r.groupId, r.artifactId);

      if (r.classifier != null) {
        sb.format(":%s", r.classifier);
      }
      sb.format("@%s]\n\n", r.version);

      if (r.releaseSummary != null)
        sb.format("%s\n\n", r.releaseSummary);

      if (r.description != null)
        sb.format("%s\n\n", r.description.replaceAll("#\\s*", ""));
      sb.format("Size %s\nSHA-1 %s\nAge %s\nURL %s\n", size(r.size, 0), Hex.toHexString(r.revision),
          age(r.created), r.url);

      File f = cache.getPath(bsn, version, r.revision);
      if (f.isFile() && f.length() == r.size)
        sb.format("Cached %s\n", f);
      else
        sb.format("Not downloaded\n");

      Program p = library.getProgram(Library.OSGI_GROUP, bsn);
      if (p != null) {
        RevisionRef update = findUpdate(p, version);
        if (update != null) {
          sb.format(DOWN_ARROW + " This version should be updated to " + update.version);
        }
      }
      j.wrap((StringBuilder) sb.out());
View Full Code Here

Examples of aQute.service.library.Library.RevisionRef

    if (isSha(bsn) && version.equals(Version.LOWEST)) {
      Revision r = library.getRevision(Library.SHA_GROUP + ":" + bsn + "@0.0.0");
      if (r == null)
        return null;

      return new RevisionRef(r);
    }
    reporter.trace("Looking for %s-%s", bsn, version);
    for (RevisionRef r : getRevisionRefs(bsn)) {
      Version v = toVersion(r.baseline, r.qualifier);
      if (v.equals(version))
View Full Code Here

Examples of aQute.service.library.Library.RevisionRef

   * @param v
   * @throws Exception
   */
  void update(Program p, String bsn, Version v) throws Exception {

    RevisionRef ref = findUpdate(p, v);
    if (ref == null)
      return;

    index.addRevision(ref);
    index.delete(bsn, v);
View Full Code Here

Examples of aQute.service.library.Library.RevisionRef

  private RevisionRef findUpdate(Program p, Version currentVersion) throws Exception {
    String baseline = currentVersion.getWithoutQualifier().toString();

    Version candidate = currentVersion;
    RevisionRef candidateRef = null;

    for (RevisionRef r : p.revisions) {
      if (r.baseline.equals(baseline)) {
        if (r.phase == Library.Phase.MASTER) {
          if (currentVersion.equals(toVersion(r.baseline, r.qualifier)))
View Full Code Here

Examples of aQute.service.library.Library.RevisionRef

      String bsn = (String) target[0];
      String title = bsn;
      Program p = library.getProgram(Library.OSGI_GROUP, bsn);
      if (p != null) {
        for (Version version : versions(bsn)) {
          RevisionRef findUpdate = findUpdate(p, version);
          if (findUpdate != null)
            title += SUPERIOR_1; // superscript 1
        }
      }
      return title;
    }

    if (target.length == 2 && target[0] instanceof String && target[1] instanceof Version) {
      String bsn = (String) target[0];
      Version version = (Version) target[1];

      Library.RevisionRef resource = index.getRevisionRef(bsn, version);
      if (resource == null)
        return "[deleted " + version + "]";

      String title = getPhase(resource.phase.toString()) + " " + version.toString();

      File path = cache.getPath(bsn, version, resource.revision);
      if (path.isFile() && path.length() == resource.size) {
        title += DOWN_ARROW;
      }
      Program p = library.getProgram(Library.OSGI_GROUP, bsn);
      if (p != null) {
        RevisionRef findUpdate = findUpdate(p, version);
        if (findUpdate != null)
          title += SUPERIOR_1; // superscript 1
      }
      return title;
    }
View Full Code Here

Examples of aQute.service.library.Library.RevisionRef

    }
  }

  public void add(String bsn, Version version) throws Exception {
    reporter.trace("Add %s %s", bsn, version);
    RevisionRef ref = getRevisionRef(bsn, version);
    add(ref);
  }
View Full Code Here

Examples of aQute.service.library.Library.RevisionRef

    Library.RevisionRef resource = index.getRevisionRef(revision._id);
    if (resource != null)
      return true;

    RevisionRef ref = new RevisionRef(revision);
    add(ref);
    return true;
  }
View Full Code Here

Examples of aQute.service.library.Library.RevisionRef

      return null;

    Set<ResourceDescriptor> resources = new HashSet<ResourceDescriptor>();
    Revision revision = library.getRevision(m.group(1), m.group(2), m.group(3), m.group(4));
    if (revision != null) {
      ResourceDescriptor rd = createResourceDescriptor(new RevisionRef(revision));
      resources.add(rd);
      if (includeDependencies) {
        for (RevisionRef dependency : library.getClosure(revision._id, false)) {
          resources.add(createResourceDescriptor(dependency));
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.