leiningen

N.B. The maintainers are on #leiningen on Libera chat IRC. Go there for direct support/bug reports.
bastilla 2021-04-13T16:15:54.051300Z

Hi. :clean-targets isn't really working, is it? I am working on a project generated by template. The sections goes like:

:clean-targets ^{:protect false} ["resources/main.js"
                                    "resources/public/js/ui-core.js"
                                    "resources/public/js/ui-core.js.map"
                                    "resources/public/js/ui-out"]
But lein clean never deletes these folders and files. I fail to find an official documentation, just a master sample: https://raw.githubusercontent.com/technomancy/leiningen/master/sample.project.clj which depicts a completely different structure under :clean-targets . Same as from a poor fellow on stackoverflow: https://stackoverflow.com/questions/38387800/lein-clean-temporary-output-folder So I changed it to:
:clean-targets ^{:protect false} [:target-path
                                    :output-paths ["resources/public/js/ui-out"
                                                   "resources/public/js/ui-release-out"]
                                    "resources/main.js"
                                    "resources/public/js/ui-core.js"
                                    "resources/public/js/ui-core.js.map"]
And lein clean is finally doing... Dickie McGeezack. Nadda. There is no official documetation on stuff like this? I again fail miserably to find docs on Clojure stuff. Any hints would be greatly appreciated!

2021-04-13T17:43:51.052400Z

@bastilla the best docs of lein config are in lein help sample - searching the output finds this

;; :clean-targets below lets `lein clean` remove files under "target",
  ;; "classes", "foo", "bar", "qux", and "out".
  ;; By default, will protect paths outside the project root and within standard
  ;; lein source directories ("src", "test", "resources", "doc", "project.clj").
  ;; However, this protection can be overridden with metadata on the :clean-targets
  ;; vector - ^{:protect false}

2021-04-13T17:44:18.052900Z

the wiki probably has more detail, but help sample has been my go to starting place

2021-04-13T17:46:10.053200Z

oh, you referenced the same document, OK

2021-04-13T17:46:57.053800Z

@bastilla regarding you config there, the formatting makes it look like you think that the vector after :output-paths is an argument to it?

bastilla 2021-04-16T15:27:09.078300Z

Terribly sorry for my late response. Thanks @noisesmith. Your mind reading capabilities are intact. I assumed an association where there is just a vector. Still, lein clean doesn't work, and it should with this seting. I "solved" it by putting everything in a clean.sh, and ./clean.sh is just as easy to handle. Thanks for your eyes, ears and time.

2021-04-13T17:47:48.054800Z

my understanding is that each entry is either a string for a specific path, a vector of strings for convenience, or a keyword which looks up the string or vector defined for that keyword

2021-04-13T17:48:18.055300Z

so putting :output-paths in the vector tells it to remove everything in :output-paths