0


I am doing a prototype of a specific feature, which in turn uses a higher Gradle version than our project uses (we are migrating, but will take time). So I have a separate gradle wrapper but in order to complete the task I need to refer to lots of compile dependencies in root project (I have nested my prototype folder like this):

root (multi-project build)
  |-- build.gradle
  |-- moduleA
  |-- moduleB
  |-- buiidSrc
  |---prototype
        |--technologyA (has separate build.gradle and wrapper due to Gradle version requirement)
        |--technologyB 

Basically I want to test various technologies that's why I don't have a build.gradle at the root of 'prototype' folder. Now I want to refer moduleA etc. in technologyA project as compile dependency, so I use the standard way to refer to external project dir (using

include 'root'`
project(':root').rootDir = new File(path to root)`

in settings.gradle but since my root project has a buildSrc, things get complicated. This buildSrc is not invoked when I build technologyA project and hence build does not find its dependencies. How to solve this?

Thanks,
Padmanabhan (Paddy)

Paddy
  • 3,472
  • 5
  • 29
  • 48
  • If `technologyA` is its own build, the only way to reuse the parent dir's `buildSrc` is to set a symlink. It might be better to do experiments on a separate branch, rather than in a separate dir/build. – Peter Niederwieser Nov 24 '14 at 13:22
  • Hi @Peter, even if I were to try a sdparate branch, I would still have to refer the root project dependencies, and secondly as I wish to try out many things, I think that the nested folder structure for prototypes is also OK or atleast explainable if I may so, which brings me to the same problem anyway, isn't it? – Paddy Nov 25 '14 at 04:55
  • I wouldn't go for that structure. If you do, you'll have to work around with a symlink as I described, and there might be other hurdles. – Peter Niederwieser Nov 25 '14 at 14:50
  • Hi @Peter, we are in the process of upgrading our existing project to JAva 8/Gradle 2.1. So that is going to take time. I however have to continue working with the prototype and that is why I came up with this separate dir with separate Gradle but still depending on root project. So can you explain a bit about your idea where you suggest a separate branch? Are you suggesting my prototype dir structure itself be changed, and if yes how? If you can explain a bit more, I can try your suggestion and see how it goes. Thanks, Paddy – Paddy Nov 26 '14 at 04:28

0 Answers0