Search in sources :

Example 16 with ExcludeEntryDescription

use of com.intellij.openapi.compiler.options.ExcludeEntryDescription in project android by JetBrains.

the class AndroidCompileUtil method includeAaptGenSourceRootToCompilation.

private static void includeAaptGenSourceRootToCompilation(AndroidFacet facet) {
    final Project project = facet.getModule().getProject();
    final ExcludesConfiguration configuration = ((CompilerConfigurationImpl) CompilerConfiguration.getInstance(project)).getExcludedEntriesConfiguration();
    final ExcludeEntryDescription[] descriptions = configuration.getExcludeEntryDescriptions();
    configuration.removeAllExcludeEntryDescriptions();
    for (ExcludeEntryDescription description : descriptions) {
        final VirtualFile vFile = description.getVirtualFile();
        if (!Comparing.equal(vFile, AndroidRootUtil.getAaptGenDir(facet))) {
            configuration.addExcludeEntryDescription(description);
        }
    }
}
Also used : Project(com.intellij.openapi.project.Project) ExcludesConfiguration(com.intellij.openapi.compiler.options.ExcludesConfiguration) ExcludeEntryDescription(com.intellij.openapi.compiler.options.ExcludeEntryDescription) CompilerConfigurationImpl(com.intellij.compiler.CompilerConfigurationImpl)

Example 17 with ExcludeEntryDescription

use of com.intellij.openapi.compiler.options.ExcludeEntryDescription in project android by JetBrains.

the class AndroidPrecompileTask method excludeAllSourceRoots.

private static void excludeAllSourceRoots(Module module, ExcludesConfiguration configuration, Collection<ExcludeEntryDescription> addedEntries) {
    Project project = module.getProject();
    VirtualFile[] sourceRoots = ModuleRootManager.getInstance(module).getSourceRoots();
    for (VirtualFile sourceRoot : sourceRoots) {
        ExcludeEntryDescription description = new ExcludeEntryDescription(sourceRoot, true, false, project);
        if (!configuration.containsExcludeEntryDescription(description)) {
            configuration.addExcludeEntryDescription(description);
            addedEntries.add(description);
        }
    }
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) Project(com.intellij.openapi.project.Project) ExcludeEntryDescription(com.intellij.openapi.compiler.options.ExcludeEntryDescription)

Aggregations

ExcludeEntryDescription (com.intellij.openapi.compiler.options.ExcludeEntryDescription)17 VirtualFile (com.intellij.openapi.vfs.VirtualFile)11 ExcludesConfiguration (com.intellij.openapi.compiler.options.ExcludesConfiguration)6 Project (com.intellij.openapi.project.Project)6 CompilerConfigurationImpl (com.intellij.compiler.CompilerConfigurationImpl)2 Module (com.intellij.openapi.module.Module)2 HashSet (com.intellij.util.containers.hash.HashSet)2 NotNull (org.jetbrains.annotations.NotNull)2 CompilerConfiguration (com.intellij.compiler.CompilerConfiguration)1 ExcludedEntriesConfiguration (com.intellij.openapi.compiler.options.ExcludedEntriesConfiguration)1 ExcludedEntriesListener (com.intellij.openapi.compiler.options.ExcludedEntriesListener)1 FileType (com.intellij.openapi.fileTypes.FileType)1 ProjectFileIndex (com.intellij.openapi.roots.ProjectFileIndex)1 VfsUtilCore (com.intellij.openapi.vfs.VfsUtilCore)1 ManagingFS (com.intellij.openapi.vfs.newvfs.ManagingFS)1 GlobalSearchScope (com.intellij.psi.search.GlobalSearchScope)1 Collection (java.util.Collection)1 Set (java.util.Set)1 Collectors (java.util.stream.Collectors)1 Stream (java.util.stream.Stream)1