Fork me on GitHub
#boot
<
2017-05-22
>
qqq04:05:10

boot -h web
                              java.lang.Thread.run              Thread.java:  745
java.util.concurrent.ThreadPoolExecutor$Worker.run  ThreadPoolExecutor.java:  617
 java.util.concurrent.ThreadPoolExecutor.runWorker  ThreadPoolExecutor.java: 1142
               java.util.concurrent.FutureTask.run          FutureTask.java:  266
                                               ...                               
               clojure.core/binding-conveyor-fn/fn                 core.clj: 2020
                                 boot.core/boot/fn                 core.clj: 1029
                               boot.core/run-tasks                 core.clj: 1019
                    boot.task.built-in/fn/fn/fn/fn             built_in.clj:  724
  java.lang.AssertionError: Assert failed: serve function must be namespaced symbol (null)
                            (and (symbol? serve) (namespace serve))
clojure.lang.ExceptionInfo: Assert failed: serve function must be namespaced symbol (null)
                            (and (symbol? serve) (namespace serve))
    file: "/tmp/boot.user7576663537556959187.clj"
    line: 15

qqq04:05:15

is that the expected output of boot -h web ?

qqq04:05:22

I'm expecting to see documentation on the web task

mudphone05:05:11

Is there an idiomatic way to silence the following warning when using boot-cljs?

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See  for further details.

juhoteperi07:05:11

@mudphone I don't remember if boot-cljs should be using loggers, but https://github.com/Deraen/less4clj#log-configuration

mudphone07:05:02

@juhoteperi thank you. I remember seeing something about that on a different page (using nop w/ test scope). But, I couldn’t remember where.

juhoteperi07:05:22

@qqq When checking task documentation, you should have the -h/--help after task name: boot web -h

richiardiandrea15:05:58

@mudphone yes you can use slf4j-nop-VERSION in your deps to mute it usually

grzm20:05:03

I'm trying to build a standalone jar that includes multiple entry points. For example, I'd like to be able to call java -cp my-app-0.1.0-SNAPSHOT-standalone.jar my_app.server and java -cp my-app-0.1.0-SNAPSHOT-standalone.jar my_app.background_worker

grzm20:05:20

What's the boot way of accomplishing this? Any pointers to established references also appreciated.

micha20:05:20

@grzm i believe there can only be one entrypoint in a jar file that is executed via java -jar

micha20:05:44

from manpage java(1):

By default, the first argument that is not an option of the java
       command is the fully qualified name of the class to be called. If the
       -jar option is specified, its argument is the name of the JAR file
       containing class and resource files for the application. The startup
       class must be indicated by the Main-Class manifest header in its source
       code.

grzm20:05:01

@micha I believe you're right when calling via -jar. This is a different pattern. The equivalent in leiningen is described here: https://www.reddit.com/r/Clojure/comments/501zhw/how_do_i_facilitate_multiple_mains_in_an_uberjar/

micha20:05:22

oh derp, i read something you didn't write

micha20:05:25

you can do (ns my-app.server (:gen-class)) right?

micha20:05:33

and have a -main fn in there

micha20:05:06

so you'd just need to tell boot to AOT compile those namespaces

micha20:05:22

the ones you need .class files for in the jar

grzm20:05:02

Ah! I see that the :namespace option in the jar part of task-options is a set. That makes sense. I was getting distracted by the :main portion of jar. I'm still in the early stages of learning boot. Thanks! I'll give that a try.

micha20:05:39

ah right, there is an aot task

micha21:05:31

your build pipeline is probably like boot aot uber jar target or something like that?

grzm21:05:17

Right now I'm using a stock template I think I generated using boot-new. The pipeline in the build task is aot pom uber jar target, so yeah, something like that 🙂

micha21:05:37

seems legit

micha21:05:29

the aot task has a :namespace #{'my-app.server 'my-app.client} option

grzm21:05:56

It's been working okay (for some values of okay). I haven't been as deliberate in my learning on this particular project, so there are some bugs (related to logging at this point) that I need to work out. But that's a separate issue.

grzm21:05:39

Right. That's what I'm going to try. And as I understand it, the :main for jar is the single entrypoint for calling via java -jar

grzm21:05:03

On a related note, what's the pattern for creating multiple targets/artifacts? I'd like to keep my code in a monorepo for now. I've seen reference to multiple builds for cljs (https://github.com/martinklepsch/boot-cljs-multiple-builds) but I haven't come across documentation or examples for creating multiple jars.

qqq22:05:51

where can I find a sample build.boot which: (this is for CLJ files, not cljs) 1. runs foo/-main on startup 2. recompiles + reloads components when *.clj file in directory is saved

mudphone23:05:23

I recently saw a talk on Boot where it was mentioned that each task can handle caching on its own. I understand that on some level, but isn't the default to clean the target before each run? Does that imply that I should customize tasks like boot-sass to handle caching if I need it?