Fork me on GitHub
#boot
<
2017-11-16
>
dominicm07:11:51

@seancorfield if I wanted it the other way round, so I could aot, how would I do that?

seancorfield17:11:09

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.

dominicm18:11:12

My understanding is that the use case is full AOT, where you don't want clj in the resulting jar

seancorfield18:11:20

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.

borkdude09:11:50

What is the intention of source-paths vs resource-paths again?

dominicm09:11:58

source paths get processed, and don't go into target. resource paths may be processed, and do end up in target.

hlolli12:11:36

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?

hlolli12:11:28

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"

dave14:11:52

that's an intriguing idea -- i wonder if there is some place in the fileset where we can hang arbitrary data

seancorfield17:11:28

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 @

juhoteperi17:11:25

(vary-meta fileset #(assoc % :my-data "wow")) & (:my-data (meta fileset)), this is used by Perun

dave18:11:00

both interesting approaches!

dave18:11:19

i will file those away in my brain's filing cabinet for future use

hlolli19:11:15

@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.

juhoteperi19:11:41

This is used for example by boot-cljs/reload to store warnings/exceptions with the .cljs.edn file

seancorfield19:11:04

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.

juhoteperi20:11:26

Attaching metadata to files with add-meta is supported, attaching directly to fileset is not official

dave14:11:59

i don't know too much about what kind of object a fileset is

donaldball15:11:07

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 ""}]]) :wagons '[[sparkfund/aws-cli-wagon "1.0.4"]]). 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.

alandipert15:11:07

donaldball one thing i considered but never did was 2 set-env! calls. i think it's competitive with 'managed dependencies' maven concept

alandipert15:11:12

i.e. one set-env! adds a dependency that contains clj code for loading more dependencies

alandipert15:11:46

oh, and i think we now support managed dependencies

alandipert15:11:40

i think most of this is applicable (we have the :managed-dependencies set-env! key) http://127.0.0.1:8080/

donaldball18:11:40

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

nha15:11:51

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.

seancorfield18:11:35

@juhoteperi Interesting. I'm always a little nervous of using metadata because so many operations cause it to "evaporate"...

usenet21:11:19

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?

martinklepsch22:11:37

@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

fabrao23:11:41

Hello all, how do you use local jar from local maven like I use in lein-localrepo in boot?