aQute.bnd.version.Version.getWithoutQualifier()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(10.5k)|赞(0)|评价(0)|浏览(98)

本文整理了Java中aQute.bnd.version.Version.getWithoutQualifier()方法的一些代码示例,展示了Version.getWithoutQualifier()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Version.getWithoutQualifier()方法的具体详情如下:
包路径:aQute.bnd.version.Version
类名称:Version
方法名:getWithoutQualifier

Version.getWithoutQualifier介绍

暂无

代码示例

代码示例来源:origin: biz.aQute.bnd/bndlib

protected File getLocal(String bsn, Version version, Map<String,String> properties) {
  File dir = new File(root, bsn);
  if (LATEST_VERSION.equals(version)) {
    File fjar = new File(dir, bsn + LATEST_POSTFIX);
    if (fjar.isFile())
      return fjar.getAbsoluteFile();
  }
  File fjar = new File(dir, bsn + "-" + version.getWithoutQualifier() + ".jar");
  if (fjar.isFile())
    return fjar.getAbsoluteFile();
  File sfjar = new File(dir, version.getWithoutQualifier() + ".jar");
  if (sfjar.isFile())
    return sfjar.getAbsoluteFile();
  File flib = new File(dir, bsn + "-" + version.getWithoutQualifier() + ".lib");
  if (flib.isFile())
    return flib.getAbsoluteFile();
  File sflib = new File(dir, version.getWithoutQualifier() + ".lib");
  if (sflib.isFile())
    return sflib.getAbsoluteFile();
  return fjar.getAbsoluteFile();
}

代码示例来源:origin: biz.aQute.bnd/bnd

protected File getLocal(String bsn, Version version, Map<String,String> properties) {
  File dir = new File(root, bsn);
  if (LATEST_VERSION.equals(version)) {
    File fjar = new File(dir, bsn + LATEST_POSTFIX);
    if (fjar.isFile())
      return fjar.getAbsoluteFile();
  }
  File fjar = new File(dir, bsn + "-" + version.getWithoutQualifier() + ".jar");
  if (fjar.isFile())
    return fjar.getAbsoluteFile();
  File sfjar = new File(dir, version.getWithoutQualifier() + ".jar");
  if (sfjar.isFile())
    return sfjar.getAbsoluteFile();
  File flib = new File(dir, bsn + "-" + version.getWithoutQualifier() + ".lib");
  if (flib.isFile())
    return flib.getAbsoluteFile();
  File sflib = new File(dir, version.getWithoutQualifier() + ".lib");
  if (sflib.isFile())
    return sflib.getAbsoluteFile();
  return fjar.getAbsoluteFile();
}

代码示例来源:origin: biz.aQute.bnd/biz.aQute.bnd

private ResourceHandle getHandle(Object... target) throws Exception {
  String bsn = (String) target[0];
  Version v = (Version) target[1];
  VersionRange r = new VersionRange("[" + v.getWithoutQualifier() + "," + v.getWithoutQualifier() + "]");
  ResourceHandle[] handles = getHandles(bsn, r.toString());
  if (handles == null || handles.length == 0) {
    return null;
  }
  ResourceHandle h = handles[0];
  return h;
}

代码示例来源:origin: biz.aQute/bndlib

protected File getLocal(String bsn, Version version, Map<String,String> properties) {
  File dir = new File(root, bsn);
  if ( version.getMajor() == MAX_MAJOR && version.getMinor()== 0 && version.getMicro() == 0 && version.getQualifier() == null) {
    File fjar = new File(dir, bsn + "-latest.jar");
    if (fjar.isFile())
      return fjar.getAbsoluteFile();
  }
  
  File fjar = new File(dir, bsn + "-" + version.getWithoutQualifier() + ".jar");
  if (fjar.isFile())
    return fjar.getAbsoluteFile();
  File flib = new File(dir, bsn + "-" + version.getWithoutQualifier() + ".lib");
  if (flib.isFile())
    return flib.getAbsoluteFile();
  return fjar.getAbsoluteFile();
}

代码示例来源:origin: biz.aQute.bnd/biz.aQute.repository

private ResourceHandle getHandle(Object... target) throws Exception {
  String bsn = (String) target[0];
  Version v = (Version) target[1];
  VersionRange r = new VersionRange("[" + v.getWithoutQualifier() + "," + v.getWithoutQualifier() + "]");
  ResourceHandle[] handles = getHandles(bsn, r.toString());
  if (handles == null || handles.length == 0) {
    return null;
  }
  ResourceHandle h = handles[0];
  return h;
}

代码示例来源:origin: biz.aQute.bnd/biz.aQute.bnd

Version current = v.getWithoutQualifier();
if (last != null && current.equals(last)) {
  i.remove();

代码示例来源:origin: biz.aQute.bnd/biz.aQute.bndlib

Version current = v.getWithoutQualifier();
if (last != null && current.equals(last)) {
  i.remove();

代码示例来源:origin: biz.aQute/bndlib

private Element getLocalAPI() throws Exception {
  List<Element> result = new ArrayList<Element>();
  for (Map.Entry<PackageRef,List<Element>> entry : packages.entrySet()) {
    List<Element> set = entry.getValue();
    for (Iterator<Element> i = set.iterator(); i.hasNext();) {
      if (notAccessible.contains(analyzer.getTypeRefFromFQN(i.next().getName())))
        i.remove();
    }
    String version = exports.get(entry.getKey()).get(Constants.VERSION_ATTRIBUTE);
    if (version != null) {
      Version v = new Version(version);
      set.add(new Element(Type.VERSION, v.getWithoutQualifier().toString(), null, IGNORED, IGNORED, null));
    }
    Element pd = new Element(Type.PACKAGE, entry.getKey().getFQN(), set, MINOR, MAJOR, null);
    result.add(pd);
  }
  for (JAVA java : javas) {
    result.add(new Element(CLASS_VERSION, java.toString(), null, Delta.CHANGED, Delta.CHANGED, null));
  }
  return new Element(Type.API, "<api>", result, CHANGED, CHANGED, null);
}

代码示例来源:origin: biz.aQute.bnd/bndlib

private Element getLocalAPI() throws Exception {
  Set<Element> result = new HashSet<Element>();
  for (Map.Entry<PackageRef,List<Element>> entry : packages.entrySet()) {
    List<Element> set = entry.getValue();
    for (Iterator<Element> i = set.iterator(); i.hasNext();) {
      if (notAccessible.contains(analyzer.getTypeRefFromFQN(i.next().getName())))
        i.remove();
    }
    String version = exports.get(entry.getKey()).get(Constants.VERSION_ATTRIBUTE);
    if (version != null) {
      Version v = new Version(version);
      set.add(new Element(Type.VERSION, v.getWithoutQualifier().toString(), null, IGNORED, IGNORED, null));
    }
    Element pd = new Element(Type.PACKAGE, entry.getKey().getFQN(), set, MINOR, MAJOR, null);
    result.add(pd);
  }
  for (JAVA java : javas) {
    result.add(new Element(CLASS_VERSION, java.toString(), null, Delta.CHANGED, Delta.CHANGED, null));
  }
  return new Element(Type.API, "<api>", result, CHANGED, CHANGED, null);
}

代码示例来源:origin: biz.aQute.bnd/bnd

private Element getLocalAPI() throws Exception {
  Set<Element> result = new HashSet<Element>();
  for (Map.Entry<PackageRef,List<Element>> entry : packages.entrySet()) {
    List<Element> set = entry.getValue();
    for (Iterator<Element> i = set.iterator(); i.hasNext();) {
      if (notAccessible.contains(analyzer.getTypeRefFromFQN(i.next().getName())))
        i.remove();
    }
    String version = exports.get(entry.getKey()).get(Constants.VERSION_ATTRIBUTE);
    if (version != null) {
      Version v = new Version(version);
      set.add(new Element(Type.VERSION, v.getWithoutQualifier().toString(), null, IGNORED, IGNORED, null));
    }
    Element pd = new Element(Type.PACKAGE, entry.getKey().getFQN(), set, MINOR, MAJOR, null);
    result.add(pd);
  }
  for (JAVA java : javas) {
    result.add(new Element(CLASS_VERSION, java.toString(), null, Delta.CHANGED, Delta.CHANGED, null));
  }
  return new Element(Type.API, "<api>", result, CHANGED, CHANGED, null);
}

代码示例来源:origin: biz.aQute.bnd/bndlib

high = new Version(low.getMajor() + 1, 0, 0);
StringBuilder sb = new StringBuilder("(&(version>=").append(low.getWithoutQualifier()).append(")");
sb.append("(!(version>=").append(high.getWithoutQualifier()).append(")))");

代码示例来源:origin: biz.aQute.bnd/bnd

private DownloadBlocker findMatchingVersion(RepositoryPlugin dest, String bsn, Version version) throws Exception {
  Version floor = version.getWithoutQualifier();
  Version ceiling = new Version(floor.getMajor()+1, 0,0);
  VersionRange range = new VersionRange(true,floor, ceiling, false);
  SortedSet<Version> versions = dest.versions(bsn);
  if ( versions == null || versions.isEmpty())
    return null;
  
  for ( Version v : range.filter(versions)) {
    // First one is highest
    // TODO Diff
  }
  return null;
}

代码示例来源:origin: biz.aQute.bnd/bndlib

if ( version != null && Verifier.isVersion(version)) {
  Version v = new Version(version);
  main.putValue( Constants.BUNDLE_VERSION, v.getWithoutQualifier().toString());

代码示例来源:origin: biz.aQute.bnd/bnd

if ( version != null && Verifier.isVersion(version)) {
  Version v = new Version(version);
  main.putValue( Constants.BUNDLE_VERSION, v.getWithoutQualifier().toString());

代码示例来源:origin: biz.aQute.bnd/bnd

high = new Version(low.getMajor() + 1, 0, 0);
StringBuilder sb = new StringBuilder("(&(version>=").append(low.getWithoutQualifier()).append(")");
sb.append("(!(version>=").append(high.getWithoutQualifier()).append(")))");

代码示例来源:origin: biz.aQute.bnd/biz.aQute.bnd

String fName = bsn + "-" + version.getWithoutQualifier() + ".jar";
File file = new File(dir, fName);

代码示例来源:origin: biz.aQute.bnd/biz.aQute.repository

String fName = bsn + "-" + version.getWithoutQualifier() + ".jar";
File file = new File(dir, fName);

代码示例来源:origin: biz.aQute.bnd/bndlib

public void cleanupVersion(Packages packages, String defaultVersion) {
  if (defaultVersion != null) {
    Matcher m = Verifier.VERSION.matcher(defaultVersion);
    if (m.matches()) {
      // Strip qualifier from default package version
      defaultVersion = Version.parseVersion(defaultVersion).getWithoutQualifier().toString();
    }
  }
  for (Map.Entry<PackageRef,Attrs> entry : packages.entrySet()) {
    Attrs attributes = entry.getValue();
    String v = attributes.get(Constants.VERSION_ATTRIBUTE);
    if (v == null && defaultVersion != null) {
      if (!isTrue(getProperty(Constants.NODEFAULTVERSION))) {
        v = defaultVersion;
        if (isPedantic())
          warning("Used bundle version %s for exported package %s", v, entry.getKey());
      } else {
        if (isPedantic())
          warning("No export version for exported package %s", entry.getKey());
      }
    }
    if (v != null)
      attributes.put(Constants.VERSION_ATTRIBUTE, cleanupVersion(v));
  }
}

代码示例来源:origin: biz.aQute.bnd/bnd

public void cleanupVersion(Packages packages, String defaultVersion) {
  if (defaultVersion != null) {
    Matcher m = Verifier.VERSION.matcher(defaultVersion);
    if (m.matches()) {
      // Strip qualifier from default package version
      defaultVersion = Version.parseVersion(defaultVersion).getWithoutQualifier().toString();
    }
  }
  for (Map.Entry<PackageRef,Attrs> entry : packages.entrySet()) {
    Attrs attributes = entry.getValue();
    String v = attributes.get(Constants.VERSION_ATTRIBUTE);
    if (v == null && defaultVersion != null) {
      if (!isTrue(getProperty(Constants.NODEFAULTVERSION))) {
        v = defaultVersion;
        if (isPedantic())
          warning("Used bundle version %s for exported package %s", v, entry.getKey());
      } else {
        if (isPedantic())
          warning("No export version for exported package %s", entry.getKey());
      }
    }
    if (v != null)
      attributes.put(Constants.VERSION_ATTRIBUTE, cleanupVersion(v));
  }
}

代码示例来源:origin: biz.aQute.bnd/bnd

@Description("Show all deliverables from this workspace. with their current version and path.")
public void _deliverables(deliverableOptions options) throws Exception {
  Project project = getProject(options.project());
  if (project == null) {
    messages.NoProject();
    return;
  }
  Collection<Project> projects;
  if (options.limit())
    projects = Arrays.asList(project);
  else
    projects = project.getWorkspace().getAllProjects();
  List<Container> containers = new ArrayList<Container>();
  for (Project p : projects) {
    containers.addAll(p.getDeliverables());
  }
  for (Container c : containers) {
    Version v = new Version(c.getVersion());
    err.printf("%-40s %8s  %s\n", c.getBundleSymbolicName(), v.getWithoutQualifier(), c.getFile());
  }
  getInfo(project);
}

相关文章