How to determine project classpath / dependencies in custom plugin

I'm trying to create a plugin that calls another executable via ProcessBuilder.
I want to pass the classpath as a commandline argument but I don't know how to obtain it, ie. in Eclipse External Tools Configuration I can use ${project_classpath:MyProject} and ${workspace_loc:/MyProject/res} for this.

Does anyone know how to
- get or create the classpath from the project
- determine the location of the plugin when loaded in the environment (I use System.getProperty("idea.plugins.path"), is this also set outside of IntelliJ plugin environment?)
- can i determine the configured jdk of the project programmatically?

Thanks for your help
Klaus

1 comment
Comment actions Permalink


I think you want to have a look at how the JUnit and Cucumber run configurations works.
What you need is:

1. A configuration producer, this will determine if a new configuration has to be created or an existing one (even a temporary one) can be reused.
2. Some UI stuff (a form)
3. A Run Configuration. This is where the heavy lifting takes place.

I implemented a version for FitNesse here: https://github.com/gshakhn/idea-fitnesse/tree/master/src/main/scala/fitnesse/idea/run

Hope this helps,

Arjan

0

Please sign in to leave a comment.