Fork me on GitHub
#boot
<
2015-07-20
>
michal07:07:43

guys, is there something like boot.repl/default-requires defined which I could modify in my profile.boot to auto-load custom namespaces during boot’s start-up time ?

martinklepsch09:07:29

@michal There is boot_shim.clj which might help with that. Not entirely sure though. Have you tried the various repl task options? (`boot repl -h`)

alandipert12:07:32

@michal: does calling the require function in profile.boot not do what you want?

michal12:07:11

@alandipert: nope, looks like all dependencies I add through (swap! boot.repl/default-dependencies….) are not fetched at this time

alandipert12:07:34

how are you invoking boot?

michal12:07:43

simply ‘boot repl’. just to clarify, what I’d like to achieve is to load custom dependency and require its namespace independently from project. this is why I thought profile.boot is the best fit here simple_smile

alandipert12:07:43

it does sound like the right fit... and calling set-env! and require in profile.boot is not sufficient?

alandipert12:07:26

e.g. (set-env! :dependencies #(conj % '[my/lib "1.0.0"])) (require 'my.lib.core)

michal12:07:16

i tried something like this:

michal12:07:17

(swap! boot.repl/default-dependencies concat '[[cider/cider-nrepl "0.10.0-SNAPSHOT"] [im.chit/vinyasa "0.3.4"] [spyscope "0.1.5"] [refactor-nrepl "1.1.0-SNAPSHOT"]]) (require 'spyscope.core)

michal12:07:53

and it fails trying to find spyscope namespaces

michal12:07:45

thanks, this is it simple_smile

michal12:07:37

one question though. isn’t it so that (set-env! :dependencies …) replaces :dependencies from build.boot ?

alandipert12:07:16

it precedes, does not replace

alandipert12:07:44

you can call set-env as many times as you want, it's a function in boot.core

alandipert12:07:56

you can also call it from teh repl to add deps without restarting jvm

alandipert12:07:04

i do this all the time in the early stages of a project

michal12:07:38

cool, I didn’t know it. it solves my problem completely, thanks again.

alandipert12:07:08

no prob! happy computing 😃 💻

adamfrey14:07:33

I'm using Boot 2.1.2 and I'm finding that Boot isn't loading .cljc files in dependencies. I have a simple boot script this is throwing an error Could not locate cljs/util__init.class or cljs/util.clj on classpath:

adamfrey14:07:49

(set-env!
 :dependencies '[[org.clojure/clojurescript "0.0-3255"]])

(require '[cljs.build.api])

(deftask foo []
  (prn "hi"))

micha14:07:04

adamfrey: acn you paste the output of boot --version please?

adamfrey14:07:23

is boot clojure version my problem?

adamfrey14:07:28

#https://github.com/boot-clj/boot #Mon Jul 20 10:13:10 EDT 2015 BOOT_CLOJURE_VERSION=1.6.0 BOOT_VERSION=2.1.2 #App version: 2.0.0

adamfrey14:07:38

I bet that needs to be 1.7

micha14:07:42

the recommended setup is to do BOOT_CLOJURE_VERSION=1.7.0 boot --update

micha14:07:56

that will set your global default to 1.7.0

micha14:07:20

but you should also add a :dependency on org.clojure/clojure to your project to prevent confusion with transitive deps

adamfrey14:07:40

right, thank you.

micha14:07:53

if other people might be building the project, or continuous inetgration, like jenkins, i recommend doing the following

micha14:07:22

in the project dir do BOOT_CLOJURE_VERSION=1.7.0 boot --version > boot.properties

micha14:07:39

that creates a boot.properties file in the project dir

micha14:07:01

which will be respected by boot for that project

micha14:07:20

the next release of boot will have 1.7.0 as the default

adamfrey14:07:52

got it. I knew that couldn't have been a widespread problem.

micha14:07:26

it's an unfortunate convergence of small issues that combined make a pretty confusing situation