
de.dagere.peass.dependency.execution.ProjectModules Maven / Gradle / Ivy
package de.dagere.peass.dependency.execution;
import java.io.File;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
public class ProjectModules {
private final List modules;
private final Map artifactIds = new HashMap<>();
public ProjectModules(final List modules) {
this.modules = modules;
}
public ProjectModules(final File current) {
modules = new LinkedList();
modules.add(current);
}
public List getModules() {
return modules;
}
public Map getArtifactIds() {
return artifactIds;
}
public List getParents(final File moduleFile) {
final List parents = new LinkedList();
for (File potentialParent : modules) {
String potentialParentPath = potentialParent.getAbsolutePath();
String moduleAbsolutePath = moduleFile.getAbsolutePath();
if (moduleAbsolutePath.contains(potentialParentPath) && !potentialParent.equals(moduleFile)) {
parents.add(potentialParent);
}
}
return parents;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy