{:lib com.github.YOUR-ACCOUNT/AWESOME-LIB
;; You could also specify a fixed version like "0.1.2" if you want.
:version "0.1.{{git/commit-count}}"}
Make your Clojure library build process easy.
This project is alpha version. Breaking changes may happen |
build.edn make you buildable your libraries only preparing build.edn
file for the simple usage.
build.edn
{:lib com.github.YOUR-ACCOUNT/AWESOME-LIB
;; You could also specify a fixed version like "0.1.2" if you want.
:version "0.1.{{git/commit-count}}"}
deps.edn
{:aliases
{:build {:deps {com.github.liquidz/build.edn {:mvn/version "0.11.257"}}
;; You could also specify a git tag and sha
;; :git/tag "0.11.257" :git/sha "4ba1985"
:ns-default build-edn.main}}}
use by clojure cli
# Generate JAR file
$ clojure -T:build jar
# Install lib to your local maven repo
$ clojure -T:build install
# Deploy to clojars.org
# Some kind of credentials are required
$ clojure -T:build deploy
See clojure -T:build help
for other functionarities.
build-edn.main
namespace is just a wrapper for build-edn.core
.
So if you want to tune the build process a bit more, you can use build-edn.core
name directly.
deps.edn
{:aliases
{:build {:deps {com.github.liquidz/build.edn {:mvn/version "0.11.257"}}
:ns-default build}}}
build.clj
(ns build
(:require
[build-edn.core :as build-edn]))
(def ^:private config
{:lib 'com.github.YOUR-ACCOUNT/AWESOME-LIB
:version "0.1.{{git/commit-count}}"})
(defn deploy
[_]
;; Deploy with past name for compatibility.
(build-edn/deploy (assoc config :lib 'AWESOME-LIB/AWESOME-LIB))
(build-edn/deploy config))
The following operations will update your build.edn
file.
# Bump major version and update configuration file
$ clojure -T:build bump-major-version
# Bump minor version and update configuration file
$ clojure -T:build bump-minor-version
# Bump patch version and update configuration file
# But when the patch version is a variable like '{{git/commit-count}}',
# this operation will be failed.
$ clojure -T:build bump-patch-version
# Add '-SNAPSHOT' to version number and update configuration file
$ clojure -T:build add-snapshot
# Remove '-SNAPSHOT' from version number and update configuration file
$ clojure -T:build remove-snapshot
If you’d like to use two or more functionarities at once, you can use execute
.
# When you are using fixed semantic versioning
$ clojure -T:build execute :fns '[bump-patch-version deploy]'
# When you have Java source
$ clojure -T:build execute :fns '[java-compile uberjar]'
execute
function will run specified functions left to right.
When specified functions contain some invalid strings, execute
function will fail.
name | type | required? | default | description |
---|---|---|---|---|
lib |
| Yes | ||
version |
| Yes | ||
description |
| You can add | ||
licenses |
| You can add | ||
source-dirs |
| Your paths in deps.edn | ||
class-dir |
| "target/classes" | ||
java-paths |
| Required only for | ||
javac-opts |
| Java compile options for | ||
jar-file |
| "target/{{lib}}.jar" | ||
uber-file |
| "target/{{lib}}-standalone.jar" | Required only for | |
main |
| Required only for | ||
skip-compiling-dirs |
|
| Paths to skip compiling on | |
pom |
| You can customize scm sections, etc. in pom.xml See doc/format/pom.adoc for more details. | ||
documents |
| Required only for | ||
deploy-repository |
| Required only for | ||
github-actions? |
| false | See doc/github-actions.adoc for more details. |
build.edn provides build-edn.core/lint
and build-edn.main/lint
function.
When you use :ns-default build-edn.main
setting, you can lint your build.edn
file with the following command.
clojure -T:build lint
See doc/deploy.adoc for more details.
If you’d like to integrate build.edn with GitHub Actions, see doc/github-actions.adoc.
Of course, build.edn itself is using build.edn for releasing.
Copyright © 2022-2023 Masashi Iizuka
This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 which is available at http://www.eclipse.org/legal/epl-2.0.
This Source Code may also be made available under the following Secondary Licenses when the conditions for such availability set forth in the Eclipse Public License, v. 2.0 are satisfied: GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version, with the GNU Classpath Exception which is available at https://www.gnu.org/software/classpath/license.html.
Can you improve this documentation? These fine people already did:
liquidz, github-actions & Iizuka MasashiEdit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close