The problem manifests when you want to shield team users from underlying gradle build scripts. They shold just work with Eclipse projects the usual way - using generated Eclipse classpath and project files, checked in into SCM. When this scenario is wanted, you cannot have absolute path names in â.classpathâ files if you donât want your team users to have all the same absolute path for the projects.
So my idea was to have the Gradle cache relative to the root (or some other) project and have only relative pathes in â.classpathâ files. This is possible when you hook into eclipse generation âwhenMergedâ. Here we can replace the entry path on nodes with kind âlibâ with a relative name. But: the same thing is not possible by API when you want to replace the value of attribute âsourcepathâ (the path to downloaded source jars) ; this value is only readable, not writeable.
Is there any solution? Or do we have to write a task with takes the generated â.classpathâ files and do the replacement the workaround way?
There is another possibility: if you use Gradle plugin for Eclipse (developed by Pivotal) you can configure it to use Gradle classpath container. Your â.classpathâ file will be significantly reduced and Eclipse will compute classpath on demand during runtime.
I am not sure why you want to shield your team from your build system and lock them with Eclipse. Probably because you want to hear âworks on my machineâ excuses.
You should be able to achieve that using withXml This hook works. But there is no API for changing the attribute âsourcepathâ of a nodeâŚ
shield your team from your build system and lock them with Eclipse Because our Application consists of an Eclipse client, Eclipse PDE is the leading system for developper; Gradle simply doesnât support a PDE build. Therefore Gradle is uses a) as the build tool running on the build server and b) as the tool for managing dependencies, as far as they are not described by PDE Manifest. Here, there is sure a nasty gap.
I found another problem with Eclipse integration using the STS-plugin. Obviously this plugin doesnât care (or does not know) about an overriden configuration of the Gradle cache (âorg.gradle.user.homeâ in gradle.properties). It simply uses Gradleâs default value of it, USER_HOME/.gradle. This is not what I have when I build on the command line with gradle where I can have the gradle cache directory near my projectâs directories. I have found no configuration option where I could set a value; it should use the rootâs project âgradle.propertiesâ anyway.
When I throw away the default gradle cache and open Eclipse with STS-plugin enabled, it will immediately download all 3rd party jars from our repository and put it into default gradle cache (saying after 8 minutes: âBUILD SUCCESSFULâ).
So for me the question is at the moment: should I use STS-plugin in Eclipse at all? What can I gain from it? After all, within Eclipse we have to build with Eclipse PDE Compiler.