我在我的tools/build.clj文件中有了这个clojure代码
(ns build
(:require [clojure.tools.build.api :as build]))
;; Get the number of commits reachable since the last tagged commit.
(def version
(let [last-tag (build/git-process {:git-args "describe --tags --abbrev=0"})]
(format "%s.%s"
last-tag
(build/git-process {:git-args
["rev-list"
(format "%s..HEAD"
last-tag)
"--count"]}))))
当在Windows上运行时,它将版本字符串设置为null.null
,但在Linux上不会这么做。希望你会想了解这一点。