I’m wondering how people develop day-to-day with Gradle and how they manage in-house dependencies.
Let’s say we have a main project with the following in-house dependencies:
proj depends on dep1
proj depends on dep2
proj depends on dep3
Now, these dependencies also may depend on one another:
dep1 depends on dep2, dep3
I want to be able to basically develop them simultaneously, where I
have a main project(proj) and all it’s depencies (dep1, dep2, dep3) open
in, say, IntelliJ or some other IDE. That way, when code in one project
changes, I can tell the IDE to build and run and it will take care of
building the dependencies for me. Also, the code is evolving rather
rapidly and this allows me to immediately see where I’ve made certain
errors between projects.
Right now, in the build.gradle file for proj, I have something like the following for dependencies:
dependencies {
compile project('ext:dep1')
compile project('ext:dep2')
compile project('ext:dep3')
compile group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.3'
compile group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.3'
testCompile group: 'junit', name: 'junit', version: '4.11'
}
where the other dependent projects are checked out from source
control into $proj/ext/dep[1…3]. This is great and all, but then I have
to worry about dep1 and its dependencies. Now I could do the same kind
of thing recursively where dep1 would also have dep2 and dep3 checked
out into $proj/ext/dep1/ext/dep[2…3], but then dep1 would not be
updated when I update $proj/ext/dep[2…3].
I feel like this could be something that is fixed maybe with a
symlink or something, but I’m wondering if I’m just way off the mark on
how day-to-day development should go.
This could also be solved by having a binary repository (Archiva,
Nexus, etc.), but I feel like the process of building a dependency,
pushing to the repository, then having Gradle download it during the
build process is too complex for what it is. Not to mention this would
involve having a separate IntelliJ window open for every project and
dependency, whereas with the scenario described above, it’s 1 window
with dependency projects open. I also don’t get the benefit of knowing
immediately when I have an issue.
I want to keep this as generic as possible so that any other
developer could clone this repo and instantly be ready to go without
having to make sure the paths line up relative to their situation.
Anyone else have this problem?