Skip to content

Instantly share code, notes, and snippets.

@tobias
Created August 8, 2013 15:34
Show Gist options
  • Select an option

  • Save tobias/6185689 to your computer and use it in GitHub Desktop.

Select an option

Save tobias/6185689 to your computer and use it in GitHub Desktop.
(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