File: build_shared.clj

package info (click to toggle)
pomegranate-clojure 1.2.24-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 636 kB
  • sloc: xml: 135; sh: 37; makefile: 17
file content (26 lines) | stat: -rw-r--r-- 700 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
(ns build-shared
  "a few things that are both needed by bb script code and build.clj"
  (:require [clojure.string :as string]
            [clojure.edn :as edn]))

(defn- project-info []
  (-> (edn/read-string (slurp "deps.edn"))
      :aliases :neil :project))

(def version-tag-prefix "v")

(defn lib-version []
  (-> (project-info) :version))

(defn lib-artifact-name []
  (-> (project-info) :name))

;; happens to be the same for this project
(def lib-github-coords lib-artifact-name)

(defn version->tag [version]
  (str version-tag-prefix version))

(defn tag->version [ci-tag]
  (and (string/starts-with? ci-tag version-tag-prefix)
       (string/replace-first ci-tag version-tag-prefix "")))