Consider a Clojure project with a resources folder, which contains some files and another folder called "public" holding some web-content.
I'm looking for a boot task, that compiles ClojureScript, then moves just the public directory to another directory in the global filesystem. Finally the folder should be renamed to "project-version".
The following does not work since move-files
does only work for files and not for directories. However, I think it clarifies the idea:
(def project-name "My")
(def project-version "0.1.0")
(deftask store-web-dir []
(let [dir-name (format "%s-%s" project-name project-version)]
(comp
(cljs :optimizations :advanced)
(move-files :files {"public" dir-name}) ;; should rename the dir public to ..
(copy :output-dir "/some/path/web_dirs"
:matching #{(re-pattern (str "^" dir-name "$"))}))))
After this, there should be a folder /some/path/web_dirs/My-0.1.0
, which contains the compiled version of all public files of the project.
sift
andtarget
might help you (boot sift -h
).I do something similar to what you describe here: https://github.com/timothypratley/voterx/blob/master/build.boot
target places the files in a specific output directory, I'm sure you could change it based on version. Something like
(str "public" +version+)
In summary, doing it outside of the cljs build itself is probably the ticket.