This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-11-16
Channels
- # aleph (1)
- # aws (1)
- # beginners (23)
- # boot (33)
- # cider (15)
- # cljs-dev (4)
- # clojure (73)
- # clojure-dev (18)
- # clojure-italy (8)
- # clojure-russia (7)
- # clojure-serbia (1)
- # clojure-spec (8)
- # clojure-uk (118)
- # clojure-ukraine (3)
- # clojurescript (34)
- # code-art (1)
- # community-development (24)
- # cursive (21)
- # data-science (3)
- # datomic (72)
- # defnpodcast (1)
- # fulcro (77)
- # graphql (4)
- # hoplon (8)
- # jobs (3)
- # luminus (3)
- # lumo (7)
- # off-topic (3)
- # onyx (17)
- # other-languages (7)
- # pedestal (1)
- # perun (1)
- # protorepl (21)
- # re-frame (91)
- # ring (4)
- # ring-swagger (18)
- # shadow-cljs (22)
- # spacemacs (37)
- # specter (1)
- # sql (23)
- # test-check (4)
- # unrepl (29)
- # utah-clojurians (3)
- # vim (36)
- # yada (10)
@seancorfield if I wanted it the other way round, so I could aot, how would I do that?
Open an issue for an option to control the mapping? But, TBH, I don't understand why you wouldn't have "src"
in :resource-paths
in Boot, so you'll need to explain the use case in better detail.
My understanding is that the use case is full AOT, where you don't want clj in the resulting jar
So you'd want :paths []
and :extra-paths ["src"]
in deps.edn
for that? Frankly, I wouldn't want to do anything to encourage AOT. It's so problematic.
source paths get processed, and don't go into target. resource paths may be processed, and do end up in target.
I'm struggling to pass data in the boot pipeline, I've tried setting atom in let binding and reset! it to be read in the next task sequence, but the atom isn't mutated when its dereferenced, and also do a let binding
(deftask x []
(comp
(task1)
(with-pass-thru _
(let [data-i-need (fn)]
(comp (task2 data-i-need)
(task3 data-i-need)))
(task4)))
but it just wont run task2 and task3 in this example. The binding _
in with-pass-thru, is only fileset, I guess it's not possible to pass it just clojure data to be read be subsequent tasks?so what I'd love to be able to do would be something like this
(deftask a []
(with-pass-thru x
(assoc x :data "wow")))
(deftask b []
(comp (a)
(with-pass-thru x
(prn (get x :data)))))
boot b
and print "wow"that's an intriguing idea -- i wonder if there is some place in the fileset where we can hang arbitrary data
What we do is add things to the Boot environment: (set-env! :worldsingles/some-symbol some-value)
in one place and (get-env! :worldsingles/some-symbol)
in another. Using namespace'd keywords to avoid conflicts /cc @hlolli
(vary-meta fileset #(assoc % :my-data "wow"))
& (:my-data (meta fileset))
, this is used by Perun
@seancorfield ans @juhoteperi thanks for these helpful tips. I may change my code to either of these solutions, but I ended up spitting and slurping into the target directory, has the added benefit of being able to continue with other tasks when one fails. But it's not pretty and potentially doesn't describe the "truth" when there are source code changes.
Fileset can also have metadata related to the files: https://github.com/boot-clj/boot/blob/master/boot/core/src/boot/core.clj#L640
This is used for example by boot-cljs/reload to store warnings/exceptions with the .cljs.edn
file
Yeah, I'm just gun shy of metadata in general. If it's the "official, supported way" of doing that sort of thing in Boot, that's good to know. I can look at changing how we deal with passing information between tasks from the environment to the metadata -- if it makes sense.
Attaching metadata to files with add-meta
is supported, attaching directly to fileset is not official
Hello, boot friends. I’m writing a boot library for internal company use which provides tasks for deploying things to our infrastructure. That part’s going nicely, so now I’m looking to see how I might also use it to inject our internal maven wagon and repositories into a boot project.
Absent such a library, a boot file would would contain something like (set-env! :repositories #(concat % [["releases" {:url "
. How, if at all, would it be recommended for boot libraries to set such environment values in a boot file that requires them? Obvious options would seem to include: at ns load time or by providing a fn to call.
donaldball one thing i considered but never did was 2 set-env! calls. i think it's competitive with 'managed dependencies' maven concept
i.e. one set-env! adds a dependency that contains clj code for loading more dependencies
oh, and i think we now support managed dependencies
i think most of this is applicable (we have the :managed-dependencies set-env! key) http://127.0.0.1:8080/
That is cool and I might have uses for that but I don’t think it addresses my question? I think I’m trying to figure out how, if at all, boot libraries can supply env! values, not introduce dependencies
Oh that’s actually looks useful. I use a task like this https://github.com/nha/boot-deps/blob/master/src/nha/boot_deps.clj#L159 when I add a new dependency, which usually adds a lot of :exclusions to it, and then I still have to sometimes pin a specific dependency version, even if I don’t use it directly.
Open an issue for an option to control the mapping? But, TBH, I don't understand why you wouldn't have "src"
in :resource-paths
in Boot, so you'll need to explain the use case in better detail.
What we do is add things to the Boot environment: (set-env! :worldsingles/some-symbol some-value)
in one place and (get-env! :worldsingles/some-symbol)
in another. Using namespace'd keywords to avoid conflicts /cc @hlolli
(vary-meta fileset #(assoc % :my-data "wow"))
& (:my-data (meta fileset))
, this is used by Perun
@juhoteperi Interesting. I'm always a little nervous of using metadata because so many operations cause it to "evaporate"...
Fileset can also have metadata related to the files: https://github.com/boot-clj/boot/blob/master/boot/core/src/boot/core.clj#L640
Hamming my head against a wall. I try for hours now to create a task to pack html and images in gui/dist into resources/public. Most boot file commands relate to files. Any idea how to do this with directories?
@usenet the sift
task has a move/rename option but it depends a bit on whether you want to copy your files to your actual resources/public directory or the target/public directory that is eventually emitted when you use the target
task