dkandalov/live-plugin — pull request #45 by cr7pt0gr4ph7 (2014-11-27 17:51:15+00:00)
Title: Add a depends-on-plugin directive to be able to extend other plugins

Because IntelliJ IDEA uses separate ClassLoaders to isolate plugins from each other, we have to tell it explicitly which plugins should be visible to our plugin. With normal plugins, the `` element in `plugin.xml` is used for this.

To enable the same for live plugins, I added a directive `depends-on-plugin`, which has a syntax similar ot `add-to-classpath`. It is used like this:

```groovy
// Groovy and Scala:
// depends-on-plugin Pythonid
```
```lisp
; Clojure:
; depends-on-plugin Pythonid
```

The directive causes the class loader for the script to also search the class loaders of the plugins it depends on. For Groovy and Clojure, this works without issues.

A workaround was required for Scala, because it requires the classes to also be present on the compile-time classpath. To achieve this, the new code just adds all JARs for all available plugins to the classpath of the Scala script.
At runtime, though, the ClassLoader is used to retrieve the classes from the correct plugin ClassLoaders, like it is done for Groovy and Clojure.