Fork me on GitHub
#boot
<
2017-05-02
>
flyboarder01:05:18

Hey guys, a few of my boot tasks have been stable for a while now, bumping versions to 1.0

grounded_sage01:05:29

Is this boot?

java.lang.IndexOutOfBoundsException: No group 1
                                   ...                          
        coffs.static/eval7548/fn/fn/fn          static.clj:   52
     adzerk.boot-cljs/eval294/fn/fn/fn       boot_cljs.clj:  201
     adzerk.boot-cljs/eval242/fn/fn/fn       boot_cljs.clj:  135
        boot.task.built-in/fn/fn/fn/fn        built_in.clj:  167
adzerk.boot-reload/eval484/fn/fn/fn/fn     boot_reload.clj:  131
   adzerk.boot-reload/eval484/fn/fn/fn     boot_reload.clj:  130
adzerk.boot-cljs-repl/eval396/fn/fn/fn  boot_cljs_repl.clj:  171
        boot.task.built-in/fn/fn/fn/fn        built_in.clj:  396
        boot.task.built-in/fn/fn/fn/fn        built_in.clj:  394
  boot.task.built-in/fn/fn/fn/fn/fn/fn        built_in.clj:  348
     boot.task.built-in/fn/fn/fn/fn/fn        built_in.clj:  348
        boot.task.built-in/fn/fn/fn/fn        built_in.clj:  345
   pandeiro.boot-http/eval557/fn/fn/fn       boot_http.clj:   82
                   boot.core/run-tasks            core.clj:  938
                     boot.core/boot/fn            core.clj:  948
   clojure.core/binding-conveyor-fn/fn            core.clj: 1938

grounded_sage01:05:44

java.lang.IndexOutOfBoundsException: No group 4
                                   ...                          
        coffs.static/eval7544/fn/fn/fn          static.clj:   52
     adzerk.boot-cljs/eval294/fn/fn/fn       boot_cljs.clj:  201
     adzerk.boot-cljs/eval242/fn/fn/fn       boot_cljs.clj:  135
        boot.task.built-in/fn/fn/fn/fn        built_in.clj:  167
adzerk.boot-reload/eval484/fn/fn/fn/fn     boot_reload.clj:  131
   adzerk.boot-reload/eval484/fn/fn/fn     boot_reload.clj:  130
adzerk.boot-cljs-repl/eval396/fn/fn/fn  boot_cljs_repl.clj:  171
        boot.task.built-in/fn/fn/fn/fn        built_in.clj:  396
        boot.task.built-in/fn/fn/fn/fn        built_in.clj:  394
  boot.task.built-in/fn/fn/fn/fn/fn/fn        built_in.clj:  348
     boot.task.built-in/fn/fn/fn/fn/fn        built_in.clj:  348
        boot.task.built-in/fn/fn/fn/fn        built_in.clj:  345
   pandeiro.boot-http/eval557/fn/fn/fn       boot_http.clj:   82
                   boot.core/run-tasks            core.clj:  938
                     boot.core/boot/fn            core.clj:  948
   clojure.core/binding-conveyor-fn/fn            core.clj: 1938

grounded_sage01:05:14

I keep getting these errors. I step through to see when they happen and it just happens randomly. I can't figure out what is causing it.

grounded_sage01:05:45

Stepping through my code and incrementally adding it it seems to work. If I add more than one function and use it without stopping boot and restarting I seem to get that error.

grounded_sage02:05:15

It tends to throw errors during the autoreload at times. But then it seems fine. But I'm having to restart boot for every small change and there is 100% no clear reason why it is doing this.

grounded_sage05:05:47

I think I found it. It's not boot related. I very much dislike clojure errors 😞

bocaj14:05:24

Looking for where to start using boot to run tests against a java codebase...Spring 4

bocaj14:05:17

Tests will be in Clojure. I've tried compiling using javac task. However, dependencies aren't put on the classpath, it seems.

bocaj14:05:07

For example, javax.validation is missing

berrysoup16:05:39

Hi I am looking for example of building -sources.jar file. is it sift work? sift -m (.\.clj$):$1 but that is strange.

qqq16:05:04

Is there a smimple way to convert the following lines into boot ?

$ bower install polymerelements/paper-checkbox#^1.0.1
$ bower install polymerelements/iron-input#^1.0.0
$ bower install polymerelements/paper-input
$ bower install polymerelements/paper-drawer-panel
$ bower install polymerelements/paper-button
$ bower install polymerelements/paper-fab
$ bower install polymerelements/paper-menu
$ bower install polymerelements/iron-icons

berrysoup16:05:01

@qqq I guess you should have versions. IMHO there is no support for finding the latest one. But maybe exists?

berrysoup16:05:26

Ok Found. :+1:

mobileink17:05:46

https://github.com/mobileink/boot-bowdlerize - bitrot warning. see the install-bower task

flyboarder18:05:10

@micha is there a way to continuously change the options of following tasks whenever watch runs

micha18:05:54

@flyboarder no, the middleware is created when you compose the pipeline

micha18:05:59

then it runs

alandipert18:05:04

you could make a task combinator that did it though

alandipert18:05:17

like a function that takes a task and returns a task that looks for its options in the fileset

alandipert18:05:47

that would probably work against most tasks' caching schemes tho

flyboarder19:05:06

what I am trying to do is repeatedly update pom version

alandipert19:05:34

i will make a sketch

flyboarder19:05:40

right now I use my version task, but that set’s pom once

micha19:05:42

it would be a bad idea

alandipert19:05:48

seems awesome to me

alandipert19:05:53

problem solved with functions

micha19:05:12

the watch task depends on "reversibility" to be sane though

alandipert19:05:22

this wouldn't have anything to do with watch

alandipert19:05:30

(defn apply-from-fileset
  [arg-file taskfn]
  (fn [next]
    (fn [fs]
      (let [args (read-args fs arg-file)]
        (next ((apply taskfn args) fs))))))

(comp (watch)
      (jar)
      (apply-from-fileset "pom-args.edn" pom))

alandipert19:05:52

the idea there is you put "pom-args.edn" in your source dirs so watch just does the usual thing when it changes

alandipert19:05:20

another option is to make your own watch-like task

alandipert19:05:41

i.e. a task that can be 'remotely controlled', by calling downstream tasks, based on some trigger you own

bocaj19:05:46

Is

BOOT_JAVA_COMMAND
set correctly here?

bocaj19:05:58

{:watcher-debounce 10,
 :resource-paths #{"clj_src" "test"},
 :config
 {"BOOT_CLOJURE_NAME" "org.clojure/clojure", "BOOT_FILE" "build.boot", "BOOT_JAVA_COMMAND" "\"C:Program FilesJavajdk1.8.0_112binjava.exe\"", "BOOT_CLOJURE_VERSION" "1.8.0", "BOOT_VERSION" "2.7.1"},
 :checkout-paths #{},
 :checkouts [],
 :exclusions #{},
 :source-paths #{"src/main/java"},
 :repositories
 [["clojars" {:url ""}]
  ["maven-central" {:url ""}]],
 :asset-paths #{"assets"},
 :mirrors {},

flyboarder19:05:27

@alandipert would other options set by task-options! still work for the pom task?

flyboarder19:05:41

@bocaj looks like it’s missing the path separators

bocaj19:05:26

@flyboarder right. On windows 10, so I've got this now "\"C:\\Program Files\\Java\\jdk1.8.0_112\\bin\\java.exe\""

micha19:05:26

@flyboarder the natural way to do it would be to generate the pom with a task that doesn't get the version from the options

micha19:05:42

since the pom is an artifact you want to create

micha19:05:45

just like a jar etc

micha19:05:55

you don't pass the bytes of the jar as an option to the task

bocaj19:05:03

@flyboarder in #boot.properties

BOOT_JAVA_COMMAND="C:\\Program Files\\Java\\jdk1.8.0_112\\bin\\java.exe"

micha19:05:16

so you don't need any trickery to get a new jar when the source code changes

micha19:05:21

same with the pom

micha19:05:43

if you have the pom version or whatever in a file in the fileset then your pom task can create the pom with that version

bocaj19:05:07

Running

$boot javac
throws
java.lang.Exception: The java compiler is not working. Please make sure you use a JDK!
clojure.lang.ExceptionInfo: The java compiler is not working. Please make sure you use a JDK!

flyboarder19:05:49

@micha would it be safe to store the version in an atom and have a task that wraps the pom task with the value from the atom?

micha19:05:05

seems legit

flyboarder19:05:14

id rather not rewrite pom and instead use it

kirill.salykin20:05:39

Hi, I am implementing code reload on change with Sierra component

(def system nil)

(defn init []
  (alter-var-root #'system (constantly (->system))))

(defn start []
  (alter-var-root #'system component/start))

(defn stop []
  (println "CALLING STOP")
  (alter-var-root #'system (fn [s]
                             (println (str "SYSTEM " s))
                             (when s (component/stop s)))))

(defn go []
  (init)
  (start))

(defn restart []
  (stop)
  (refresh :after 'kanat/go))
boot.build
...
(deftask start-server []
  (with-pass-thru _
    (apply tns/set-refresh-dirs (get-env :directories))
    (with-bindings {#'*ns* *ns*}
      (let [result (kanat/restart)]
        (when (instance? Throwable result)
          (throw result))))))
The problem is that system is always nil, thats why it is not stopped - and I am constantly having “Address already in use” Please advice how should I store system state so it can be properly access and stoped?

kirill.salykin20:05:15

thanks, will do

seancorfield21:05:54

FYI, with Clojure 1.9.0 Alpha 16, in a bare boot repl (outside a project), I see this odd behavior:

boot.user=> (doc pr-str)
-------------------------
clojure.core/pr-str
([& xs])
  pr to a string, returning it

java.lang.ClassNotFoundException: clojure.spec.alpha$get_spec
  java.lang.NoClassDefFoundError: clojure/spec/alpha$get_spec
Can anyone else repro?

seancorfield21:05:37

(and, clearly, it is available since I can require that ns and use the function just fine — this seems like an AOT-related glitch?)

flyboarder22:05:55

@kirill.salykin take a look at the serve task in boot-nodejs

flyboarder22:05:00

it does what you want

flyboarder22:05:32

@micha it seems I cannot use an atom as I need to dereference the value when creating the pipeline

flyboarder22:05:46

@alandipert your example doesnt seem to work, I keep getting errors that the fileset is not a fileset 😛