use of com.intellij.openapi.compiler.options.ExcludeEntryDescription in project intellij-community by JetBrains.
the class ExcludeFromStubGenerationAction method doExcludeFromStubGeneration.
public static void doExcludeFromStubGeneration(PsiFile file) {
final VirtualFile virtualFile = file.getVirtualFile();
assert virtualFile != null;
final Project project = file.getProject();
final GroovyCompilerConfigurable configurable = new GroovyCompilerConfigurable(project);
ShowSettingsUtil.getInstance().editConfigurable(project, configurable, () -> configurable.getExcludes().addEntry(new ExcludeEntryDescription(virtualFile, false, true, project)));
}
use of com.intellij.openapi.compiler.options.ExcludeEntryDescription in project intellij-community by JetBrains.
the class ResourceCopyingTest method testCopingNonMavenResources.
public void testCopingNonMavenResources() throws Exception {
if (ignore())
return;
createProjectSubFile("src/resources/a.txt", "a");
VirtualFile configDir = createProjectSubDir("src/config");
createProjectSubFile("src/config/b.txt", "b");
createProjectSubFile("src/config/JavaClass.java", "class JavaClass {}");
// *.xxx is excluded from resource coping, see setUpInWriteAction()
createProjectSubFile("src/config/xxx.xxx", "xxx");
final VirtualFile excludedDir = createProjectSubDir("src/excluded");
createProjectSubFile("src/excluded/c.txt", "c");
importProject("<groupId>test</groupId>" + "<artifactId>project</artifactId>" + "<version>1</version>");
Module module = ModuleManager.getInstance(myProject).findModuleByName("project");
PsiTestUtil.addSourceRoot(module, configDir);
PsiTestUtil.addSourceRoot(module, excludedDir);
new WriteCommandAction.Simple(myProject) {
@Override
protected void run() throws Throwable {
CompilerConfiguration.getInstance(myProject).getExcludedEntriesConfiguration().addExcludeEntryDescription(new ExcludeEntryDescription(excludedDir, true, false, getTestRootDisposable()));
setModulesOutput(myProjectRoot.createChildDirectory(this, "output"), "project", "m1", "m2");
}
}.execute().throwException();
compileModules("project");
assertCopied("output/a.txt");
assertCopied("output/b.txt");
assertNotCopied("output/JavaClass.java");
assertNotCopied("output/xxx.xxx");
assertNotCopied("output/c.txt");
}
use of com.intellij.openapi.compiler.options.ExcludeEntryDescription 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.ExcludeEntryDescription in project intellij-community by JetBrains.
the class CompilerReferencesFindUsagesTest method testFindUsagesWithExcludedFromCompilationDirectory.
public void testFindUsagesWithExcludedFromCompilationDirectory() {
doTestRunnableFindUsagesWithExcludesConfiguration(configuration -> {
final VirtualFile dirToExclude = findClass("A").getContainingFile().getVirtualFile().getParent();
configuration.addExcludeEntryDescription(new ExcludeEntryDescription(dirToExclude, false, false, myProject));
}, 3, "Foo.java", "excluded/A.java", "excluded/child/ShouldFindHere.java");
}
use of com.intellij.openapi.compiler.options.ExcludeEntryDescription in project intellij-community by JetBrains.
the class CompilerReferencesFindUsagesTest method testFindUsagesWithRecursivelyExcludedFromCompilationDirectory.
public void testFindUsagesWithRecursivelyExcludedFromCompilationDirectory() {
doTestRunnableFindUsagesWithExcludesConfiguration(configuration -> {
final VirtualFile dirToExclude = findClass("ShouldFindHere").getContainingFile().getVirtualFile().getParent().getParent();
configuration.addExcludeEntryDescription(new ExcludeEntryDescription(dirToExclude, true, false, myProject));
}, 2, "Foo.java", "excluded/child/ShouldFindHere.java");
}
Aggregations