Permalink
Browse files

0.0.3: hook pom, set :version on project

  • Loading branch information...
1 parent 95a7dae commit 272f8fe8fa650c900dde0bc8d8643ca185a3c3cb @michalmarczyk committed Apr 18, 2012
Showing with 12 additions and 4 deletions.
  1. +12 −4 src/leiningen/hooks/git_version.clj
@@ -25,6 +25,13 @@
:uberjar-name (str artifact-base-name "-standalone.jar"))
args)))
+(defn replace-version-hook [task project & args]
+ (let [version (project ::git-version)]
+ (apply task
+ (assoc project
+ :version version)
+ args)))
+
(defn write-version-file-hook [task project & args]
(let [git-version (project ::git-version)
version-file (->> [(project :resources-path) "version.txt"]
@@ -36,11 +43,12 @@
(println git-version)))
(apply task project args)))
-(doseq [task (keep resolve '[leiningen.jar/jar
- leiningen.uberjar/uberjar
- leiningen.deploy/deploy])
+(doseq [task (map resolve '[leiningen.jar/jar
+ leiningen.uberjar/uberjar
+ leiningen.pom/pom])
hook [add-git-version-hook
- replace-artifact-names-hook]]
+ replace-artifact-names-hook
+ replace-version-hook]]
(add-hook task hook))
(add-hook #'leiningen.jar/jar write-version-file-hook)

0 comments on commit 272f8fe

Please sign in to comment.