Search in sources :

Example 16 with JavaSourceRootProperties

use of org.jetbrains.jps.model.java.JavaSourceRootProperties in project intellij-community by JetBrains.

the class ExternalSystemImportingTestCase method assertGeneratedSources.

private void assertGeneratedSources(String moduleName, JavaSourceRootType type, String... expectedSources) {
    final ContentEntry[] contentRoots = getContentRoots(moduleName);
    final String rootUrl = contentRoots.length > 1 ? ExternalSystemApiUtil.getExternalProjectPath(getModule(moduleName)) : null;
    List<SourceFolder> folders = doAssertContentFolders(rootUrl, contentRoots, type, expectedSources);
    for (SourceFolder folder : folders) {
        JavaSourceRootProperties properties = folder.getJpsElement().getProperties(type);
        assertNotNull(properties);
        assertTrue("Not a generated folder: " + folder, properties.isForGeneratedSources());
    }
}
Also used : JavaSourceRootProperties(org.jetbrains.jps.model.java.JavaSourceRootProperties)

Example 17 with JavaSourceRootProperties

use of org.jetbrains.jps.model.java.JavaSourceRootProperties in project kotlin by JetBrains.

the class MavenImportingTestCase method assertGeneratedSources.

protected void assertGeneratedSources(String moduleName, String... expectedSources) {
    ContentEntry contentRoot = getContentRoot(moduleName);
    List<ContentFolder> folders = new ArrayList<ContentFolder>();
    for (SourceFolder folder : contentRoot.getSourceFolders(JavaSourceRootType.SOURCE)) {
        JavaSourceRootProperties properties = folder.getJpsElement().getProperties(JavaSourceRootType.SOURCE);
        assertNotNull(properties);
        if (properties.isForGeneratedSources()) {
            folders.add(folder);
        }
    }
    doAssertContentFolders(contentRoot, folders, expectedSources);
}
Also used : JavaSourceRootProperties(org.jetbrains.jps.model.java.JavaSourceRootProperties)

Aggregations

JavaSourceRootProperties (org.jetbrains.jps.model.java.JavaSourceRootProperties)17 VirtualFile (com.intellij.openapi.vfs.VirtualFile)4 SourceFolder (com.intellij.openapi.roots.SourceFolder)3 JavaSourceRootType (org.jetbrains.jps.model.java.JavaSourceRootType)3 JpsModuleSourceRoot (org.jetbrains.jps.model.module.JpsModuleSourceRoot)3 Nullable (org.jetbrains.annotations.Nullable)2 JpsElement (org.jetbrains.jps.model.JpsElement)2 JavaResourceRootProperties (org.jetbrains.jps.model.java.JavaResourceRootProperties)2 AnalysisScope (com.intellij.analysis.AnalysisScope)1 ModuleSourceRootEditHandler (com.intellij.openapi.roots.ui.configuration.ModuleSourceRootEditHandler)1 JpsContentEntry (com.intellij.project.model.impl.module.content.JpsContentEntry)1 JpsSourceFolder (com.intellij.project.model.impl.module.content.JpsSourceFolder)1 IconActionComponent (com.intellij.ui.roots.IconActionComponent)1 File (java.io.File)1 IOException (java.io.IOException)1 NotNull (org.jetbrains.annotations.NotNull)1 Url (org.jetbrains.idea.maven.utils.Url)1 JpsElementBase (org.jetbrains.jps.model.ex.JpsElementBase)1 JpsModule (org.jetbrains.jps.model.module.JpsModule)1 JpsModuleSourceRootType (org.jetbrains.jps.model.module.JpsModuleSourceRootType)1