Search in sources :

Example 6 with ModuleExcludeIndexImpl

use of org.jetbrains.jps.indices.impl.ModuleExcludeIndexImpl in project intellij-community by JetBrains.

the class ModuleExcludeIndexTest method testContentRootUnderExcluded.

public void testContentRootUnderExcluded() {
    File contentRoot = new File(myRoot, "project");
    File excluded = new File(contentRoot, "exc");
    File unexcluded = new File(excluded, "src");
    JpsModule module = addModule();
    addContentRoot(module, contentRoot);
    addExcludedRoot(module, excluded);
    addContentRoot(module, unexcluded);
    assertNotExcluded(contentRoot);
    assertExcluded(excluded);
    assertNotExcluded(unexcluded);
    ModuleExcludeIndexImpl index = createIndex();
    assertFalse(index.isExcludedFromModule(contentRoot, module));
    assertTrue(index.isExcludedFromModule(excluded, module));
    assertFalse(index.isExcludedFromModule(unexcluded, module));
}
Also used : JpsModule(org.jetbrains.jps.model.module.JpsModule) ModuleExcludeIndexImpl(org.jetbrains.jps.indices.impl.ModuleExcludeIndexImpl) File(java.io.File)

Example 7 with ModuleExcludeIndexImpl

use of org.jetbrains.jps.indices.impl.ModuleExcludeIndexImpl in project intellij-community by JetBrains.

the class ModuleExcludeIndexTest method testInnerModuleUnderExcludedRoot.

public void testInnerModuleUnderExcludedRoot() {
    File outerRoot = new File(myRoot, "outer");
    File exc = new File(outerRoot, "exc");
    File innerRoot = new File(exc, "inner");
    JpsModule outer = addModule("outer");
    addContentRoot(outer, outerRoot);
    addExcludedRoot(outer, exc);
    JpsModule inner = addModule("inner");
    addContentRoot(inner, innerRoot);
    assertNotExcluded(outerRoot);
    assertNotExcluded(innerRoot);
    assertSameElements(getModuleExcludes(outer), exc, innerRoot);
    assertEmpty(getModuleExcludes(inner));
    ModuleExcludeIndexImpl index = createIndex();
    assertTrue(index.isExcludedFromModule(innerRoot, outer));
    assertFalse(index.isExcludedFromModule(innerRoot, inner));
}
Also used : JpsModule(org.jetbrains.jps.model.module.JpsModule) ModuleExcludeIndexImpl(org.jetbrains.jps.indices.impl.ModuleExcludeIndexImpl) File(java.io.File)

Aggregations

ModuleExcludeIndexImpl (org.jetbrains.jps.indices.impl.ModuleExcludeIndexImpl)7 BuildDataPathsImpl (org.jetbrains.jps.builders.impl.BuildDataPathsImpl)4 BuildRootIndexImpl (org.jetbrains.jps.builders.impl.BuildRootIndexImpl)4 BuildTargetRegistryImpl (org.jetbrains.jps.builders.impl.BuildTargetRegistryImpl)4 BuildDataPaths (org.jetbrains.jps.builders.storage.BuildDataPaths)4 ModuleExcludeIndex (org.jetbrains.jps.indices.ModuleExcludeIndex)4 IgnoredFileIndexImpl (org.jetbrains.jps.indices.impl.IgnoredFileIndexImpl)4 File (java.io.File)3 IOException (java.io.IOException)3 BuildTargetIndexImpl (org.jetbrains.jps.builders.impl.BuildTargetIndexImpl)3 BuildDataManager (org.jetbrains.jps.incremental.storage.BuildDataManager)3 BuildTargetsState (org.jetbrains.jps.incremental.storage.BuildTargetsState)3 ProjectTimestamps (org.jetbrains.jps.incremental.storage.ProjectTimestamps)3 JpsModule (org.jetbrains.jps.model.module.JpsModule)3 ProjectDescriptor (org.jetbrains.jps.cmdline.ProjectDescriptor)2 BuildFSState (org.jetbrains.jps.incremental.fs.BuildFSState)2 CompilerMessage (org.jetbrains.jps.incremental.messages.CompilerMessage)1 JpsModel (org.jetbrains.jps.model.JpsModel)1