Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
version is now based on env variable or pom.properties
- Loading branch information
Showing
3 changed files
with
20 additions
and
6 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,19 @@ | ||
(ns reply.version) | ||
(ns reply.version | ||
(:import java.util.Properties)) | ||
|
||
(def ^:dynamic *reply-version* "0.1.0-SNAPSHOT") | ||
(defn load-pom-properties | ||
"this loads a config file from the classpath" | ||
[] | ||
(try | ||
(let [file-reader (.. (Thread/currentThread) | ||
(getContextClassLoader) | ||
(getResourceAsStream "META-INF/maven/reply/reply/pom.properties")) | ||
props (Properties.)] | ||
(.load props file-reader) | ||
(into {} props)) | ||
(catch Exception e nil))) | ||
|
||
(defn get-version [] | ||
(or (System/getenv "reply.version") | ||
(get (load-pom-properties) "version") | ||
"version unknown")) |