{"id":28194270,"url":"https://github.com/monkey-projects/build","last_synced_at":"2026-02-19T01:06:55.350Z","repository":{"id":177290001,"uuid":"660190430","full_name":"monkey-projects/build","owner":"monkey-projects","description":"Utility lib for building Clojure libs/apps","archived":false,"fork":false,"pushed_at":"2026-02-11T16:34:47.000Z","size":69,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-12T01:06:36.057Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/monkey-projects.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-06-29T12:53:40.000Z","updated_at":"2026-02-11T16:34:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"e1de6744-0a96-4ce3-bf6d-e74e26a214ca","html_url":"https://github.com/monkey-projects/build","commit_stats":null,"previous_names":["monkey-projects/build"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/monkey-projects/build","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monkey-projects%2Fbuild","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monkey-projects%2Fbuild/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monkey-projects%2Fbuild/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monkey-projects%2Fbuild/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/monkey-projects","download_url":"https://codeload.github.com/monkey-projects/build/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monkey-projects%2Fbuild/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29600463,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-19T00:59:38.239Z","status":"ssl_error","status_checked_at":"2026-02-19T00:59:36.936Z","response_time":162,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-05-16T13:11:46.968Z","updated_at":"2026-02-19T01:06:55.315Z","avatar_url":"https://github.com/monkey-projects.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Monkey Build\n\nUtility lib for building Clojure libs/apps using [Clojure CLI](https://clojure.org/reference/deps_and_cli).\n\nI have provided this because although the CLI and related tools provide everything\nI need, I found myself copy/pasting the same code over and over.  So I decided to\ncreate this opinionated lib.  It does some assumptions regarding the way the code\nis structured, which libs you use, etc...\n\nConsider it a \"batteries included\" library for Clojure CLI.\n\n## Usage\n\n[![Clojars Project](https://img.shields.io/clojars/v/com.monkeyprojects/build.svg)](https://clojars.org/com.monkeyprojects/build)\n\nInclude the library in your `deps.edn` file, and then you can call it as a function,\nusing the `-X` parameter.  For example, to add an alias to run all unit tests using\nKaocha, add this:\n\n```clojure\n :aliases\n {:test\n  {:extra-deps {com.monkeyprojects/build {:mvn/version \"0.3.0-SNAPSHOT\"}}\n   :exec-fn monkey.test/all}}\n```\nTo run the tests, just execute:\n```bash\nclojure -X:test\n```\n\n## Available Commands\n\nThese commands are available to use in `exec-fn`:\n\n- `monkey.test/all`: run all unit tests\n- `monkey.test/watch`: run unit tests continuously and watch for changes\n- `monkey.test/junit`: run all unit tests and output to `junit.xml`\n- `monkey.test/coverage`: runs unit tests with [cloverage](https://github.com/cloverage/cloverage)\n- `monkey.test/lint`: runs the [cli-kondo](https://github.com/clj-kondo/clj-kondo) linter on the `src` dirs (but you can override this).\n- `monkey.build/clean`: deletes the `target/classes` dir\n- `monkey.build/jar`: build jar file\n- `monkey.build/install`: install the jar locally\n- `monkey.build/jar+install`: combines `jar` and `install`\n- `monkey.build/uberjar`: creates an uberjar file\n- `monkey.build/deploy`: deploys to [Clojars](https://clojars.org)\n\nSince this is just Clojure code, you are of course completely free to call\nthese functions from your own build code.  All they require is a single parameter,\ncontaining the arguments passed in (see below).\n\nWhen building a jar or uberjar, the `clean` function is invoked to ensure no\nunnecessary or stale class files are added to the jar file.\n\n### Parameters\n\nIn order to build a jar, or deploy, some extra `exec-args` are needed:\n\n- `:jar`: the path to the jar file\n- `:version`: the version to include in the `pom.xml`, see below.\n- `:lib`: the name to deploy the library as (in case of deployment).\n- `:scm` (optional): add additional SCM info to the pom file.\n- `:pom-data` (optional): additional information to add to the pom (like licenses).\n\nYou can also customize the `junit.xml` output file by adding an `:output` parameter.\nThe `test` functions essentially just call the [Kaocha](https://github.com/lambdaisland/kaocha)\ncode, so if you want more customization, either specify it in the `tests.edn` file, or\ncall the functions directly from your own build code.  As I said, this is an opinionated\nlib, mostly created for my own purposes.\n\n**Note** that if a `pom.xml` file exists, the `:pom-data` parameter will be ignored, and\ninformation from the pre-existing pom file will be used instead.\n\n### Versioning\n\nDetermining the version of the library or app you're building is not always straightforward.\nSometimes you want to get the version from an environment variable, or you have\nsome custom calculation system.  For this, Monkey Build also supports the following\npossibilities:\n\n - `:version`: either a constant value, or a list to evaluate\n - `:version-env`: reads the version string directly from an environment variable\n - `:version-fn`: resolves the fully qualified function symbol, and invokes it without arguments\n\nThe evaluation list that `version` takes can be used to read an environment variable,\nor fall back on a constant string if the env var is empty.  Reading an environment\nvariable in this situation is done by using a tuple where the first item is `:env` and\nthe second the name of the variable, for example:\n\n```clojure\n:version [[:env \"VERSION\"] \"0.1.0-SNAPSHOT\"]\n```\nThis will either return the value of the `VERSION` env var, or `0.1.0-SNAPSHOT`. This can\nbe useful when you want to build from a CI/CD systen that populates the `VERSION`\nvariable from the git tag if it's a release, or leaves it empty if it's a snapshot build.\n\nAlthough, in most cases it's easiest to just pass the version argument on the command line:\n```bash\nclj -X:jar:install :version '\"1.0'\"\n```\n\n### Testing\n\nThe test commands use [Kaocha](https://github.com/lambdaisland/kaocha), so in order to\ndo some additional configuration, you can create a `tests.edn` file in the project root.\nSometimes, however, you want some deviating configuration depending on the situation.  For\nexample, when doing TDD, you'll want to `watch` your code, and in that case you may want\nto skip any slow tests.  In that case, you can pass in extra configuration in the `exec-args`,\nlike so:\n\n```clojure\n{:aliases\n {:watch\n  {:exec-fn monkey.test/watch\n   :exec-args {:kaocha.filter/skip-meta [:slow]}}}}\n```\nWhen watching, the `exec-args` are passed directly to Kaocha, so all config options that\nKaocha supports can be specified here.\n\n### Coverage\n\nFor coverage calculation the default args from Cloverage are being applied, with the\nexception of `junit?`, which is enabled by default.  You can override them by specifying\nthem in the `exec-args` map.\n\nApart from that, there is *one required parameter*, the `ns-regex` vector.  It should be\na list of strings that contain all the namespaces that should be instrumented.  Example\n`deps.edn` fragment:\n\n```clojure\n{...\n :aliases\n {:coverage\n  {:exec-fn monkey.test/coverage\n   :exec-args {:ns-regex [\"my.lib.ns.*\"]}}}}\n```\n\n### Linting\n\nIn order to to static code analysis, you can run the `lint` command.  By default it\nanalyzes the `src` directory, but you can override this by specifying an argument:\n\n```clojure\n{...\n :aliases\n {:lint\n  {:exec-fn monkey.test/lint\n   :exec-args {:dirs [\"src\" \"test\"]}}}}\n```\nOr, on the command line:\n```bash\nclj -X:lint :dirs '[\"src\" \"test\"]'\n```\n\n## License\n\n[MIT License](LICENSE)\n\nCopyright (c) 2023-2025 by [Monkey Projects BV](https://www.monkey-projects.be).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmonkey-projects%2Fbuild","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmonkey-projects%2Fbuild","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmonkey-projects%2Fbuild/lists"}