Created
July 26, 2010 01:46
-
-
Save brweber2/490082 to your computer and use it in GitHub Desktop.
This file contains 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
Index: src/leiningen/pom.clj | |
=================================================================== | |
--- src/leiningen/pom.clj (revision 78f94180dc88c3f18bdc7d112900478af0eddfb5) | |
+++ src/leiningen/pom.clj (revision ) | |
@@ -4,7 +4,7 @@ | |
[clojure.contrib.properties :only [as-properties]]) | |
(:import [java.io StringWriter ByteArrayOutputStream] | |
[org.apache.maven.model Build Model Parent Dependency | |
- Exclusion Repository Scm License MailingList] | |
+ Exclusion Repository Scm License MailingList Resource] | |
[org.apache.maven.project MavenProject])) | |
(def #^{:doc "A notice to place at the bottom of generated files."} disclaimer | |
@@ -136,6 +136,11 @@ | |
[project path-key] | |
(.replace (path-key project) (str (:root project) "/") "")) | |
+(defmacro add-a-resource [build method resource-path] | |
+ `(let [resource# (Resource.)] | |
+ (.setDirectory resource# ~resource-path) | |
+ (~(symbol (name method)) ~build [resource#]))) | |
+ | |
(defn make-model [project] | |
(let [model (doto (Model.) | |
(.setModelVersion "4.0.0") | |
@@ -146,6 +151,8 @@ | |
(.setDescription (:description project)) | |
(.setUrl (:url project))) | |
build (doto (Build.) | |
+ (add-a-resource :.setResources (relative-path project :resources-path)) | |
+ (add-a-resource :.setTestResources (relative-path project :test-resources-path)) | |
(.setSourceDirectory (relative-path project :source-path)) | |
(.setTestSourceDirectory (relative-path project :test-path)))] | |
(.setBuild model build) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment