A simple copy
task that allows boot builds to copy files from previous tasks into a specified directory.
[cpmcdaniel/boot-copy "2.0"] ;; latest release
The following examples assume you have boot installed and up to date.
If you already have a build.boot
, add the dependency above to :dependencies
and (require '[cpmcdaniel/boot-copy :refer :all])
. The build.boot file
may look like the following:
(set-env!
:source-paths #{"src/main/java" "src/main/clojure"}
:resource-paths #{"src/main/resources"}
:dependencies '[[cpmcdaniel/boot-copy "<version>" :scope "provided"]]) ;; latest version
(require '[cpmcdaniel.boot-copy :refer :all])
(task-options!
copy {:output-dir "/home/foo/backups"
:include #{#"\.jar$"}
:exclude #{#"\.bak$"}})
(deftask build
"Build my project"
[]
(comp (jar) (copy)))
The build can then be executed with boot build
or:
boot jar copy -i '\.jar$' -o /home/foo/backups
TIP: try mixing this with the boot watch
task to automatically move files when
sources change, like so:
boot watch jar copy -i '\.jar$' -o /home/foo/backups
Copyright © 2020 Craig McDaniel
Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.