I have a project that uses a custom proprietary format to build and deploy solutions (its a third party application that we’re using). The vendor did provide eclipse RCP based Ant tasks that I was able to link with Gradle and build process works fine.
However, as the last step in the build process, the task tries to connect to vendor’s repository using settings in a properties file. In normal situations when running their utilities or programs from command line/Eclipse, the recommended way is to add the folder containing the properties file to the classpath. They do not have an API where you can specify the location of the properties file and load it directly.
I am slightly lost as how to achieve this using Gradle. From reading documentation and searching through forms, it seems that the plugin itself cannot modify the classpath. So that is ruled out.
I tried adding the folder (and even the file) to dependencies using compile and rutime files() option but it didnt help. I tried to add the folder to buildscript dependencies section, but that didnt help’ either.
I am considering a few options, but would like to get some advice from the experts as to what is the best/recommended way:
I can potentially deploy the properties file as jar and let gradle resolve the dependency. The downside is (maybe not) that we’ll have to maintain different versions of jars across different environments as settings are environment specific.
Use a filter mechanism to bundle an environment specific jar with the project when it is built for each environment.
Somehow figure out a way to set classpath for the plugin/script while its executing that task either via command line options/environment variables etc. The upside is, very little config/code.
What do you guys recommend? What is the best way?