Fork me on GitHub

So I'm trying to get a luminus project to run in boot ( and I'm having some issues. It seems that when I run with boot, the VM just shuts down, but it works fine with lein. Does anyone know why that would be?


donyorm: luminus-boot: "To start a web server for the application, run: lein run" wtf?


This is a work in progress, I haven't updated everything, including the documentation


donyorm: np. but if you 're doing boot you might want to remove refs to lein asap just to avoid confusion.


That branch isn't remotely finished. It's mainly there for people who want to help me transfer the template to boot. When I finish it, I'll work through all those little details, but for now I'm getting the main programming down.


@donyorm it smells like the main thread finishes and there are not non-daemon threads to keep it on


but it works under lein?


For a quick check try to put a @(promise) line after your call or directly into the -main


Lein is different from boot I guess


But don't take my is just a guess


well that seemed to work. I got luminus running under boot with that last part. Thanks for your help @richiardiandrea. I'm going to try and make some templates to get this to work


No problem! That has always been an issue with web servers that don't block the main thread


yeah, it's weird that lein doesn't have the issue though


Boot doesn't do AOT by default, right? You have to use the task specifically, correct?


You almost never need AOT. Just sayin’


We don’t do any AOT at World Singles. We build uberjars without AOT, then use clojure.main as the entry point and pass the namespace whose -main we want to run (e.g., java -jar uberjars/api-1.0.0.jar -m api.main).


I know. I just wanted to make sure boot wasn't doing it by default, since I'm transferring from lein and want to remove every possible point of difference


Cool. Yeah, we switched from lein to boot about 18 months ago. Very happy with that switch.


We’ve managed to convert a lot more of our build/test/deploy pipeline into boot (from ant and shell scripts) too.


hi, I need some help with boot-cljs. I have a clojurescript macro which generates a css file and writes it to disk. My problem is that the boot-cljs task is not adding the css file to the fileset. Is there a way to tell to boot-cljs that I want to add the css file to the fileset?


@jlle add the dir to the :resource-paths?


if i have a jar that’s not distributed through maven/clojars (i.e. a jar i manually downloaded somewhere), what would be the appropriate way to include it in my project ? right now i’ve done a mvn install:install-file, but i was wondering whether i could put this jar in a lib/ directory and have boot automatically add it to the classpath


assuming you have a local maven repo proxy (nexus/artifactory/…) - I’d put it there


otherwise - into lib/


@dm3 thanks ,i’ll look into those proxies!


if I wanted to invoke a deftask from within a task with arguments, how might I do that? is there any example someone can point me to? I want to do something like:

(deftask foo [a arg VAL str "an arg"]
  (c/with-pre-wrap [fs]
    ... do some task-ey stuff
    (let [v (another-task/do-task :task-arg arg]
      ... do something with v
      (-> fs commit!))
But this obviously wont work


or is it more idiomatic to have 1 task write something to a temp file in the fs, then another task read that data?


@lwhorton v there is a function that takes a function that returns a fileset as an argument, and returns a function that, when called with a fileset, returns a fileset


so you can call it with a fileset like ((v identity) fs) and get a fileset back


also lol at the complexity of that first sentence


here’s another example. a task that just calls aot task with no arguments on a fileset:

(defn aot-wrapper [] 
  (fn [next]
    (fn [fs]
      (next (((aot) identity) fs)))))


(boot (aot-wrapper)) =~ (boot (aot))


aha, I see .. so refer to the “interceptor” chain instead of using the pre-wrap helpers


which will allow me to get lower level control and use things like (fn [next]) when I actually want to invoke it: thanks @alandipert


when should i use boot over leiningen? if my build process has a certain level of complexity?


I think that’s probably a good starting point to think about that choice.


Boot has a lot of things built-in that would be plugins in Leiningen (lein-ancient, for example, is built-in).


Mostly it’s about extensibility and configuration: Leiningen has project.clj which is a declarative map of settings; Boot has “Clojure code”.


do you think it'd necessarily be bad to just always use boot? tbh when i use leiningen i tend to spend a lot of time setting it up, and i'm hoping boot has less of those problems


I don’t use Leiningen for anything now, unless I’m playing with someone else’s FOSS project that just happens to rely on Leiningen.


oh, i guess i should mention that i'm trying to work with clojurescript, i initially was interested in boot because of a blog post about using boot with clojurescript


thanks for the links! reading now


@seancorfield do you think boot has more of the common plugins compared to leiningen since you wrote that post?


I’ve used boot for ~6 mo now primarily for cljs. It’s had everything I’ve needed, and for what wasn’t there it’s relatively easy to add your own tasks.


The pieces I ended up adding were 1) a way to version js files for cache-busting, 2) generating an index.html file with those versions, 3) writing a manifest (git sha, git tag, branch, etc.) to a json file 4) compiling my stylus


As someone who writes a fair bit of web apps, most of these need to be custom for each customer anyways, so its not like you can avoid writing them if you do it in leiningen vs. boot


cool, i guess i'll just use boot! sounds like i would need it for bigger projects at some point anyways