use of org.jetbrains.jps.builders.java.FilteredResourceRootDescriptor in project intellij-community by JetBrains.
the class ResourcesTarget method computeRootDescriptors.
@NotNull
@Override
public List<ResourceRootDescriptor> computeRootDescriptors(JpsModel model, ModuleExcludeIndex index, IgnoredFileIndex ignoredFileIndex, BuildDataPaths dataPaths) {
List<ResourceRootDescriptor> roots = new ArrayList<>();
JavaSourceRootType type = isTests() ? JavaSourceRootType.TEST_SOURCE : JavaSourceRootType.SOURCE;
Iterable<ExcludedJavaSourceRootProvider> excludedRootProviders = JpsServiceManager.getInstance().getExtensions(ExcludedJavaSourceRootProvider.class);
for (JpsTypedModuleSourceRoot<JavaSourceRootProperties> sourceRoot : myModule.getSourceRoots(type)) {
if (!isExcludedFromCompilation(excludedRootProviders, sourceRoot)) {
final String packagePrefix = sourceRoot.getProperties().getPackagePrefix();
final File rootFile = sourceRoot.getFile();
roots.add(new FilteredResourceRootDescriptor(rootFile, this, packagePrefix, computeRootExcludes(rootFile, index)));
}
}
JavaResourceRootType resourceType = isTests() ? JavaResourceRootType.TEST_RESOURCE : JavaResourceRootType.RESOURCE;
for (JpsTypedModuleSourceRoot<JavaResourceRootProperties> root : myModule.getSourceRoots(resourceType)) {
if (!isExcludedFromCompilation(excludedRootProviders, root)) {
File rootFile = root.getFile();
String relativeOutputPath = root.getProperties().getRelativeOutputPath();
roots.add(new ResourceRootDescriptor(rootFile, this, relativeOutputPath.replace('/', '.'), computeRootExcludes(rootFile, index)));
}
}
return roots;
}
Aggregations