Skip to content

Commit

Permalink
Bump to v0.6, update docs and use bb as task runner
Browse files Browse the repository at this point in the history
  • Loading branch information
axvr committed Oct 22, 2024
1 parent 9b0ce9a commit 3758251
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 34 deletions.
5 changes: 5 additions & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
java temurin-11
clojure latest
babashka latest
clj-kondo latest
cljfmt latest
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ This library is a simple Clojure logging facade that wraps SLF4J 2+ (the version

```clojure
;; tools.deps
com.kroo/epilogue {:mvn/version "0.5"}
com.kroo/epilogue {:mvn/version "0.6"}
;; Leiningen
[com.kroo/epilogue "0.5"]
[com.kroo/epilogue "0.6"]
```

Before you can use Epilogue, you will probably want to first configure all logs to go through SLF4J and then configure a logging backend. You can find an example Clojure project using Epilogue with [Logback][] in the "[examples](/examples/logback)" folder of this repository, which demonstrates how to set it up.
Expand Down
20 changes: 20 additions & 0 deletions bb.edn
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{:tasks
{:init (do (defn sh [& args]
(binding [*out* *err*]
(apply println "+" args))
(apply shell args))
(def clj (partial sh "clojure")))
check {:doc "Run all pre-commit checks."
:depends [lint fmt test]}
lint {:doc "Lint code."
:task (sh "clj-kondo" "--lint" "src:test")}
fmt {:doc "Format code."
:task (sh "cljfmt" "fix")}
test {:doc "Run test suite."
:task (do
(clj "-T:build" "compile")
(apply clj "-X:test" *command-line-args*))}
build {:doc "Run build functions."
:task (apply clj "-T:build" *command-line-args*)}
outdated {:doc "Check for outdated dependencies."
:task (clj "-T:antq" "outdated")}}}
17 changes: 9 additions & 8 deletions build/README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
# Common development actions

> [!TIP]
> Install all external tools automatically with [`asdf`](https://asdf-vm.com/) or [`mise`](https://mise.jdx.dev/). All tool versions are listed in the `.tool-versions` file.
## Lint/test/etc.

```shell
clojure -M:lint # Lint
clojure -T:cljfmt fix # Fix formatting
clojure -T:antq outdated # List outdated deps
bb lint # Lint
bb fmt # Fix formatting
bb outdated # List outdated deps
```

<!-- clojure -X:test # Run tests -->

## Build

> **Warning**<br>
> [!WARNING]
> If you have any local changes that haven't been committed, they will be included in the built jar file.
Build and install the jar with these commands.

```shell
clojure -T:build jar
clojure -T:build install
bb build jar
bb build install
```

If there was no Git tag pointing to the commit, the jar will have the version: `local`.
Expand Down
4 changes: 2 additions & 2 deletions build/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ pushd "deploy-$version"

(
set -e
clojure -T:build jar
clojure -T:build deploy
bb build jar
bb build deploy
)

popd
Expand Down
9 changes: 1 addition & 8 deletions deps.edn
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,9 @@
{:dev {:extra-deps {org.slf4j/slf4j-simple {:mvn/version "2.0.16"}}}
;; clj -T:build ...
:build {:extra-paths ["build"]
:deps {io.github.clojure/tools.build
{:git/tag "v0.10.5", :git/sha "2a21b7a"}
:deps {io.github.clojure/tools.build {:git/tag "v0.10.5", :git/sha "2a21b7a"}
slipset/deps-deploy {:mvn/version "0.2.2"}}
:ns-default build}
;; clj -M:lint
:lint {:replace-deps {clj-kondo/clj-kondo {:mvn/version "RELEASE"}}
:main-opts ["-m" "clj-kondo.main" "--parallel" "--lint" "src"]}
;; clj -T:cljfmt fix
:cljfmt {:deps {io.github.weavejester/cljfmt {:git/tag "0.13.0", :git/sha "f0230c3"}}
:ns-default cljfmt.tool}
;; clj -T:antq outdated
:antq {:deps {com.github.liquidz/antq {:mvn/version "RELEASE"}
org.slf4j/slf4j-nop {:mvn/version "RELEASE"}}
Expand Down
14 changes: 7 additions & 7 deletions examples/logback/deps.edn
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{:paths ["src" "resources"]
:deps {org.clojure/clojure {:mvn/version "1.11.2"}
com.kroo/epilogue {:mvn/version "0.5"}
:deps {org.clojure/clojure {:mvn/version "1.12.0"}
com.kroo/epilogue {:mvn/version "0.6"}
;; Use Logback-classic as the logging backend.
ch.qos.logback/logback-classic {:mvn/version "1.5.3"}
com.kroo/typeset.logback {:mvn/version "0.4"}
ch.qos.logback/logback-classic {:mvn/version "1.5.11"}
com.kroo/typeset.logback {:mvn/version "0.7"}
;; Add SLF4J logging bridges to make logs from other logging libraries go via SLF4J.
org.slf4j/jul-to-slf4j {:mvn/version "2.0.12"}
org.slf4j/jcl-over-slf4j {:mvn/version "2.0.12"}
org.slf4j/log4j-over-slf4j {:mvn/version "2.0.12"}}}
org.slf4j/jul-to-slf4j {:mvn/version "2.0.16"}
org.slf4j/jcl-over-slf4j {:mvn/version "2.0.16"}
org.slf4j/log4j-over-slf4j {:mvn/version "2.0.16"}}}
14 changes: 7 additions & 7 deletions examples/logback/project.clj
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
(defproject com.example/logging "1.0"
:dependencies [[org.clojure/clojure "1.11.2"]
[com.kroo/epilogue "0.5"]
:dependencies [[org.clojure/clojure "1.12.0"]
[com.kroo/epilogue "0.6"]
;; Use Logback-classic as the logging backend.
[ch.qos.logback/logback-classic "1.5.3"]
[com.kroo/typeset.logback "0.4"]
[ch.qos.logback/logback-classic "1.5.11"]
[com.kroo/typeset.logback "0.7"]
;; Add SLF4J logging bridges to make logs from other logging libraries go via SLF4J.
[org.slf4j/jul-to-slf4j "2.0.12"]
[org.slf4j/jcl-over-slf4j "2.0.12"]
[org.slf4j/log4j-over-slf4j "2.0.12"]]
[org.slf4j/jul-to-slf4j "2.0.16"]
[org.slf4j/jcl-over-slf4j "2.0.16"]
[org.slf4j/log4j-over-slf4j "2.0.16"]]
;; Make clojure.tools.logging use SLF4J.
:jvm-opts ["-Dclojure.tools.logging.factory=clojure.tools.logging.impl/slf4j-factory"])

0 comments on commit 3758251

Please sign in to comment.