https://github.com/wdhowe/clj-project
Template for a clj tools based project.
https://github.com/wdhowe/clj-project
clj clojure clojure-deps clojure-tools template
Last synced: 3 months ago
JSON representation
Template for a clj tools based project.
- Host: GitHub
- URL: https://github.com/wdhowe/clj-project
- Owner: wdhowe
- License: epl-2.0
- Created: 2020-12-24T01:17:52.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2024-02-09T04:55:59.000Z (almost 2 years ago)
- Last Synced: 2025-01-20T06:16:33.279Z (10 months ago)
- Topics: clj, clojure, clojure-deps, clojure-tools, template
- Language: Clojure
- Homepage:
- Size: 16.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# clj-project
A template for starting a clj tools based project.
## Overview
Batteries included features:
- Project dirs/file basics
- src and test directory structure.
- .gitignore, build.clj, deps.edn, LICENSE, README.
- CI/CD: Github Workflow that runs tests and packages.
- Dependencies: Dependency version checks with 'antq'.
- Tests: Clojure 'test-runner' from Cognitect.
- Packaging: Create jars/uberjars with 'clojure.tools.build'.
- Deploy: Publish jars/uberjars to clojars via 'deps-deploy'.
## Execute the -main function
Run the -main function in the namespace/core.clj file:
- Method 1: Implied -main function in the namespace. Args sent as a list.
```clojure
clj -M:run-m
```
- Method 2: Explicit namespace+function. Args sent as a key value map.
```clojure
clj -X:run-x
```
## Dependencies
Check for outdated dependencies:
```clojure
clj -M:outdated
```
Upgrade outdated dependencies.
```clojure
clj -M:outdated :upgrade true
```
## Tests
Run tests:
```clojure
clj -T:build test
```
## Packaging
Test, write pom, and build a JAR.
```clojure
clj -T:build jar
```
Test, write pom, and build a uberJAR.
```clojure
clj -T:build uberjar
```
Clean packaging area.
```clojure
clj -T:build clean
```
## Deploy
Deploy jars to clojars:
```clojure
;; env vars for clojars
CLOJARS_USERNAME=username
CLOJARS_PASSWORD=clojars-token
clj -T:build deploy
```
[gh-actions-badge]: https://github.com/wdhowe/clj-project/workflows/ci%2Fcd/badge.svg
[gh-actions]: https://github.com/wdhowe/clj-project/actions
[cljdoc-badge]: https://cljdoc.org/badge/com.github.wdhowe/clj-project
[cljdoc-link]: https://cljdoc.org/d/com.github.wdhowe/clj-project/CURRENT
[clojure-v]: https://img.shields.io/badge/clojure-1.11.1-blue.svg
[clojars]: https://clojars.org/com.github.wdhowe/clj-project
[clojars-badge]: https://img.shields.io/clojars/v/com.github.wdhowe/clj-project.svg