Created
October 4, 2011 16:17
-
-
Save apg/1262071 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
(ns leiningen.hooks.classpath | |
(:require [clojure.string :as s] | |
[clojure.java.io :as f] | |
[robert.hooke] | |
[leiningen.classpath])) | |
(defn- get-jars [dir] | |
(if (.endsWith dir "*") | |
(for [jar (.listFiles (f/file (.substring dir 0 (- (count dir) 1)))) | |
:when (.endsWith (.getName jar) ".jar")] | |
jar) | |
[dir])) | |
(defn expand-dirs | |
[dirs] | |
(mapcat (fn [x] (let [f (get-jars x)] | |
(prn x) | |
f)) dirs)) | |
(def extra-cp-dirs (expand-dirs | |
(filter #(> (count (s/trim %)) 0) | |
(s/split (System/getenv "CLASSPATH") #":")))) | |
(robert.hooke/add-hook #'leiningen.classpath/get-classpath | |
(fn [get-classpath project] | |
(concat (get-classpath project) extra-cp-dirs))) | |
(in-ns 'leiningen.core) | |
(defproject looog "0.1" | |
:description "looog: An HTTP based logger of JSON messages" | |
:dependencies [[org.clojure/clojure "1.3.0"] | |
[compojure "0.6.4"]] | |
:ring {:handler looog.routes/app}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment