Clojurephant and Gradle fail to resolve and compile transitive dependencies when using composite builds.
See original GitHub issueExpected Behavior
I expect Gradle composite builds to capture transitive dependencies for Clojure code, transitive dependencies for Clojure to Java code, and to compile all necessary Clojure code just as it does when the composite build is not used and instead the jar is downloaded from Clojars. I expect this to work even if the artifact does not yet exist on Clojars.
Current Behavior
Gradle cannot find the transitive dependencies or compile those Clojure based transitive dependencies. Of course, this works if all the dependencies are Java based dependencies with class files inside. The problem occurs when Clojure code and Clojurephant are being used. Using AOT can partially help, but still, the project will not succeed. The example project I have attached has both Clojure and Java transitive dependencies. Using AOT I can get one level of transitive dependencies. If I specify AOT for all the dependencies, that works… except for the Java dependencies. When the Clojure code depends on Java code, the Java dependencies don’t make it to Project A from Project B. See the example project and the README.md.
Context
I’m using composite builds to avoid publishing my projects to maven while debugging. Some of my projects are Clojure code with Gradle as the build tool. It would be exceptionally useful if I could debug a dependent project and use Gradle’s composite build feature to automatically and seamlessly include the changes before publishing those changes. Especially given the changes may be debugging code and not even potential fixes.
Steps to reproduce
I have attached two sample projects that work together using Gradle’s composite build feature. Execute ./gradlew run
from project-a
and observe the build fails. I would expect the build to succeed and output - among other things - “hi from b”.
Environment
- Build scan URL: https://gradle.com/s/cx7zjtxz4n4ny
- clojurephant version: 0.6.0
- Gradle 7.3.3
- java version “11.0.6” 2020-01-14 LTS
- macOS 12.5
Issue Analytics
- State:
- Created a year ago
- Comments:6 (4 by maintainers)
Glad to hear that worked for you! For future reference, I added a new doc to try to explain this. https://clojurephant.dev/clojurephant/main/explanation/dependencies.html
@jzwolak Good suggestion, I’ve added a note about this to the doc