use of org.jetbrains.idea.maven.model.MavenResource in project intellij-community by JetBrains.
the class MavenFoldersImporter method configSourceFolders.
private void configSourceFolders() {
final MultiMap<JpsModuleSourceRootType<?>, String> roots = new LinkedMultiMap<>();
roots.putValues(JavaSourceRootType.SOURCE, myMavenProject.getSources());
roots.putValues(JavaSourceRootType.TEST_SOURCE, myMavenProject.getTestSources());
for (MavenImporter each : MavenImporter.getSuitableImporters(myMavenProject)) {
each.collectSourceRoots(myMavenProject, (s, type) -> roots.putValue(type, s));
}
for (MavenResource each : myMavenProject.getResources()) {
roots.putValue(JavaResourceRootType.RESOURCE, each.getDirectory());
}
for (MavenResource each : myMavenProject.getTestResources()) {
roots.putValue(JavaResourceRootType.TEST_RESOURCE, each.getDirectory());
}
addBuilderHelperPaths("add-source", roots.getModifiable(JavaSourceRootType.SOURCE));
addBuilderHelperPaths("add-test-source", roots.getModifiable(JavaSourceRootType.TEST_SOURCE));
List<String> addedPaths = new ArrayList<>();
for (JpsModuleSourceRootType<?> type : roots.keySet()) {
for (String path : roots.get(type)) {
addSourceFolderIfNotOverlap(path, type, addedPaths);
}
}
}
use of org.jetbrains.idea.maven.model.MavenResource in project intellij-community by JetBrains.
the class MavenResourceCompilerConfigurationGenerator method addResources.
private static void addResources(final List<ResourceRootConfiguration> container, @NotNull Collection<MavenResource> resources) {
for (MavenResource resource : resources) {
final String dir = resource.getDirectory();
if (dir == null) {
continue;
}
final ResourceRootConfiguration props = new ResourceRootConfiguration();
props.directory = FileUtil.toSystemIndependentName(dir);
final String target = resource.getTargetPath();
props.targetPath = target != null ? FileUtil.toSystemIndependentName(target) : null;
props.isFiltered = resource.isFiltered();
props.includes.clear();
for (String include : resource.getIncludes()) {
props.includes.add(include.trim());
}
props.excludes.clear();
for (String exclude : resource.getExcludes()) {
props.excludes.add(exclude.trim());
}
container.add(props);
}
}
Aggregations