Slightly related to a question yesterday… I Have a project with mixed Java and Clojure. I used to have the Java code as a separate project which made the use by non Clojure people very easy - they could just clone the repo and type clj -M:run. Now they have to manually compile the Java - I have it so that clj -T:compile-Java does that but it’s still an extra step. If this is used as a git library then I can use prep lib so that this step happens automatically. Is there a way of doing that for -X or -M when running from CLI?
Your -X or -M could maybe include the current project as a local lib and thus trigger the build? Not sure if that would work
Thanks Alex. I couldn't get this to work. For simplicity I might move it back out as a private dep I publish to a public repository so it is just pulled in, as even if it used the same machinery as prep lib, it is still an extra step, which is not a big deal, but off putting for those who don't understand Clojure/the build process.
It's only a slight issue in that running using the Clojure CLI takes one extra step than using a pre-built jar. If I add the current project as it's own local dependency, the CLI does complain about the library needing prepping, but asking for it to be prepped doesn't work as the presence of the local dep means the 'not prepped' message is returned, or one doesn't include that alias and so no prepping is done. Arguably I'd like to run the compile step as part of my run alias in some form of prep-alias mechanism, but it seems simpler for me to a) make the compile step explicit in my README or b) switch back to building my Java code using maven as a separate artefact and using that as a simple dependency.
yeah, appreciate the feedback