Package aQute.libg.version

Examples of aQute.libg.version.Version


            }
          } else {
            // Verify this matches with packageinfo
            String presentVersion = info.get(VERSION_ATTRIBUTE);
            try {             
              Version av = new Version(presentVersion);
              Version bv = new Version(version);
              if ( !av.equals(bv)) {
                error("Version from annotation for %s differs with packageinfo or Manifest", Clazz.getPackage(clazz.className));
              }
            } catch( Exception e) {
              // Ignore
View Full Code Here


            }
          } else {
            // Verify this matches with packageinfo
            String presentVersion = info.get(VERSION_ATTRIBUTE);
            try {
              Version av = new Version(presentVersion);
              Version bv = new Version(version);
              if (!av.equals(bv)) {
                error("Version from annotation for %s differs with packageinfo or Manifest",
                    Clazz.getPackage(clazz.className));
              }
            } catch (Exception e) {
View Full Code Here

    return name;
  }

  void addBundleSymbolicNameToIndex(Resource resource) {
    String bsn = resource.getSymbolicName();
    Version version;
    String versionStr = resource.getVersion();
    try {
      version = new Version(versionStr);
    } catch (Exception e) {
      version = new Version("0.0.0");
    }
    SortedMap<Version, Resource> versionMap = bsnMap.get(bsn);
    if (versionMap == null) {
      versionMap = new TreeMap<Version, Resource>();
      bsnMap.put(bsn, versionMap);
View Full Code Here

            pkgName = prop.getValue();
          else if (Property.VERSION.equals(prop.getName()))
            versionStr = prop.getValue();
        }
       
        Version version;
        try {
          version = new Version(versionStr);
        } catch (Exception e) {
          version = new Version("0.0.0");
        }
       
        if (pkgName != null) {
          SortedMap<Version, Resource> versionMap = pkgResourceMap.get(pkgName);
          if (versionMap == null) {
View Full Code Here

  }

  List<Resource> narrowVersionsByVersionRange(SortedMap<Version, Resource> versionMap, String rangeStr) {
    List<Resource> result;
    if ("latest".equals(rangeStr)) {
      Version highest = versionMap.lastKey();
      result = Create.list(new Resource[] { versionMap.get(highest) });
    } else {
      VersionRange range = rangeStr != null ? new VersionRange(rangeStr) : null;
     
      // optimisation: skip versions definitely less than the range
View Full Code Here

            }
          } else {
            // Verify this matches with packageinfo
            String presentVersion = info.get(VERSION_ATTRIBUTE);
            try {
              Version av = new Version(presentVersion);
              Version bv = new Version(version);
              if (!av.equals(bv)) {
                error("Version from annotation for %s differs with packageinfo or Manifest",
                    Clazz.getPackage(clazz.className));
              }
            } catch (Exception e) {
View Full Code Here

    if (require != null)
      try {
        VersionRange range = new VersionRange(require);
        String bndVersion = getBndVersion();
        if (bndVersion != null) {
          Version v = new Version(bndVersion);
          if (!range.includes(v))
            error("%s requires version %s but this bnd is actually version %s", this,
                range, bndVersion);
        }
      } catch (Exception e) {
View Full Code Here

        Manifest manifest = jar.getManifest();
        symbolName = manifest.getMainAttributes().getValue(
            Analyzer.BUNDLE_SYMBOLICNAME);
        version = manifest.getMainAttributes().getValue(
            Analyzer.BUNDLE_VERSION);
        version = new Version(version).toString();
      } catch (Exception e) {
        // e.printStackTrace();
        symbolName = null;
        version = "0.0.0";
      }
View Full Code Here

TOP

Related Classes of aQute.libg.version.Version

Copyright © 2018 www.massapicom. 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.