use of com.intellij.openapi.compiler.options.ExcludesConfiguration in project intellij-community by JetBrains.
the class GroovyCompilerConfigurable method createExcludedConfigurable.
private ExcludedEntriesConfigurable createExcludedConfigurable(final Project project) {
final ExcludesConfiguration configuration = myConfig.getExcludeFromStubGeneration();
final ProjectFileIndex index = ProjectRootManager.getInstance(project).getFileIndex();
final FileChooserDescriptor descriptor = new FileChooserDescriptor(true, true, false, false, false, true) {
@Override
public boolean isFileVisible(VirtualFile file, boolean showHiddenFiles) {
return super.isFileVisible(file, showHiddenFiles) && !index.isExcluded(file);
}
};
descriptor.setRoots(ContainerUtil.concat(ContainerUtil.map(ModuleManager.getInstance(project).getModules(), new Function<Module, List<VirtualFile>>() {
@Override
public List<VirtualFile> fun(final Module module) {
return ModuleRootManager.getInstance(module).getSourceRoots(JavaModuleSourceRootTypes.SOURCES);
}
})));
return new ExcludedEntriesConfigurable(project, descriptor, configuration);
}
use of com.intellij.openapi.compiler.options.ExcludesConfiguration in project intellij-community by JetBrains.
the class ExcludeFromValidationAction method actionPerformed.
public void actionPerformed(AnActionEvent e) {
Project project = e.getData(CommonDataKeys.PROJECT);
final Pair<ExcludesConfiguration, VirtualFile> pair = getExcludedConfigurationAndFile(e, project);
if (pair == null)
return;
final ExcludeEntryDescription description = new ExcludeEntryDescription(pair.getSecond(), false, true, project);
pair.getFirst().addExcludeEntryDescription(description);
}
use of com.intellij.openapi.compiler.options.ExcludesConfiguration in project intellij-community by JetBrains.
the class ValidationConfigurable method createExcludedConfigurable.
private static ExcludedEntriesConfigurable createExcludedConfigurable(final Project project) {
final ExcludesConfiguration configuration = ValidationConfiguration.getExcludedEntriesConfiguration(project);
final ProjectFileIndex index = ProjectRootManager.getInstance(project).getFileIndex();
final FileChooserDescriptor descriptor = new FileChooserDescriptor(true, true, false, false, false, true) {
public boolean isFileVisible(VirtualFile file, boolean showHiddenFiles) {
return super.isFileVisible(file, showHiddenFiles) && (project.isDefault() || !index.isExcluded(file));
}
};
List<VirtualFile> allContentRoots = new ArrayList<>();
for (final Module module : ModuleManager.getInstance(project).getModules()) {
final VirtualFile[] moduleContentRoots = ModuleRootManager.getInstance(module).getContentRoots();
Collections.addAll(allContentRoots, moduleContentRoots);
}
descriptor.setRoots(allContentRoots);
return new ExcludedEntriesConfigurable(project, descriptor, configuration);
}
use of com.intellij.openapi.compiler.options.ExcludesConfiguration in project android by JetBrains.
the class AndroidPrecompileTask method prepareForCompilation.
private static boolean prepareForCompilation(CompileContext context) {
final Project project = context.getProject();
if (!checkArtifacts(context)) {
return false;
}
checkAndroidDependencies(context);
ExcludesConfiguration configuration = CompilerConfiguration.getInstance(project).getExcludedEntriesConfiguration();
Set<ExcludeEntryDescription> addedEntries = new HashSet<>();
for (Module module : ModuleManager.getInstance(project).getModules()) {
final AndroidFacet facet = AndroidFacet.getInstance(module);
if (facet == null) {
continue;
}
if (context.isRebuild()) {
clearResCache(facet, context);
}
final AndroidPlatform platform = facet.getConfiguration().getAndroidPlatform();
final int platformToolsRevision = platform != null ? platform.getSdkData().getPlatformToolsRevision() : -1;
LOG.debug("Platform-tools revision for module " + module.getName() + " is " + platformToolsRevision);
if (!facet.isAppProject()) {
if (platformToolsRevision >= 0 && platformToolsRevision <= 7) {
LOG.debug("Excluded sources of module " + module.getName());
excludeAllSourceRoots(module, configuration, addedEntries);
} else {
// todo: support this by project converter to use on compile-server
unexcludeAllSourceRoots(facet, configuration);
}
}
}
if (addedEntries.size() > 0) {
LOG.debug("Files excluded by Android: " + addedEntries.size());
project.getMessageBus().connect().subscribe(CompilerTopics.COMPILATION_STATUS, new MyCompilationStatusListener(project, addedEntries));
}
return true;
}
use of com.intellij.openapi.compiler.options.ExcludesConfiguration in project android by JetBrains.
the class AndroidCompileUtil method excludeFromCompilation.
private static void excludeFromCompilation(@NotNull Project project, @NotNull VirtualFile dir) {
final ExcludesConfiguration configuration = CompilerConfiguration.getInstance(project).getExcludedEntriesConfiguration();
for (ExcludeEntryDescription description : configuration.getExcludeEntryDescriptions()) {
if (Comparing.equal(description.getVirtualFile(), dir)) {
return;
}
}
configuration.addExcludeEntryDescription(new ExcludeEntryDescription(dir, true, false, project));
}
Aggregations