enhancing classpath before runner runs.
Hi,
since IDEA is not capable of supplying extra jars on runner configuration, i thought about writing a plugin. I ve read a little bit about the ecosysstem and would love to hear feedback if this is the correct route. Especially then classpath enhancement path.
1) define extension as in:
<extensions defaultExtensionNs="com.intellij">
<RunConfigurationBeforeRunProviderDelegate implementation="MyTestPackage.MyTestExtension" />
</extensions>
2) implement RunConfigurationBeforeRunProviderDelegate.java Interface
When implementing this interface, i am getting a ExecutionEnvironment object passed into the beforeRun() method, which i need to implement.
Is it possible at all to mock with the classpath somewhere in ExecutionEnvironment object? Since this is a void method, i suspect that the runner itself uses this object passed by reference.
Is the ExecutionEnvironment prefilled with all the stuff which IDEA evaluated? Meaning.. current classpath based on the IDE libraries / gradle / maven whatever setting.
3) Are there any examples how to configure a plugin (extension) setting panel so that i can enter some rules for classpath mockery?
Thanks for infos and if thats the way i could go.
Note: One shouldnt need to write a plugin for basic IDE functionality like this ;-)
Please sign in to leave a comment.
Ok. Built somethng but i dont get called by the extension hooks. This is my plugin.xml
The action works without a problem. But i cant hook into the runner process via extensions. I tried two extension points with dummy implmementations who only print out stuff. Neither of them work.
My testcase is simple: just create a "Application" Runner and execute the runner. Normally i should see my system.println from the extension.
Thanks for hints.
Just tried to create and test runConfigurationExtension (from IDEA 19.1, Gradle build, Debug mode), and it works fine for me - debugger stops at both isApplicableFor() and updateJavaParameters() methods, System.out prints to the console of the first IDE. Maybe there is something wrong with your implementation or deployment.
.