Package com.puppetlabs.geppetto.forge.model

Examples of com.puppetlabs.geppetto.forge.model.Dependency$JsonAdapter


  }

  @Override
  public Metadata resolve(ModuleName name, Version version) throws IOException {
    VersionRange vr = VersionRange.exact(version);
    Dependency dep = new Dependency();
    dep.setName(name);
    dep.setVersionRequirement(vr);
    return resolve(dep);
  }
View Full Code Here


              : Version.create(r.getLowerBound().toString());
          Version upper = r.getUpperBound() == null
              ? Version.MAX
              : Version.create(r.getUpperBound().toString());

          Dependency forgeDep = new Dependency();
          String dgid = mavenProject.getGroupId();
          String downer = dgid.substring(dgid.lastIndexOf('.') + 1);
          forgeDep.setName(ModuleName.create(downer, dep.getArtifactId(), true));
          forgeDep.setVersionRequirement(VersionRange.create(
            lower, r.isLowerBoundInclusive(), upper, r.isUpperBoundInclusive()));

          if(forgeDeps == null)
            forgeDeps = new ArrayList<Dependency>();
          forgeDeps.add(forgeDep);
View Full Code Here

    // Remove the dependencies that appoints modules that we have in the
    // workspace
    Iterator<Dependency> depsItor = deps.iterator();
    nextDep: while(depsItor.hasNext()) {
      Dependency dep = depsItor.next();
      for(Metadata metadata : metadatas)
        if(dep.matches(metadata)) {
          depsItor.remove();
          continue nextDep;
        }
    }
View Full Code Here

        break;
      }
      case dependencies: {
        List<Dependency> deps = new ArrayList<Dependency>(args.size());
        for(JElement jsonDep : args) {
          Dependency dep = createDependency(jsonDep);
          if(dep != null)
            deps.add(dep);
        }
        md.setDependencies(deps);
        break;
View Full Code Here

    }
    ModuleName mname = createModuleName(name);
    if(mname == null)
      return null;

    Dependency dep = new DependencyWithPosition(jsonDep);
    dep.setName(mname);
    try {
      dep.setVersionRequirement(VersionRange.create(vreq));
    }
    catch(IllegalArgumentException e) {
    }
    return dep;
  }
View Full Code Here

  }

  protected abstract void call(CallSymbol key, SourcePosition pos, List<Argument> arguments);

  protected Dependency createDependency(String name, String versionRequirement, SourcePosition pos) {
    Dependency dep = new DependencyWithPosition(
      pos.getStartOffset(), pos.getEndOffset() - pos.getStartOffset(), pos.getStartLine(),
      new File(pos.getFile()));
    dep.setName(createModuleName(name, true, pos));
    if(versionRequirement != null)
      try {
        dep.setVersionRequirement(VersionRange.create(versionRequirement));
      }
      catch(IllegalArgumentException e) {
        addError(pos, getBadVersionRangeMessage(e));
      }
    return dep;
View Full Code Here

public class DependencyTest {

  @Test
  public void testMatches__String_String() {
    Dependency dep = new Dependency();
    dep.setName(ModuleName.fromString("amodule/name"));
    dep.setVersionRequirement(VersionRange.create("2.3.x"));
    assertTrue(dep.matches(ModuleName.fromString("amodule-name"), Version.fromString("2.3.2")));
    assertFalse(dep.matches(ModuleName.fromString("amodule-name"), Version.fromString("2.2.9")));
    assertFalse(dep.matches(ModuleName.fromString("anotherModule/name"), Version.fromString("2.3.2")));
  }
View Full Code Here

TOP

Related Classes of com.puppetlabs.geppetto.forge.model.Dependency$JsonAdapter

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.