Skip to content

Commit

Permalink
Switch from Leiningen to Clojure CLI, tools.build and kaocha
Browse files Browse the repository at this point in the history
  • Loading branch information
devurandom committed Oct 5, 2023
1 parent fe48f39 commit 35a2b11
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 20 deletions.
25 changes: 25 additions & 0 deletions build.clj
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
(ns build
(:require
[clojure.java.io :as io]
[clojure.string :as str]
[clojure.tools.build.api :as b]))

(def lib 'raven-clj/raven-clj)
(def version (str/trim (slurp (io/file "resources/raven_clj/version.txt"))))
(def class-dir "target/classes")
(def basis (b/create-basis {:project "deps.edn"}))
(def jar-file (format "target/%s-%s.jar" (name lib) version))

(defn clean [_]
(b/delete {:path "target"}))

(defn jar [_]
(b/write-pom {:class-dir class-dir
:lib lib
:version version
:basis basis
:src-dirs ["src"]})
(b/copy-dir {:src-dirs ["src" "resources"]
:target-dir class-dir})
(b/jar {:class-dir class-dir
:jar-file jar-file}))
18 changes: 18 additions & 0 deletions deps.edn
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{:paths
["src" "resources"]

:deps
{org.clojure/clojure {:mvn/version "1.11.1"}
cheshire/cheshire {:mvn/version "5.11.0"}
org.clj-commons/clj-http-lite {:mvn/version "1.0.13"}
prone/prone {:mvn/version "2021-04-23"}}

:aliases
{;; Run with clj -T:build function-in-build
:build {:deps {io.github.clojure/tools.build {:mvn/version "0.9.5"}}
:ns-default build}
:test {:extra-paths ["test"]
:extra-deps {lambdaisland/kaocha {:mvn/version "1.87.1366"}
lambdaisland/kaocha-cloverage {:mvn/version "1.1.89"}
lambdaisland/kaocha-junit-xml {:mvn/version "1.17.101"}}
:main-opts ["-m" "kaocha.runner"]}}}
19 changes: 0 additions & 19 deletions project.clj

This file was deleted.

2 changes: 1 addition & 1 deletion resources/raven_clj/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.7.0
1.8.0-alpha
2 changes: 2 additions & 0 deletions tests.edn
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#kaocha/v1
{}

0 comments on commit 35a2b11

Please sign in to comment.