Package aQute.bnd.version

Examples of aQute.bnd.version.Version


    Map<String, String> attrs = new HashMap<String, String>();
    attrs.put("version", "1.0");
    attrs.put("strategy", "exact");

    File file = repo.get("foo.bar:foobar-api", new Version(1, 0, 0), attrs , listener);

    assertNull(file);
  }
View Full Code Here


    Map<String, String> attrs = new HashMap<String, String>();
    attrs.put("version", "2.5");
    attrs.put("bsn", "javax.servlet:servlet-api");

    File file = repo.get("servlet-api.source", new Version(2, 5, 0), attrs , listener);

    assertTrue(file.exists());
    assertEquals("servlet-api-2.5-sources.jar", file.getName());
  }
View Full Code Here

    String versionString = jar.getVersion();
    if (versionString == null)
      versionString = "0";
    else if (!Verifier.isVersion(versionString))
      throw new IllegalArgumentException("Invalid version " + versionString);
    Version version = Version.parseVersion(versionString);
   
    return new DefaultArtifact(groupId, artifactId, JAR_EXTENSION, new MvnVersion(version).toString());
  }
View Full Code Here

          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);
    }
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
                    .getClassName().getFQN());
              }
            }
View Full Code Here

                if (since(About._2_4)) {
                  // we have the attribute from the classpath
                  // and we have set it.
                  if (key.equals(Constants.VERSION_ATTRIBUTE)) {
                    try {
                      Version fromExport = new Version(exporterAttributes.getVersion());
                      Version fromSet = new Version(attributes.getVersion());
                      if (!fromExport.equals(fromSet)) {
                        SetLocation location = warning(
                            "Version for package %s is set to different values in the source (%s) and in the manifest (%s). The version in the manifest is not "
                                + "picked up by an other sibling bundles in this project or projects that directly depend on this project",
                            packageName, attributes.get(key), exporterAttributes.get(key));
View Full Code Here

    Entry<String,Attrs> name = getBundleSymbolicName();
    if (name != null) {
      String bsn = name.getKey();
      String version = getBundleVersion();
      Version v = Version.parseVersion(version);
      String outputName = bsn + "-" + v.getWithoutQualifier() + Constants.DEFAULT_JAR_EXTENSION;
      return new File(outputDir, outputName);
    }

    File source = getJar().getSource();
    if (source != null) {
View Full Code Here

    boolean isProvider = false;
    if (args.length == 3)
      isProvider = Processor.isTrue(args[2]);

    Version low = new Version(v);
    Version high;
    if (isProvider)
      high = new Version(low.getMajor(), low.getMinor() + 1, 0);
    else
      high = new Version(low.getMajor() + 1, 0, 0);

    StringBuilder sb = new StringBuilder("(&(version>=").append(low.getWithoutQualifier()).append(")");
    sb.append("(!(version>=").append(high.getWithoutQualifier()).append(")))");

    return sb.toString();
  }
View Full Code Here

      cd.xmlns = namespace;
    }
    String version = info.get(COMPONENT_VERSION);
    if (version != null) {
      try {
        Version v = new Version(version);
        cd.updateVersion(v);
      } catch (Exception e) {
        error("version: specified on component header but not a valid version: "
            + version);
        return;
View Full Code Here

          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);
    }
View Full Code Here

TOP

Related Classes of aQute.bnd.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.