Package com.puppetlabs.geppetto.forge.model

Examples of com.puppetlabs.geppetto.forge.model.ModuleName


      }
      if(m == null)
        worked(ticker, 1);
      else {
        File f = mdProvider[0];
        ModuleName moduleName = m.getName();
        if(options.isCheckModuleSemantics() && isOnPath(pathToFile(f.getAbsolutePath(), root), searchPath)) {
          // remember the metadata and where it came from
          // and if it represents a NODE as opposed to a regular MODULE
          moduleData.put(
            moduleName, new MetadataInfo(m, f, nodeRootPath.isPrefixOf(new Path(f.getAbsolutePath()))));
        }
        if(isValidationWanted(examinedFiles, f)) {
          validateModuleMetadata(m, diagnostics, f, root, options, ticker.newChild(1));
        }
        else
          worked(ticker, 1);
      }
    }

    if(options.isCheckModuleSemantics()) {
      for(ModuleName key : moduleData.keySet()) {
        // check there is only one version of each module
        Collection<MetadataInfo> versions = moduleData.get(key);
        boolean redeclared = versions.size() > 1;

        for(MetadataInfo info : versions) {
          // processed dependencies for one version of a modulefile (in case of errors, there may not be as many ticks as
          // originally requested)
          // this ticks before the fact (but there is "one for the pot" left at the end),
          // as this makes it easier to just do "continue" below.
          worked(ticker, 1);

          // skip checks for unwanted
          final boolean shouldDiagnosticBeReported = isValidationWanted(examinedFiles, info.getFile());
          // if(!) continue;

          if(redeclared && shouldDiagnosticBeReported) {
            addFileError(
              diagnostics, info.getFile(), root, "Redefinition - equally named already exists",
              IValidationConstants.ISSUE__MODULEFILE_REDEFINITION);
          }
          // Resolve all dependencies
          for(Dependency d : info.getMetadata().getDependencies()) {

            // check dependency name and version requirement
            final ModuleName requiredName = d.getName();
            if(requiredName == null) {
              if(shouldDiagnosticBeReported)
                addFileError(
                  diagnostics, info.getFile(), root, "Dependency without name",
                  IValidationConstants.ISSUE__MODULEFILE_DEPENDENCY_ERROR);
View Full Code Here


    SubMonitor ticker = SubMonitor.convert(monitor, 1);
    if(options.isCheckModuleSemantics()) {

      // must have name
      ModuleName moduleName = metadata.getName();
      if(moduleName == null)
        addFileError(
          diagnostics, moduleFile, parentFile, "A name must be specified.",
          IValidationConstants.ISSUE__MODULEFILE_NO_NAME);
View Full Code Here

    name = name.trim();
    if(name.length() == 0)
      return null;

    ModuleName m = null;
    try {
      m = ModuleName.create(name, true);
    }
    catch(IllegalArgumentException e1) {
      try {
View Full Code Here

        : release.getVersion();
  }

  public static String getText(Module module) {
    StringBuilder bld = new StringBuilder();
    ModuleName fullName = getFullName(module);
    if(fullName != null)
      fullName.toString(bld);

    Version version = getModuleVersion(module);
    if(version != null) {
      bld.append(' ');
      version.toString(bld);
View Full Code Here

    }
    return bld.toString();
  }

  public static String getUser(Module module) {
    ModuleName fullName = getFullName(module);
    return fullName == null
        ? null
        : fullName.getOwner();
  }
View Full Code Here

TOP

Related Classes of com.puppetlabs.geppetto.forge.model.ModuleName

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.