Package org.apache.lucene.dependencies

Examples of org.apache.lucene.dependencies.InterpolatedProperties


   * Returns true if no orphans are found.
   */
  private boolean collectVersionConflictsToIgnore() {
    log("Checking for orphans in " + ignoreConflictsFile.getName(), verboseLevel);
    boolean orphansFound = false;
    InterpolatedProperties properties = new InterpolatedProperties();
    try (InputStream inputStream = new FileInputStream(ignoreConflictsFile);
         Reader reader = new InputStreamReader(inputStream, StandardCharsets.UTF_8)) {
      properties.load(reader);
    } catch (IOException e) {
      throw new BuildException("Exception reading " + ignoreConflictsFile + ": " + e.toString(), e);
    }
    for (Object obj : properties.keySet()) {
      String coordinate = (String)obj;
      if (COORDINATE_KEY_PATTERN.matcher(coordinate).matches()) {
        if ( ! directDependencies.containsKey(coordinate)) {
          orphansFound = true;
          log("ORPHAN coordinate key '" + coordinate + "' in " + ignoreConflictsFile.getName()
                  + " is not found in " + centralizedVersionsFile.getName(),
              Project.MSG_ERR);
        } else {
          String versionsToIgnore = properties.getProperty(coordinate);
          List<String> ignore = Arrays.asList(versionsToIgnore.trim().split("\\s*,\\s*|\\s+"));
          ignoreConflictVersions.put(coordinate, new HashSet<>(ignore));
        }
      }
    }
View Full Code Here


    }
    return ! orphansFound;
  }

  private void collectDirectDependencies() {
    InterpolatedProperties properties = new InterpolatedProperties();
    try (InputStream inputStream = new FileInputStream(centralizedVersionsFile);
         Reader reader = new InputStreamReader(inputStream, StandardCharsets.UTF_8)) {
      properties.load(reader);
    } catch (IOException e) {
      throw new BuildException("Exception reading " + centralizedVersionsFile + ": " + e.toString(), e);
    }
    for (Object obj : properties.keySet()) {
      String coordinate = (String)obj;
      Matcher matcher = COORDINATE_KEY_PATTERN.matcher(coordinate);
      if (matcher.matches()) {
        String org = matcher.group(2);
        String name = matcher.group(3);
        String directVersion = properties.getProperty(coordinate);
        Dependency dependency = new Dependency(org, name, directVersion);
        directDependencies.put(coordinate, dependency);
      }
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.lucene.dependencies.InterpolatedProperties

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.