Fork me on GitHub
#boot
<
2016-04-13
>
onetom07:04:06

@martinklepsch: @juhoteperi: i remember one of you showed a better solution than cljs-time it was just in a gist at that time. or did i just dream it? simple_smile im looking into unifying date handling on our backend to just use joda time and i was wondering what should i do on the frontend.

onetom07:04:16

my current thinking is to just register a joda time writer for transit which converts it into instants and i would just keep using instants on the frontend (since im not doing a lot of date arithmetic there)

martinklepsch08:04:35

@onetom: goog.date.DateTime & goog.i18n.DateTimeFormat

phreed15:04:31

I am trying my hand at writing a boot-antlr task. Antlr produces a couple of types of objects, one of which is a tree. Historically, this tree is passed to StringTemplate which uses it to fill out templates, producing files. My question relates to architecture: It seems like there should be two tasks {antlr, stringtemplate} where the antlr task sends the tree, as part of the fileset, to the stringtemplate task. How does one incorporate a non-file (in this case the tree object) into the fileset?

onetom16:04:38

@phreed you can keep metadata on the files within the fileset

micha16:04:34

@phreed: yep metadata, you can simply assoc onto the TmpFile record objects if you like

phreed17:04:25

@onetom: @micha Thanks, that looks like the ticket.

micha17:04:17

@phreed: in 2.6.0 you will be able to use these functions to select files fro mthe fileset with certain meta on them: https://github.com/boot-clj/boot/blob/master/boot/core/src/boot/core.clj#L1141-L1157

richiardiandrea18:04:40

Lil' patch to the Makefile

richiardiandrea20:04:16

if I have declared a function in built.boot and I want to call it in a pod created in the same built.boot, do I have to resolve it first?

richiardiandrea20:04:27

this is always tricky for me 😄

micha20:04:43

yes because the pod is completely isolated from the other clojure runtimes

micha20:04:56

so it will have its own separate namespaces

richiardiandrea20:04:09

so no boot.user/my-fn right?

richiardiandrea20:04:21

inside pod/with-eval-in

micha20:04:21

well the boot.user namespace is sort of special because there is no file on the classpath that you can use to require it

micha20:04:35

you'd need to do load-file on the script file

micha20:04:48

that should be saved in a dynamic var in boot.core though

micha20:04:56

so you could do it if you really wanted to

micha20:04:02

hm no, nevermind

micha20:04:11

the tempfile isn't exposed

micha20:04:12

but you can do (with-eval-in p (load-file ~*boot-script*))

richiardiandrea20:04:12

So something like this should work:

(let [pod-classpath! (resolve 'pod-classpath!)]
            (pod-classpath! ~source-paths ~resource-paths))

micha20:04:14

that resolve looks strange

richiardiandrea20:04:39

yes indeed it does not work 😄

micha20:04:41

but yeah the lexical binding will allow you to refer to the name

micha20:04:13

usually you need to require the namespace before you resolve the names in the namespace

micha20:04:17

if that makes sense

richiardiandrea20:04:33

yes, but I defined this function in build.boot

micha20:04:43

ah so load-file could be used

micha20:04:57

(load-file ~*boot-script*)

micha20:04:19

then you can do (resolve 'pod-classpath!)

richiardiandrea20:04:05

yes it resolves it now, still set-env! cannot be resolved, I am starting to think this is not the right approach

micha20:04:23

yeah set-env! is not thread safe

richiardiandrea20:04:33

I encapsulated a function to execute in different pods

micha20:04:44

you should check out with-pod

micha20:04:57

that's new in 2.6.0

richiardiandrea20:04:01

but I might as well just duplicated the code or use a separate ns

micha20:04:04

you can do this:

micha20:04:53

(defn add [x y] (+ x y))

(with-pod p
  (~add 100 200))
;;=> 300

richiardiandrea20:04:16

oh cool exactly what i need

micha20:04:16

you could pass a function from one pod as a callback to something in another pod

micha20:04:30

most things can pass between pods with with-pod

micha20:04:43

there are a few things which aren't yet supported

micha20:04:52

like Atom and Ref

micha20:04:10

but all java things are ok

richiardiandrea20:04:12

it looks like it is indeed working

micha20:04:15

also record types

richiardiandrea20:04:51

I am passing as params Clojure Vectors

micha20:04:01

should be fine

micha20:04:25

the translation is pretty slow compared to pr-str/read-string, because it uses reflection

micha20:04:51

but unless the expression in the body of with-pod is really large you won't notice it

richiardiandrea20:04:38

btw the problem with pod/send! was indeed the boot.jar, I build boot locally on Jenkins, waiting for a release

richiardiandrea20:04:49

but the workaround works

micha20:04:30

does clojars have a separate snapshots repo?

tcrawley20:04:52

it's all in one repo

micha20:04:22

i was thinking about having travis build snapshots, and maybe it would be ok to have my deploy creds for that on travis

micha20:04:29

but i don't think that would be good either

micha20:04:00

i don't like having deploy keys out there on the internet, really

micha20:04:51

just because it's a snapshot doesn't make it ok to be less secure with keys

richiardiandrea20:04:21

but it is not a problem, when working with SNAPSHOTs of course you have a bit more troubles

richiardiandrea20:04:35

and you cannot update boot.jar at every patch

micha20:04:56

yeah that's where alpha1, alpha2, etc would be good

micha20:04:42

i think boot -u would update to those though

micha20:04:48

i guess that's ok?

richiardiandrea20:04:09

boot -U maybe yes, but I would like to hear other opinions simple_smile

richiardiandrea20:04:14

not too sure about this

mattly23:04:59

so, I’m a bit new to boot and trying to figure out how to get some stuff working nicely,

mattly23:04:44

but it seems that if I’ve got a dev task for compiling cljs or something into target/ and then run another task, say test, it will clear out target/ and my compiled cljs

mattly23:04:57

and it seems that that’s expected behavior

mattly23:04:43

I’m looking around to see if there’s any sort of prior art guides on making those work together

mattly23:04:59

is there a way to make that work, to not have my tests clobber my other build in progress?

mattly23:04:55

hm, seems what I need to do is just set a different target for the dev task

mattly23:04:47

…except that seems to break reload