Package org.eclipse.osgi.service.resolver

Examples of org.eclipse.osgi.service.resolver.VersionRange


    Version minVersion = Version.parseVersion(reqVersion);
    String versionRange;
    if (matchRule != null) {
      if (matchRule.equalsIgnoreCase(IModel.PLUGIN_REQUIRES_MATCH_PERFECT)) {
        versionRange = new VersionRange(minVersion, true, minVersion, true).toString();
      } else if (matchRule.equalsIgnoreCase(IModel.PLUGIN_REQUIRES_MATCH_EQUIVALENT)) {
        versionRange = new VersionRange(minVersion, true, new Version(minVersion.getMajor(), minVersion.getMinor() + 1, 0, ""), false).toString(); //$NON-NLS-1$
      } else if (matchRule.equalsIgnoreCase(IModel.PLUGIN_REQUIRES_MATCH_COMPATIBLE)) {
        versionRange = new VersionRange(minVersion, true, new Version(minVersion.getMajor() + 1, 0, 0, ""), false).toString(); //$NON-NLS-1$
      } else if (matchRule.equalsIgnoreCase(IModel.PLUGIN_REQUIRES_MATCH_GREATER_OR_EQUAL)) {
        // just return the reqVersion here without any version range
        versionRange = reqVersion;
      } else {
        versionRange = new VersionRange(minVersion, true, new Version(minVersion.getMajor() + 1, 0, 0, ""), false).toString(); //$NON-NLS-1$
      }
    } else {
      versionRange = new VersionRange(minVersion, true, new Version(minVersion.getMajor() + 1, 0, 0, ""), false).toString(); //$NON-NLS-1$
    }

    StringBuffer result = new StringBuffer();
    result.append(';').append(Constants.BUNDLE_VERSION_ATTRIBUTE).append('=');
    result.append('\"').append(versionRange).append('\"');
View Full Code Here


    public static String exportPackageToString(ExportPackageDescription exportPackage) {
        return exportPackage.getName() + "; version=\"" + exportPackage.getVersion() + "\"";
    }
           
    public static String versionToString(VersionConstraint constraint) {
        VersionRange versionRange = constraint.getVersionRange();
        if (versionRange == null) {
            return constraint.getName();
        } else {
            String versionAttribute;           
            if (constraint instanceof ImportPackageSpecification) {
View Full Code Here

    private static String bundleToString(BundleDescription bundle) {
        return bundle.getSymbolicName() + " [" + bundle.getBundleId() + "]";           
    }
   
    private static String versionToString(VersionConstraint constraint) {
        VersionRange versionRange = constraint.getVersionRange();
        if (versionRange == null) {
            return constraint.getName();
        } else {
            String versionAttribute;           
            if (constraint instanceof ImportPackageSpecification) {
View Full Code Here

    Version minVersion = Version.parseVersion(reqVersion);
    String versionRange;
    if (matchRule != null) {
      if (matchRule.equalsIgnoreCase(IModel.PLUGIN_REQUIRES_MATCH_PERFECT)) {
        versionRange = new VersionRange(minVersion, true, minVersion, true).toString();
      } else if (matchRule.equalsIgnoreCase(IModel.PLUGIN_REQUIRES_MATCH_EQUIVALENT)) {
        versionRange = new VersionRange(minVersion, true, new Version(minVersion.getMajor(), minVersion.getMinor() + 1, 0, ""), false).toString(); //$NON-NLS-1$
      } else if (matchRule.equalsIgnoreCase(IModel.PLUGIN_REQUIRES_MATCH_COMPATIBLE)) {
        versionRange = new VersionRange(minVersion, true, new Version(minVersion.getMajor() + 1, 0, 0, ""), false).toString(); //$NON-NLS-1$
      } else if (matchRule.equalsIgnoreCase(IModel.PLUGIN_REQUIRES_MATCH_GREATER_OR_EQUAL)) {
        // just return the reqVersion here without any version range
        versionRange = reqVersion;
      } else {
        versionRange = new VersionRange(minVersion, true, new Version(minVersion.getMajor() + 1, 0, 0, ""), false).toString(); //$NON-NLS-1$
      }
    } else {
      versionRange = new VersionRange(minVersion, true, new Version(minVersion.getMajor() + 1, 0, 0, ""), false).toString(); //$NON-NLS-1$
    }

    StringBuffer result = new StringBuffer();
    result.append(';').append(Constants.BUNDLE_VERSION_ATTRIBUTE).append('=');
    result.append('\"').append(versionRange).append('\"');
View Full Code Here

    }
    if (key.equals(Constants.BUNDLE_NATIVECODE_OSVERSION)) {
      if (osversion == null) {
        osversion = new Attribute();
      }
      osversion.addElement(new VersionRange(value));
      return;
    }
    if (key.equals(Constants.SELECTION_FILTER_ATTRIBUTE)) {
      if (filterString == null) {
        filterString = value;
View Full Code Here

      return Version.emptyVersion;
    Version result = null;
    int size = this.osversion.size();
    for (int i = 0; i < size; i++) {
      // find a matching range and save the highest result
      VersionRange range = (VersionRange) this.osversion.elementAt(i);
      if (range.isIncluded(version) && (result == null || (range.getMinimum().compareTo(result) > 0)))
        result = range.getMinimum();
    }
    return result;
  }
View Full Code Here

    Version minVersion = Version.parseVersion(reqVersion);
    String versionRange;
    if (matchRule != null) {
      if (matchRule.equalsIgnoreCase(IModel.PLUGIN_REQUIRES_MATCH_PERFECT)) {
        versionRange = new VersionRange(minVersion, true, minVersion, true).toString();
      } else if (matchRule.equalsIgnoreCase(IModel.PLUGIN_REQUIRES_MATCH_EQUIVALENT)) {
        versionRange = new VersionRange(minVersion, true, new Version(minVersion.getMajor(), minVersion.getMinor() + 1, 0, ""), false).toString(); //$NON-NLS-1$
      } else if (matchRule.equalsIgnoreCase(IModel.PLUGIN_REQUIRES_MATCH_COMPATIBLE)) {
        versionRange = new VersionRange(minVersion, true, new Version(minVersion.getMajor() + 1, 0, 0, ""), false).toString(); //$NON-NLS-1$
      } else if (matchRule.equalsIgnoreCase(IModel.PLUGIN_REQUIRES_MATCH_GREATER_OR_EQUAL)) {
        // just return the reqVersion here without any version range
        versionRange = reqVersion;
      } else {
        versionRange = new VersionRange(minVersion, true, new Version(minVersion.getMajor() + 1, 0, 0, ""), false).toString(); //$NON-NLS-1$
      }
    } else {
      versionRange = new VersionRange(minVersion, true, new Version(minVersion.getMajor() + 1, 0, 0, ""), false).toString(); //$NON-NLS-1$
    }

    StringBuffer result = new StringBuffer();
    result.append(';').append(Constants.BUNDLE_VERSION_ATTRIBUTE).append('=');
    result.append('\"').append(versionRange).append('\"');
View Full Code Here

    private static String bundleToString(BundleDescription bundle) {
        return bundle.getSymbolicName() + " [" + bundle.getBundleId() + "]";           
    }
   
    private static String versionToString(VersionConstraint constraint) {
        VersionRange versionRange = constraint.getVersionRange();
        if (versionRange == null) {
            return constraint.getName();
        } else {
            String versionAttribute;           
            if (constraint instanceof ImportPackageSpecification) {
View Full Code Here

  }

  private static boolean matchesVersion(String range, String rooVersion) {
    try {
      int i = rooVersion.indexOf(' ');
      if (new VersionRange(range).isIncluded(new Version(rooVersion.substring(0, i)))) {
        return true;           
      }
    } catch (RuntimeException e) {
      // ignore
    }
View Full Code Here

          "Cannot determine Roo version for installation '%s'.", getName()));
    }
    String rawVersion = getVersion();
    int i = rawVersion.indexOf(' ');
    Version version = Version.parseVersion(rawVersion.substring(0, i));
    VersionRange range = new VersionRange(IRooInstall.SUPPORTED_VERSION);
    if (!range.isIncluded(version)) {
      return new Status(IStatus.ERROR, RooCoreActivator.PLUGIN_ID, String.format(
          "Roo installation '%s' of version '%s' is not supported.", getName(), getVersion()));
    }
    return Status.OK_STATUS;
  }
View Full Code Here

TOP

Related Classes of org.eclipse.osgi.service.resolver.VersionRange

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.