Re: instrument code only in dev, with lein

2017-03-25 Thread Matching Socks
You can avoid conflicts. The ns you start executing in dev may exist only 
on the dev source-paths, and when it configures the rest of your program 
(putting functions in closure and whatnot) it can do so drawing from stuff 
that's only going to be available in the dev profile. Then when you build 
the uberjar, it simply won't include any of that stuff.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: instrument code only in dev, with lein

2017-03-23 Thread Brian Craft
So, this seems to work pretty easily, though I'm relying on 'require' 
resolving references in the same order as the directories in :source-paths. 
For :source-paths ["src-dev", "src"], it will find 
src-dev/foo/instrument.clj,instead of src/foo/instrument.clj, when both 
exist.

I can't find anything in the lein or clojure docs that specifies this 
behavior. Is this a safe assumption?

On Friday, March 17, 2017 at 5:24:30 PM UTC-7, Matching Socks wrote:
>
> In a nutshell: leverage distinct classpaths.  Adjust the :dev profile in 
> project.clj to prepend a directory other than src to :source-paths, and 
> likewise a directory other than resources for :resource-paths.  In 
> development, use code or resources from the dev classpath to override 
> default behaviors on the uberjarred classpath.  See the sample Lein 
> project.clj:
>
> https://github.com/technomancy/leiningen/blob/master/sample.project.clj
>
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: instrument code only in dev, with lein

2017-03-17 Thread Matching Socks
In a nutshell: leverage distinct classpaths.  Adjust the :dev profile in 
project.clj to prepend a directory other than src to :source-paths, and 
likewise a directory other than resources for :resource-paths.  In 
development, use code or resources from the dev classpath to override 
default behaviors on the uberjarred classpath.  See the sample Lein 
project.clj:

https://github.com/technomancy/leiningen/blob/master/sample.project.clj

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


instrument code only in dev, with lein

2017-03-17 Thread Brian Craft
How do you instrument code, e.g. apply ring wrap-reload, 
wrap-stacktrace-web, etc., only in dev, not in uberjar?

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.