Skip to content

Instantly share code, notes, and snippets.

@jaycfields
Created May 10, 2013 16:04
Show Gist options
  • Save jaycfields/5555399 to your computer and use it in GitHub Desktop.
Save jaycfields/5555399 to your computer and use it in GitHub Desktop.
;;;; created by David Chelimsky
(ns leiningen.hooks.expand-resource-paths
(:use [clojure.java.io :only [as-file]])
(:import [java.io File])
(:require [robert.hooke]
[leiningen.javac]
[org.satta.glob :as glob]))
(defn- expand-resource-paths [project]
(assoc project :resource-paths (->> project :resource-paths (mapcat glob/glob))))
(defn javac-with-expanded-resource-paths [javac-fn project & args]
(apply javac-fn (expand-resource-paths project) args))
(defn activate []
(robert.hooke/add-hook #'leiningen.javac/javac
#'javac-with-expanded-resource-paths))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment