Getting the version of the current clojure project in the repl

后端 未结 8 1581
太阳男子
太阳男子 2020-12-08 20:27

Is it possible to grab the project information within the clojure repl?

For example, if there was a project defined:

(defproject blahproject \"0.1.2\         


        
8条回答
  •  失恋的感觉
    2020-12-08 21:00

    In case you need to do this from clojurescript you could create a macro (from another clj file) and call it from the cljs code :

    ;;ex: macro.clj
    (defmacro get-project-version [] 
      (System/getProperty "penelope.version"))
    
    ;;my_logic_code.cljs
    (ns my-logic-code
      (:require-macros [macros :as m]))
    
    (def project-version (m/get-project-version))
    

提交回复
热议问题