Welcome! Please see the About page for a little more info on how this works.

0 votes
ago in Clojure CLI by

Following the existing example:

https://clojure.org/reference/clojure_cli#deps_prep

{:paths ["src" "target/classes"]
 :deps/prep-lib
 {:ensure "target/classes"
  :alias :build
  :fn compile-java}}

How does one control cache invalidation? i.e. if any .java file has been added or modified, a compilation should be re-triggered.

The linked doc says:

:ensure - directory existence determines whether prep is needed

It seems to me that only the existence of a directory may not be sufficient to determine if a lib is 'prepped?' One might want to add a custom function, for instance.

This use case is particularly painful in monorepos, where a given sub-project may depend on a sibling project's java classes.

There's the option of wrapping things with babashka, which worked well for me, however it is surprising that standalone tools.deps appeared to be insufficient for this use case.

Please log in or register to answer this question.

...