Support build-time dependencies for jank-build.bb scripts.#809
Conversation
|
This looks great. I will ask technomancy if he sees any issue with the scope usage for build deps. |
9a95df6 to
6173442
Compare
| (do | ||
| (lmain/warn "No :main entrypoint for project.") | ||
| (lmain/exit 1))))) | ||
| (lmain/warn "No :main entrypoint for project.")))) |
There was a problem hiding this comment.
Got rid of the exit calls here because some standard lein tasks call out to these unconditionally. For example lein install seems to always lein compile (that makes sense for building JVM JARs). In our case, if a library does not have a main, this will cause lein install to abort, which we don't want.
| [{:op :extract-src | ||
| :dep dep | ||
| :jar (str src-jar) | ||
| :fprint (fingerprint-file src-jar) |
There was a problem hiding this comment.
There is a bit more to figure out with the fingerprinting to make sure rebuilds trigger whenever something changes. Consider this a mostly functional placeholder for now.
It's nice because the scope fits into the standard leiningen dependency tree functionality, so we can easily pick out build dependencies without any additional code. But if it's a no-go then we can implement our own logic to read the dependencies' project.clj and pull out the build-dependencies key. |
|
This is ready for review. I shoehorned some other improvements into this same PR, but they are somewhat organized as separate commits. |
|
I asked technomancy and some others, on IRC, and heard back that our usage of dependency scopes here should be just fine. |
jeaye
left a comment
There was a problem hiding this comment.
Looks great to me! Just hoping to get the tests into CI.
| @@ -0,0 +1,78 @@ | |||
| (ns leiningen.jank.integration-test | |||
There was a problem hiding this comment.
Would you mind hooking this into CI for this PR? I think we'll need a new job for the lein-jank project. Maybe .github/workflows/test-lein-jank.yml.
Otherwise, I'll never remember to run this.
Adds support for build dependencies: dependencies for your
jank-build.bbscript. For example, a commonjank-build-cmakelibrary which includes helpers for executing CMake, to be used by alljank-build.bbscripts in the wild which drive a CMake build.This mimics the Cargo build-dependencies feature.
I have updated my lein-jank-playground to demo this:
:build-dependenciesentry in its project.clj filejank-build.bbfileAlso includes some misc. fixups and some integration tests for the build system.
TODO
Validate (build?)-dependencies-of-build-dependencies behaviorjank-buildwill cause any problems down the line