Search in sources :

Example 1 with ConfigFileInfoSet

use of com.intellij.util.descriptors.ConfigFileInfoSet in project intellij-plugins by JetBrains.

the class Struts2ProjectDescriptorBuilder method configureModule.

@Override
public void configureModule(@NotNull Module module, @NotNull ModifiableRootModel model, @NotNull ContentEntry contentEntry) {
    super.configureModule(module, model, contentEntry);
    if (addStrutsLibrary) {
        BasicLightHighlightingTestCase.addStrutsJars(module, model);
    }
    if (addJ2eeLibrary) {
        PsiTestUtil.addLibrary(module, model, "JavaEE", PathManager.getHomePath() + "/lib/", "javaee.jar", "javase-javax.jar");
    }
    for (LibraryDefinition library : libraries) {
        BasicLightHighlightingTestCase.addLibrary(module, model, library.groupId, library.artifactIds);
    }
    final WebFacet webFacet = FacetUtil.addFacet(module, WebFacetType.getInstance());
    if (addStrutsFacet) {
        FacetManager.getInstance(module).addFacet(StrutsFacetType.getInstance(), "struts2", webFacet);
    }
    if (webXmlUrl != null) {
        final VirtualFile root = model.getSourceRoots()[0];
        webFacet.addWebRoot(root, "/");
        final ConfigFileInfoSet descriptors = webFacet.getDescriptorsContainer().getConfiguration();
        descriptors.addConfigFile(DeploymentDescriptorsConstants.WEB_XML_META_DATA, webXmlUrl);
        for (String url : ModuleRootManager.getInstance(module).getSourceRootUrls()) {
            webFacet.addWebSourceRoot(url);
        }
    }
    for (Callback callback : callbacks) {
        callback.configureModule(module, model, contentEntry);
    }
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) ConfigFileInfoSet(com.intellij.util.descriptors.ConfigFileInfoSet) WebFacet(com.intellij.javaee.web.facet.WebFacet)

Aggregations

WebFacet (com.intellij.javaee.web.facet.WebFacet)1 VirtualFile (com.intellij.openapi.vfs.VirtualFile)1 ConfigFileInfoSet (com.intellij.util.descriptors.ConfigFileInfoSet)1