We have some projects in our multiproject gradle build which actually represent Eclipse plugins. We compile and build them simply by normal classpath dependencies resolution, that is: declaring the needed target platforms jars as dependencies. This works well, even if this is not the strictly Eclipse way. But we do not have to care at build time, because the Eclipse way is handled at development time by our brave developers.
My problem is generating the correct â.classpathâ files for PDE based projects. This means: the classpath entries must not list any jars from the Gradle seen dependencies. Instead it just should have this entry:
But I donât know what to do if I want to get rid of the Eclipse target platform jars. And, of course, entries with âkind=âsrcââ etc. must be kept. Do you have an example how to handle it?
The full Gradle distribution has some small samples. Additionally, itâs worth checking out examples on the usage of Groovyâs âXmlParserâ, which this is based on.
There are several possible hooks where you can add your code to modify the way how classpath is generated. They are described in user guide and included is an example that removes some entries - you surely will find how to test what entries should stay and what needs to be removed based on their type and path. See http://www.gradle.org/docs/current/userguide/eclipse_plugin.html#N13F14