Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jar task blows up when *print-length* is set #218

Closed
borkdude opened this issue Jun 6, 2015 · 2 comments
Closed

jar task blows up when *print-length* is set #218

borkdude opened this issue Jun 6, 2015 · 2 comments

Comments

@borkdude
Copy link

borkdude commented Jun 6, 2015

Steps to reproduce:

@alandipert
Copy link
Contributor

This is tricky because multiple instances of the Clojure runtime (pods) are floating around the JVM in any given boot project.

So, it's not really possible in a build.boot to set a Clojure runtime variable that all other instances of Clojure will automatically see.

There is a mechanism for running code in every pod created by boot before it's returned to any task or user code. You can create a file called boot-shim.clj and add forms to run in clojure.core. For instance, could create a boot-shim.clj with this content:

(def ^:dynamic *print-length* 20)

Is the reason you want to set the print length so that the REPL user won't have to do it manually?

If so, another, more straightforward way of achieving your goal might be with task-options!:

(task-options!
 repl {:init-ns 'animals.server
       :eval '(set! *print-length* 20)})

@borkdude
Copy link
Author

borkdude commented Jun 6, 2015

Yeah, mainly REPL. Thanks! Just in time for my blogpost!

@borkdude borkdude closed this as completed Jun 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants