Apr. 26th, 2015

tobotras: (Default)
Как в программе показать -version, прочитав его из project.clj?

project.clj:
(def my-version "9.99")
(defproject my-project my-version
  :manifest {"Implementation-Version" ~my-version}
   etc)


core.clj:
(defn implementation-version []
  ;; Кажем версию софтины. Пропертя работает в lein repl, а getPackage().getImplementationVersion()
  ;; работает в JAR
  (or (System/getProperty "my.version")
         ;; Как сюда не хардкодить класс? Я думал, *ns*, но нет
      (-> (eval 'my.package.core) .getPackage .getImplementationVersion)))

(defn -main [& args]
  (println "I am the project, version" (implementation-version)))

Profile

tobotras: (Default)
tobotras

December 2024

S M T W T F S
123 4567
891011121314
15161718192021
22232425262728
293031    

Most Popular Tags

Page Summary

Style Credit

Expand Cut Tags

No cut tags
Page generated Aug. 10th, 2025 05:45 pm
Powered by Dreamwidth Studios