I’m in the process or setting up an automated build-test-publish cycle for my Java project with Gradle and Jenkins. AppTestFramework is a utility that I’ve written for recording, scripting, and replaying tests. It has some compile-time dependencies on App. App’s JUnit tests in turn run tests using the AppTestFramework.
App’s build.gradle:
dependencies {
...
testCompile("org.kylewm:AppTestFramework:latest.integration")
}
AppTestFramework’s build.gradle:
dependencies {
compile("org.kylewm:App:latest.integration")
}
I don’t know if I should describe this as a circular dependency exactly because I could split it up into three projects:
- App
- AppTestFramework depends on App
- AppUnitTests depends on App, AppTestFramework
I’d prefer to keep them as separate projects. If they have to be subprojects of another build.gradle, that would be OK, though I’d like to avoid it if I have any alternatives. Thanks!
Devil’s advocate: why do you want to have them as separate projects, if the code is tightly coupled?
One solution could be to keep one single project but produce several JARs so that other projects can import
app.jarandapp-testsupport.jar