Fork me on GitHub
#boot
<
2016-02-21
>
bendy02:02:18

I’m running into an issue trying to run boot-test to test a boot task (so meta)

bendy02:02:03

I can run my task just fine, but when I run boot test I get:

clojure.lang.ExceptionInfo: java.io.FileNotFoundException: Could not locate boot/core__init.class or boot/core.clj on classpath.

bendy02:02:21

when it tries to compile the boot task

bendy02:02:56

do I have to declare something beyond bootlaces and boot test as a dependency?

jethroksy03:02:31

@bendy: you'll need to require boot.core in your test namespace i think

bendy04:02:02

hmmm that still didn’t seem to work

bendy04:02:22

still very much so a work in progress, first thing I’ve really done with clojure or anything java related, so I’m sure it’s something simple. I’ll keep digging!

bendy04:02:33

thanks for the rec though simple_smile

jethroksy04:02:20

lemme look through the repo

mobileink06:02:25

@micha: clojure.shell/sh does the trick, thanks

mitchelkuijpers11:02:30

I have a question about boot-cljs we are currently migraten from leiningen to boot but I cannot get our advanced clojurescript build fixed, it fails because externs don’t seem to get picked up

mitchelkuijpers11:02:48

I have a deps.cljs file with these contents:

{:externs ["relations.ext.js”]}

mitchelkuijpers11:02:18

and some externs in that file:

var mixpanel = {};
mixpanel.track = function() {};
mixpanel.init = function() {};
mixpanel.identify = function() {};
mixpanel.people.set = function() {};
mixpanel.people.increment = function() {};

var events = {};
events.onAny = function() {};
events.emit = function() {};

var dialog = {};
dialog.getButton = function() {};
dialog.close = function() {};
dialog.bind = function() {};
dialog.create = function() {};

var dialogButton = {};
dialogButton.bind = function() {};

var nativeEvent = {};
nativeEvent.target = {};

var target = {};
target.files = {};

juhoteperi11:02:06

Just make sure the deps.cljs is in the classpath

mitchelkuijpers11:02:55

It seems to get picked up because when I make an error I get the warnings

mitchelkuijpers11:02:17

But when I compile I still get this error:

Uncaught TypeError: mixpanel.md is not a function

mitchelkuijpers11:02:45

deps.cljs in src/cljs/ and I have this in my build.boot file: :source-paths #{"src/cljs" "src/clj" "src/cljc" "src/public”}

mitchelkuijpers11:02:47

And I got these warnings (to check if the file get’s picked up)

Feb 21, 2016 11:55:11 AM com.google.javascript.jscomp.LoggerErrorManager println
WARNING: /Users/mitkuijp/.boot/cache/tmp/Users/mitkuijp/Development/relations_for_jira/wq3/-lsqdbp/relations.ext.js:1: WARNING - accessing name mixpanel in externs has no effect. Perhaps you forgot to add a var keyword?
mixpanel = {};
^

mitchelkuijpers11:02:24

Might this be because I only have externs in my deps.cljs?

mitchelkuijpers11:02:52

do I need to add deps.cljs to resource-paths @juhoteperi?

mitchelkuijpers11:02:30

Something else was causing the problem.. Sorry for the noise

mitchelkuijpers11:02:44

Works like a charm now

pesterhazy18:02:08

Am I correct in assuming that boot will check for each SNAPSHOT dependency, that it's current on each run?

pesterhazy18:02:07

might explain why boot startup is slow

juhoteperi19:02:22

Boot should work the same in this case as Lein. Both are just calling Aether to resolve deps. And there is some cache to only check snapshot versions like once per day.

pesterhazy19:02:14

that's totally reasonable then

micha19:02:16

not on each run, once per 24 hours

micha19:02:22

that's a maven thing

micha19:02:29

unless you do boot -u

micha19:02:49

that disables the caching because otherwise it would miss updates

hlolli19:02:31

For global boot config, is either /profile.boot or /.boot/profile.boot equally fine?

pesterhazy19:02:43

another question. The wiki has:

:target-path
A path string. This directory is where final artifacts will be written. Default value is "target". For more information, see Target Directory.
-- isn't that outdated, now that there is the target task?

micha19:02:05

@hlolli: ~/.profile.boot is deprecated

micha19:02:25

you should put the file in ~/.boot if you can

hlolli19:02:38

ok good to know, bit of jungle going trough the github replies

micha19:02:00

boot will print a deprecation warning if you have it in ~ simple_smile

micha19:02:14

and tell you where to put it

hlolli19:02:23

Maybe this one: Implicit target dir is deprecated, please use the target task instead. Set BOOT_EMIT_TARGET=no to disable implicit target dir.

micha19:02:50

right so that's referring to the deprecated behavior of automatically writing files to the :target-path directory

micha19:02:23

to disable the deprecated behavior you can set that environment variable in your shell or in boot.properties

micha19:02:39

if you disable the deprecated behavior then the warning will no longer be shown

micha19:02:54

you need to opt-in though, to prevent breaking people's builds

hlolli19:02:17

ok, I dont state anywhere :target-path, neither in build.boom or profile.boot... but let me research it...

micha19:02:32

yeah it's set by default to ./target

micha19:02:57

so the deprecated behavior is that whenever you run boot it will by default create a target directory and put files in there

micha19:02:19

the new behavior is to have a task for that, which you call explicitly as part of the pipeline

pesterhazy19:02:30

Should I add this to the wiki then? "Note that as of Boot 2.5, setting a target directory using :target-path` has been deprecated in favor of the builtin target task. See Target Directory

micha19:02:43

@pesterhazy: yeah that would be awesome

hlolli19:02:23

ok... I just type sepcifically :reload {:target target ...etc...} for my build profile(development)?

micha19:02:11

@hlolli: sorry i'm not following

hlolli19:02:59

So, I have boot project, I want my target directory to be myproject/target. I would need to specify it with target . Maybe better if I can find some example project. Not My development is this, form tenzing: (deftask development [] (task-options! cljs {:optimizations :none :source-map true} reload {:on-jsload 'om-boot.app/init}) identity)

micha19:02:51

@hlolli: the task-options! macro lets you set default options for tasks

micha19:02:20

if you start a boot repl, boot repl, you can do (doc target) to see the options the target task supports

micha19:02:02

boot.user=> (doc target)
-------------------------
boot.task.built-in/target
([& {:keys [help dir no-link no-clean], :as *opts*}])
  Writes output files to the given directory on the filesystem.
  
  Keyword Args:
    :help      bool    Print this help info.
    :dir       #{str}  The set of directories to write to (target).
    :no-link   bool    Don't create hard links.
    :no-clean  bool    Don't clean target before writing project files.
nil

micha19:02:25

you can see the type annotations there that tell you which types the option arguments need to be

micha19:02:45

so if you want to set the default directory where the target task will put things, you can do this:

micha19:02:05

(task-options!
  target {:dir #{"target"}})

micha19:02:53

you would still need to have the target task in the pipeline, but you wouldn't need to specify the :dir option there

micha19:02:07

becuase you set the default with task-options!

hlolli19:02:12

ok, that makes sense, and I guess one should also put BOOT_EMIT_TARGET=no in boot.preoperties, or maybe that doesnt matter if target dir is specified. I will see. Thanks!

pesterhazy19:02:05

@micha, thanks for your help. I'll buy you an actual next time you're in berlin!

pesterhazy19:02:18

next clojured, perhaps? simple_smile

micha19:02:25

haha don't think i won't accept!

micha19:02:36

yeah when is it?

micha19:02:58

i've never been there except in airports passing through

pesterhazy19:02:00

well, this year's was yesterday simple_smile

micha19:02:06

oh bummer

pesterhazy19:02:34

met @juhoteperi though, that was cool

micha19:02:12

yes i enjoyed meeting everyone a clojutre in person

pesterhazy19:02:20

yeah that's the best part of conferences

danielsz20:02:51

@micha: In March, there is Clojure days in Amsterdam. Who's coming?

micha20:02:16

another place i have never visited!

danielsz20:02:30

Well worth the visit!

micha20:02:06

good bicycling country, from what i've read

danielsz20:02:20

Absolutely.

micha20:02:22

i would enjoy traveling aorund holland by bicycle for a week or two

micha20:02:46

man, maybe this is a plan

danielsz20:02:54

That is an excellent idea.

danielsz20:02:08

Yeah, I'm looking into it as well.

micha20:02:16

do you enjoy bicycling?

danielsz20:02:03

@micha: I'm a bicycle fanatic.

danielsz20:02:44

@micha: I don't own a car. Only a bike. Riding all the time. Brompton lifestyle.

micha21:02:58

interesting

danielsz21:02:28

🙏 Thank you.