Fork me on GitHub
#boot
<
2017-04-16
>
mobileink15:04:13

i’m having no luck with boot-new. i do boot -d boot/new new -t template -n tmp.foobar, then cd tmp.foobar; boot build installs it locally. then in a separate directory: boot -d boot/new new -t tmp.foobar -n foobar-test, which gives “Failed to collect dependencies:… tmp.foobar:lein-template:…”

mobileink15:04:25

anybody have an example of a boot-new template?

mobileink16:04:56

for discussion, before i spend time on a PR: boot-new should use namespaced syms for template name. iow, instead of -t foo-app, we would do -t foo.bar/app. this would support multiple templates in a single project.

mobileink16:04:46

the problem with the current impl if i understand it is that the project name and the template name must be the same. @seancorfield

seancorfield19:04:49

@mobileink the default template project will produce a snapshot artifact. You'll need to tell boot-new to search for snapshots (`-S` I think -- check the docs).

seancorfield19:04:39

Or you could change the template project version to non-snapshot before you install it.

mobileink19:04:49

thanks, did figger that out eventually. fyi submitted a pr.

mobileink19:04:57

but that's a separate issue from supporting multiple template in one boot-template lib, no? i don't how to do it currently.

mobileink19:04:29

also if you're open to adding some docs on howto develop a template lib i'll give it a shot.

seancorfield20:04:24

You shouldn't use (System/exit 0) when there's a failure. I'd prefer that your PR just added another (println (format ...)) to the existing println calls in that exit-error call.

seancorfield20:04:53

Printing the actual exception is important.

seancorfield20:04:54

Certainly happy to add more to the readme, so that's all good.

mobileink20:04:32

honest q: why not System/exit? my thinking is this: we caught the problem, we know exactly what it is, and we can tell the user exactly the problem. what is the point of a stack trace?

mobileink20:04:39

or to put it differently: it's not really an exception if it's something you have foreseen. Exceptions (imho) are for unexpected stuff.

mobileink20:04:09

stack traces are alienating in my view. in this case, if boot-new had simply told me it could not find [foo.bar"RELEASE'] i would have know immediately what the pronlem is. the stack trace was actually anti-helpful.

mobileink21:04:32

that's one thing. a separate thing is that boot-new throws only the last exception, when in fact there are two. so the msg is "i could not find the leinengen template", which is just wrong. i don't even care about leinengen, why is boot-new bothering?

mobileink21:04:02

so: an enhancement i would like to see is: assume boot. if you want a leinengen template, you must say so. when i'm using a boot template, i do not want to waste time searching for lein stuff.

mobileink21:04:02

fwiw i hope i don't sound too blunt, i'm grateful for your work. just trying to not waste time.

mobileink21:04:26

or to put it in a more poetic, Rumsfeldian mode: exceptions are for unknown unknows. Known unknowns should never throw exceptions. heh. http://www.slate.com/articles/news_and_politics/low_concept/2003/04/the_poetry_of_dh_rumsfeld.html

seancorfield21:04:27

I meant specifically if you have an error, do not exit with a ZERO status.

seancorfield21:04:44

Also, System/exit short-circuits Boot's error handling which might affect a build pipeline. You just shouldn't use it in a Boot task.

seancorfield21:04:25

That's why there's exit-error

mobileink21:04:26

can you elaborate on that? doen't throwing an exception do same?

seancorfield21:04:45

If you change your PR to just add an additional println with your improved error message using format, I'll merge it in.

seancorfield21:04:12

I'm on my phone and that explanation is more than I'm willing to type.

seancorfield21:04:34

I haven't actually gotten out of bed yet. Just responding as a courtesy.

mobileink21:04:19

will do, don't wanna argue. but i'm genuinely puzzled as to why System/exit is a bad idea.

mobileink21:04:42

hahah! take your time!

seancorfield21:04:12

Because it just stops the jvm right there and then. Tasks lose control.

mobileink21:04:53

why is that bad? serious question. i have a pipeline and a task fails. why not come to a screeching halt -so long as you have a good error msg.

seancorfield21:04:22

Not typing an answer on my phone. Just accept it's the wrong thing to do.

mobileink21:04:37

heh, won't ask you to phone it, but i'm afraid i'm the kind of annoying guy who cannot "just accept". but this is a larger issue maybe somebody else will chime in and pull the worms out of my head. i will accept whatever you want for boot-new, however. i'll revise later today.

mobileink21:04:43

get some rest. simple_smile

seancorfield22:04:05

I'm up and about now. But still on my phone (out getting brunch). Will look for an updated PR sometime, thanks.

fossifoo23:04:26

is there a way to only get files/namespaces from certain input dirs, in my case the "source-paths"?

fossifoo23:04:02

i try to run cloverage, but it tries to include dependencies from a cljc file in a resource dir

fossifoo23:04:29

and i wouldn't want to include that in the coverage measurement anyway

fossifoo23:04:06

for now i just (set-env! :resource-paths #{}) but that feels dirty