This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-05-21
Channels
- # aws (3)
- # beginners (98)
- # boot (18)
- # cider (6)
- # cljsrn (8)
- # clojure (56)
- # clojure-dev (11)
- # clojure-spec (3)
- # clojure-turkiye (1)
- # clojurescript (34)
- # core-async (42)
- # cursive (8)
- # datascript (79)
- # defnpodcast (2)
- # dirac (13)
- # emacs (14)
- # jobs-discuss (3)
- # onyx (27)
- # overtone (1)
- # pedestal (1)
- # protorepl (1)
- # re-frame (40)
- # reagent (5)
- # unrepl (29)
- # vim (3)
@richiardiandrea : something funky is definitely happening. to be more clear, task A generates a file of clojure code, and task B loads a clojure file that requires the namespace generated by task A. it looks like task B is trying to load that file before task A has completed.
not only that, but I emit a msg “Running task Foo” at the start of each task. all such messages are printed before either task begins. I cannot see how this could happen if boot is not doing some stuff concurrently.
even weirder: boot components index target
- the index task is running before the components task! seems to be happening because the index task starts with (set-env! :source-paths #{"src/page"})
Probably components
uses with-post-wrap
(runs the code after following tasks are run) and others use with-pre-wrap
: https://github.com/boot-clj/boot/wiki/Tasks#pre-and-post-tasks
Also, usually using set-env!
inside tasks is not very good idea, that code is run before any task code is really run and affects all the tasks
actually both use this pattern:
(fn middleware [next-handler]
(fn handler [fileset]
(let [workspace (boot/tmp-dir!)
target-middleware ...
target-handler (target-middleware next-handler)]
;; do stuff...
(target-handler (-> fileset
(boot/add-resource workspace)
boot/commit!))))))
what I really need is a way to delay loading of specific files, e.g. put them in a directory that is not on the CP for task A, then add that directory to the CP for task B. (Task A uses (->> fileset boot/fileset-namespaces)
and must load each in order to inspect it)
@qqq Boot-reload uses a random port, not 5000. Check boot reload --help
@juhoteperi : got it resolved, thanks
how can I add a path to :source-paths for one task, using a pod? this does not seem to work:
(let [pod-env (update-in (boot/get-env) [:dependencies] ... etc ...)
pod-env (if (nil? source-paths)
pod-env
(update-in pod-env [:source-paths] clojure.set/union source-paths))
pod (future (pod/make-pod pod-env))]