Fork me on GitHub

Hey there, I'm trying to output a string of edn to stdout via clj -T... and for some reason I can't get the namespace to load. I feel like there's something simple I'm missing. Can anyone spot it? deps.edn aliases

:aliases {:jib-config {:replace-paths ["dev/tools"]
                       :exec-fn tools.skaffold/get-skaff-config}}
(ns tools.skaffold)

(defn get-skaff-config [_]
  (with-out-str (clojure.pprint/pprint {:x 1 :y -1})))
❯ clj -T:jib-config
Namespace could not be loaded: tools.skaffold


-X yields the same results

❯ clj -X:jib-config
Namespace could not be loaded: tools.skaffold

Alex Miller (Clojure team)17:03:16

you want :replace-paths ["dev"]

Alex Miller (Clojure team)17:03:42

the namespace (tools.skaffold) is relative to the path (dev) - those get put together


So paths can only be root folders?


I also have dev/user.clj which takes sometime to load and has some extra stdout, which is why I was trying to avoid it.

Alex Miller (Clojure team)17:03:35

yes, that's how the JVM classpath works

Alex Miller (Clojure team)17:03:59

you could put one of these things under another root of course


Gotcha, thanks. Yeah still pretty new to the JVM

Alex Miller (Clojure team)17:03:36

namespace is munged into a resource path, then that resource path is checked relative to each classpath location

Alex Miller (Clojure team)17:03:53

tools.skaffold => tools/skaffold.clj => look for that in dev/ (and other locations)


Gotcha, thanks, makes sense