Created
August 8, 2013 15:34
-
-
Save tobias/6185689 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (defn ^:private add-classpath-to-immediate-cl | |
| ([f artifact cl] | |
| (f artifact cl)) | |
| ([f artifact] | |
| (f artifact (tccl)))) | |
| (defmacro ^:private in-dedicated-classloader [project-or-app-root & body] | |
| `(let [old-cl# (tccl)] | |
| (try | |
| (tccl (dedicated-classloader ~project-or-app-root)) | |
| (locking dedicated-classloaders | |
| (hooke/with-scope | |
| (hooke/add-hook #'cemerick.pomegranate/add-classpath | |
| #'add-classpath-to-immediate-cl) | |
| ~@body)) | |
| (finally | |
| (tccl old-cl#))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment