Fork me on GitHub
#boot
<
2016-01-28
>
richiardiandrea00:01:53

that task would be great to have for tests 😄

richiardiandrea00:01:29

but I cannot hack then in because it refers to boot.user

micha00:01:21

that's where it's creating a new core pod

micha00:01:00

that's where it runs boot inside boot

micha00:01:12

with whatever command line arguments you pass to it

richiardiandrea00:01:54

instead of (future (boot.App/runBoot core worker args))), can I call direcly sift?

micha00:01:52

not really

micha00:01:09

it's runboot that performs the initialization of the second core instance

richiardiandrea00:01:25

yeah, so there is no way to make it execute clojure-y expressions like?

(sift :add-meta {regex :boot-test-tag}
            :add-jar {'org.clojure/tools.reader regex})

micha00:01:03

yes, you can do like

micha00:01:18

(boot.App/runBoot core worker ["sift" "--add-meta" ...])

richiardiandrea00:01:51

ok I will try that

richiardiandrea00:01:30

I guess it is the only way for now, it would be great if runBoot accepted clojure forms 😄

micha00:01:10

i think there are two kinds of tests

micha00:01:36

unit tests, which don't need boot.core for anything (since boot.core is really just a proxy for other namespaces)

micha00:01:44

and integrations tests, which do need boot.core

richiardiandrea00:01:48

it does not look too complicated to do btw, a call to tools.reader on the

micha00:01:12

like to test the sift functions there isn't really a need for boot.core

richiardiandrea00:01:12

but I am adding tests IN boot.built-in

micha00:01:31

yeah but maybe we don't need them there

micha00:01:53

that would perhaps be integration tests

micha00:01:10

which would be more like end-to-end tests

richiardiandrea00:01:13

as bash scripts?

richiardiandrea00:01:46

it's good I asked 😄

micha00:01:29

we may need to refactor things to make it easier to test

richiardiandrea00:01:35

yeah, my plan was to run a simple:

(deftest add-meta
  (let [regex #"(?i).*\.(clj|cljs|cljc|js)$"]
    (boot (sift :add-meta {regex :boot-test-tag}
                :add-jar {'org.clojure/tools.reader regex}))))
but it does not work, nothing is initialized

richiardiandrea00:01:20

with your runBoot it would work but as you said it is not ideal

richiardiandrea00:01:20

in a deftask it would be perfect, as you have access to the fileset

richiardiandrea00:01:44

a bit like show you can see the result of the pipeline

micha00:01:58

what about maybe something like this:

micha00:01:40

(boot (task1 :option ...) (verify-task1))

micha00:01:12

where verify-task1 is a task that looks at the fileset and checks to make sure it's correct

richiardiandrea00:01:20

it would be great but where exactly? that does not work in the test namespaces

micha00:01:40

in build.boot perhaps

richiardiandrea00:01:31

yes that would work, so we need to tell lein to execute boot integration-test on the shell, and it will read build.boot

richiardiandrea00:01:50

where integration-tests is a custom task

richiardiandrea00:01:54

github is down here 😱

thosmos00:01:30

@chris-andrews: @sooheon I can confirm that boot repl -c blows away the contents of target

thosmos00:01:07

and using a boot.properties of BOOT_VERSION=2.4.2 fixes the problem

samflores01:01:55

can anyone help me figure out how to serve a js file compiled by boot-cljs while Github is down and I can't look the docs?

micha01:01:28

you can use boot-http @samflores

micha01:01:34

is that what you mean?

samflores01:01:58

@micha, I'm not sure. Will boot-http start it's own server? My app already runs a http server that the hiccup generated html. I think I'll have to write the .js file to the fs (the latest boot version does not default target, right?)

micha01:01:52

if your app's http server can serve classpath resources as well as files then you should be good to go

micha01:01:05

the js file int he fileset will also be on the classpath

micha01:01:22

so like for ring you'd want to do the wrap-resource middleware

samflores01:01:05

@micha, I'll take a look. thanks

richiardiandrea02:01:57

@micha, how to reset the fileset as before execution of the task pipeline? Like at the pipe (boot | (task) ....)

richiardiandrea02:01:33

aka discard all the changes to a fileset

micha02:01:04

@richiardiandrea: when you use the boot function that should happen automatically, no?

richiardiandrea02:01:04

yes but I am composing inside boot, like (boot (test1) (reset-fs) (test2))

richiardiandrea02:01:48

because I am doing

(deftask integration-tests  []
  (comp #_(sift-add-meta)
        (sift-with-meta)
        ;; "Other test tasks here
        ))

richiardiandrea02:01:48

maybe reset-build! ?

micha02:01:16

hm yes that might be the thing

richiardiandrea02:01:38

java.lang.ClassCastException: clojure.lang.Var$Unbound cannot be cast to clojure.lang.IAtom
                clojure.core/reset!                          core.clj: 2251
             boot.core/reset-build!                          core.clj:  742
Nope ^ I am bending the spoon too much 😄

yenda10:01:56

in the console I get "ReferenceError: project1 is not defined"

yenda10:01:08

even though it is project2 running

yenda10:01:41

This is my boot file :

yenda11:01:33

disable cache -> refresh -> enable cache fixes this, the browser kept looking for the previous project main

jethroksy12:01:47

Looks like there are references to project 1?

pesterhazy15:01:10

help! @jellea's boot has color, but mine doesn't

martinklepsch15:01:27

@pesterhazy: see configuration wiki page

pesterhazy15:01:29

I don't see where I set BOOT_COLOR=no anywhere

martinklepsch15:01:31

can be controlled via env var

martinklepsch15:01:13

try setting it to yes locally and if that changes things?

pesterhazy15:01:34

tried that, but it doesn't work

martinklepsch15:01:12

if you inspect $BOOT_COLOR I guess it's unset?

pesterhazy15:01:36

I'm doing BOOT_COLOR=yes boot dev

martinklepsch15:01:01

there's also -C/--no-colors but I guess you don't have that anywhere either?

micha15:01:25

@pesterhazy: are you on windows?

micha15:01:42

colors don't work on windows very well so they're disabled by default there

pesterhazy16:01:34

might be terminal settings?

jethroksy16:01:31

you can test whether ansi colors show up on your terminal with this line: printf '\e[32mtest\n'

jethroksy16:01:48

if it doesn't then you know its your terminal settings

jethroksy16:01:14

choose one with ANSI color support, like iterm+xterm-256color

pesterhazy16:01:14

@jethroksy, that's what I use

pesterhazy16:01:22

your line gives me a green test

pesterhazy16:01:38

actually maybe I'm overestimating the amount of color I should be seeing

pesterhazy16:01:56

stacktraces are colored, and I do see something lines in bold print

kanwei17:01:45

Just wanted to drop in and say how awesome boot is once you know what you're doing. Just converted another project to boot in less than 5 minutes!

jethroksy17:01:49

this is the difference between boot with color and without

jethroksy17:01:30

notice the blue-ish results

jethroksy17:01:58

what terminal theme are you using?

pesterhazy17:01:08

iterm, solarized

jethroksy17:01:20

that's kinda the same as me...

jethroksy17:01:16

not sure if this would help, but do boot -u?

pesterhazy17:01:11

I'm already on 2.5.5

pesterhazy17:01:27

I do see more dolors in Terminal.app (white background)

jethroksy17:01:47

last thing I can think of is your bash/zsh profile

pesterhazy17:01:29

xterm-256color in both iterm and Terminal.app

pesterhazy17:01:41

no change if I change it to plain xterm

jethroksy17:01:24

:thinking_face:

pesterhazy17:01:42

env is exactly the same in both iterm and terminal.app

jethroksy17:01:49

¯\(ツ)/¯

pesterhazy17:01:51

thanks for your help!

richiardiandrea22:01:35

after the encouraging results of the survey (boot up 13%!) we need to keep this project rolling 😄 simple_smile 😄 I wanted to congratulate you all guys, very good job!

dave22:01:28

❤️ boot-clj ❤️

laforge4922:01:43

Fabulous news indeed!

jaen23:01:22

Best build tool in centuries ;' )

micha23:01:27

thanks everyone!

flyboarder23:01:35

@micha: thank you for all the work and knowledge 🍻

laforge4923:01:58

Only I can't get it to work. 😞 I'm trying to convert https://github.com/MarcoPolo/servant-demo and this is what I came up with: https://github.com/aatree/aademos/tree/master/servant-demo Obviously there are issues with my boot file. Or perhaps the html is referencing the wrong .js file, hmm? I'm seeing this when I do a show :fileset true ??? boot ? ??? cljs ? ??? main8226.cljs ? ??? main8226.cljs.cache.edn ? ??? main8226.js ? ??? main8226.js.map Perhaps I need to specify output-to on the compile? Thanks!

laforge4923:01:05

Here's my index.html: <!DOCTYPE html> <html> <head> </head> <body> <p> Look in the console </p> </body> <script src="main.js" ></script> </html>

micha23:01:24

@laforge49: that looks correct, but your html file is loading js from the wrong place

micha23:01:45

actually no, there should be a main.js file somewhere

laforge4923:01:46

How about a hint?

laforge4923:01:58

where should it load from?

micha23:01:11

what does your build.boot look like?

micha23:01:18

do you have a link to the repo?

richiardiandrea23:01:22

usually target, from the classpath

laforge4923:01:39

so I need a target task

micha23:01:07

you might, but i think those are separate issues

laforge4923:01:33

Put it after the cljs? (deftask dev "Build for local development." [] (comp (watch) (speak) (reload) (cljs-repl) (cljs) (show :fileset true) (serve :port 9000)))

micha23:01:44

yeah that looks fine

laforge4923:01:30

never seen a target task.

laforge4923:01:13

:target-path?

micha23:01:32

well that's a separate concern

micha23:01:57

when you do (show :fileset true) that's not related to the target task in any way

micha23:01:10

i'm building your thing here

laforge4923:01:25

could we start with how to specify the target task?

micha23:01:39

first let's figure out why it's not building

laforge4923:01:25

Starting reload server on <ws://localhost:58859> Writing boot_reload.cljs... Writing boot_cljs_repl.cljs... Starting file watcher (CTRL-C to quit)... nREPL server started on port 58861 on host 127.0.0.1 - <nrepl://127.0.0.1:58861> Writing main.cljs.edn... Compiling ClojureScript... ò main.js adzerk ??? boot_cljs_repl.cljs ??? boot_reload.cljs main.cljs.edn main.js main.out ??? adzerk ? ??? boot_cljs_repl.cljs ? ??? boot_cljs_repl.cljs.cache.edn ? ??? boot_cljs_repl.js ? ??? boot_cljs_repl.js.map

laforge4923:01:47

so it looks like it is building

laforge4923:01:18

Here's the rest:

laforge4923:01:19

??? weasel ??? impls ? ??? websocket.cljs ? ??? websocket.cljs.cache.edn ? ??? websocket.js ? ??? websocket.js.map ??? repl.cljs ??? repl.cljs.cache.edn ??? repl.js ??? repl.js.map servant_demo ??? core.cljs Starting Jetty on port 9000... 2016-01-28 18:21:26.152:INFO::clojure-agent-send-off-pool-0: Logging initialized @21849ms 2016-01-28 18:21:26.211:INFO:oejs.Server:clojure-agent-send-off-pool-0: jetty-9.3.1.v20150714 2016-01-28 18:21:26.310:INFO:oejw.StandardDescriptorProcessor:clojure-agent-send-off-pool-0: NO JSP Support for /, did not find org.eclipse.jetty.jsp.JettyJspServlet 2016-01-28 18:21:26.337:INFO:oejsh.ContextHandler:clojure-agent-send-off-pool-0: Started [email protected]{/,file:///C:/Users/Bill/.boot/cache/tmp/Users/Bill/Documents/aatree/aademos/servant-demo/bg/6g3ild/,AVAILABLE} 2016-01-28 18:21:26.355:INFO:oejs.ServerConnector:clojure-agent-send-off-pool-0: Started [email protected]{HTTP/1.1,[http/1.1]}{0.0.0.0:9000} 2016-01-28 18:21:26.360:INFO:oejs.Server:clojure-agent-send-off-pool-0: Started @22057ms Elapsed time: 17.746 sec

micha23:01:42

it's really hard to read those pastes simple_smile

micha23:01:59

in a snippet or something would be very nice

laforge4923:01:02

its all checked in

laforge4923:01:02

what was th elink?

micha23:01:17

well i'm building it now

micha23:01:32

i have a copy of the repo here

laforge4923:01:33

super appreciated!

micha23:01:45

my internet is terrible though so it might take a minute to download deps

micha23:01:02

i live in the woods

laforge4923:01:20

back in the days of 1200 baud modems.

micha23:01:34

haha that's what it feels like at my house

laforge4923:01:43

Hey, they were fast! And I had two!

micha23:01:12

i have a wood stove burning logs and a 1200 baud modem

micha23:01:16

living the dream over here

laforge4923:01:23

Our network backbone was x.25, at 9600 baud for the whole country!

laforge4923:01:41

Heated with wood for years.

laforge4923:01:17

had 8.5 acres, mostly woods

laforge4923:01:17

so I'm starting to play with webworkers.

laforge4923:01:04

Any webpages that will get me started on multi-output file builds? I'll want a separate .js file later for the .js

laforge4923:01:32

For this test, the page and the webworkers share the same .js file.

laforge4923:01:01

Moving to separate pages will make things easier when I write a hoplon demo.

micha23:01:03

ok i was able to successfully build the project here

laforge4923:01:35

point the browser at 9000. all I get is a directory

micha23:01:58

there is a lot more stuff of course

micha23:01:04

but you can see main.js there

micha23:01:11

which is what you want

laforge4923:01:21

so what needs fixing?

micha23:01:58

your index.html file

micha23:01:07

it's just hanging out in the project root directory

laforge4923:01:14

so what do I change?

micha23:01:15

i make PR one sec

laforge4923:01:39

tank you tank you tank you

richiardiandrea23:01:32

@micha have you had a look at how I can solve the "reset fileset" issue in my PR? https://github.com/boot-clj/boot/pull/401 I can walk you through what I did simple_smile

micha23:01:00

sure one sec