We have 2 projects, one that depends on the other. They need to be versioned separately, so they each have their own repository and are their own gradle project. Here’s a code example:
group = 'net.ll86'
project = 'foo'
version = '2.1.2-SNAPSHOT'
apply plugin: 'java'
project = 'bar'
version = '2.1.1-SNAPSHOT'
apply plugin: 'java'
dependencies {
compile 'net.ll86:foo:2.1.2-SNAPSHOT'
}
I’ve experimented with a couple workflows. Here are some ideas I’ve tried:
/* Using code tags b/c I can’t figure out nested lists
-
using mavenLocal():
-
apply plugin ‘maven’ to project foo
-
add mavenLocal() to the repositories list for bar
-
when there’s a change in foo I run ./gradlew build install for foo, and ./gradlew build --refresh-dependencies for bar (takes a long time)
- using eclipse:
-
apply plugin ‘eclipse’ to project foo and bar
-
run ./gradlew eclipse on each project
-
import the generated eclipse projects
-
configure the bar eclipse project by hand to include the foo eclipse project
-
*/
The eclipse method is less than ideal because I need to make sure the gradle build passes before I commit the code. Do you have any other suggestions for this type of workflow?
Thanks in advance!
Joe