Class IntellijPluginUtils

java.lang.Object
uno.anahata.asi.intellij.internal.IntellijPluginUtils

public final class IntellijPluginUtils extends Object
Utility class for introspecting the IntelliJ IDEA runtime and assembling the full plugin classpath.

Mirrors the dependency resolution architecture of NetBeansModuleUtils by dynamically discovering the plugin descriptor, recursively traversing declared plugin dependencies (such as the IntelliJ Platform, Java plugin, Maven integration, and Terminal support), and aggregating all required library JARs without hardcoding specific paths or IDs.

Author:
anahata
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static String
    Cached classpath string for the IntelliJ plugin runtime environment.
    static final String
    The official plugin ID of the Anahata ASI IntelliJ integration.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
    Private constructor to prevent instantiation of this utility class.
  • Method Summary

    Modifier and Type
    Method
    Description
    static String
    Assembles the complete runtime classpath by traversing the plugin descriptor and its declared dependencies, the IntelliJ Platform core libraries, and the system classpath.
    private static void
    collectPluginJars(com.intellij.ide.plugins.IdeaPluginDescriptor descriptor, Set<com.intellij.openapi.extensions.PluginId> processedPlugins, Set<String> paths)
    Recursively traverses a plugin descriptor and its declared dependencies, collecting all packaged JAR files from each plugin's lib directory.
    static String
    Returns the comprehensive classpath string for the Anahata ASI IntelliJ plugin runtime.
    static void
    Resets the cached plugin classpath, forcing re-resolution on subsequent accesses.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • PLUGIN_ID

      public static final String PLUGIN_ID
      The official plugin ID of the Anahata ASI IntelliJ integration.
      See Also:
    • cachedAnahataAsiPluginClasspath

      private static String cachedAnahataAsiPluginClasspath
      Cached classpath string for the IntelliJ plugin runtime environment.
  • Constructor Details

    • IntellijPluginUtils

      private IntellijPluginUtils()
      Private constructor to prevent instantiation of this utility class.
  • Method Details

    • getFullAnahataAsiPluginClasspath

      public static String getFullAnahataAsiPluginClasspath()
      Returns the comprehensive classpath string for the Anahata ASI IntelliJ plugin runtime. The result is cached after the first computation.
      Returns:
      the fully assembled classpath string separated by File.pathSeparator.
    • resetCachedPluginClasspath

      public static void resetCachedPluginClasspath()
      Resets the cached plugin classpath, forcing re-resolution on subsequent accesses.
    • buildFullPluginClasspath

      public static String buildFullPluginClasspath()
      Assembles the complete runtime classpath by traversing the plugin descriptor and its declared dependencies, the IntelliJ Platform core libraries, and the system classpath.
      Returns:
      the combined classpath string.
    • collectPluginJars

      private static void collectPluginJars(com.intellij.ide.plugins.IdeaPluginDescriptor descriptor, Set<com.intellij.openapi.extensions.PluginId> processedPlugins, Set<String> paths)
      Recursively traverses a plugin descriptor and its declared dependencies, collecting all packaged JAR files from each plugin's lib directory.
      Parameters:
      descriptor - the plugin descriptor to inspect.
      processedPlugins - set of already visited plugin IDs to prevent circular dependency loops.
      paths - the accumulator set for resolved JAR file paths.