Search in sources :

Example 1 with JpsOsmorcModuleExtension

use of org.jetbrains.osgi.jps.model.JpsOsmorcModuleExtension in project intellij-plugins by JetBrains.

the class OsmorcBuildTarget method computeRootDescriptors.

@NotNull
@Override
public List<BuildRootDescriptor> computeRootDescriptors(JpsModel model, ModuleExcludeIndex index, IgnoredFileIndex ignoredFileIndex, BuildDataPaths dataPaths) {
    List<BuildRootDescriptor> rootDescriptors = ContainerUtil.newArrayList();
    JpsOsmorcModuleExtension extension = JpsOsmorcExtensionService.getExtension(getModule());
    if (extension != null) {
        File file = extension.getBundleDescriptorFile();
        if (file != null) {
            rootDescriptors.add(new BuildRootDescriptorImpl(this, file, true));
        }
    }
    JpsJavaExtensionService.dependencies(getModule()).recursively().productionOnly().processModules(module -> {
        if (module == getModule() || JpsOsmorcExtensionService.getExtension(module) == null) {
            File root = JpsJavaExtensionService.getInstance().getOutputDirectory(myModule, false);
            if (root != null) {
                rootDescriptors.add(new BuildRootDescriptorImpl(this, root, true));
            }
        }
    });
    return rootDescriptors;
}
Also used : BuildRootDescriptorImpl(org.jetbrains.jps.builders.impl.BuildRootDescriptorImpl) JpsOsmorcModuleExtension(org.jetbrains.osgi.jps.model.JpsOsmorcModuleExtension) File(java.io.File) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

File (java.io.File)1 NotNull (org.jetbrains.annotations.NotNull)1 BuildRootDescriptorImpl (org.jetbrains.jps.builders.impl.BuildRootDescriptorImpl)1 JpsOsmorcModuleExtension (org.jetbrains.osgi.jps.model.JpsOsmorcModuleExtension)1