Make your Clojure library build process easy.
Note
|
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 :version "0.1.{{git/commit-count}}"}
-
-
deps.edn
-
{:aliases {:build {:deps {com.github.liquidz/build.edn {:git/tag "0.2.63" :git/sha "f4e571d"}} :ns-default build-edn.main}}}
-
-
use by clojure cli
-
# Install lib to your local maven repo $ clojure -T:build install # Deploy to clojars.org # CLOJARS_USERNAME and CLOJARS_PASSWORD environmental variables are required $ clojure -T:build deploy
-
build-edn.main
namespace provides following functions:
Function | Description |
---|---|
pom |
Generate pom.xml |
jar |
Generate JAR file |
uberjar |
Generate standalone JAR file |
install |
Install to local Maven repository |
deploy |
Deploy to https://clojars.org |
update-documents |
Update document files for new release |
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 {:git/tag "0.2.63" :git/sha "f4e571d"}} :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))
-
name | type | required? | default | description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
lib |
|
Yes |
||||||||||||
version |
|
Yes |
||||||||||||
source-dir |
|
Your paths in deps.edn |
||||||||||||
class-dir |
|
"target/classes" |
||||||||||||
jar-file |
|
"target/{{lib}}.jar" |
||||||||||||
uber-file |
|
"target/{{lib}}-standalone.jar" |
Required only for |
|||||||||||
main |
|
Required only for |
||||||||||||
scm |
|
You can generate pom.xml with scm section.
|
||||||||||||
documents |
|
Required only for
|
||||||||||||
github-actions? |
|
false |
See |
Name | Available parameters | Description |
---|---|---|
|
|
|
|
|
|
|
|
|
|
|
year-of-era |
|
|
month-of-year |
|
|
month-of-year |
|
|
day-of-month |
|
|
day-of-month |
|
|
|
|
|
When you set true
to :github-actions?
, build.edn will set following outputs.
Function | Output | Description |
---|---|---|
pom |
|
Path for the pom.xml file |
jar |
|
Path for the generated JAR file |
uberjar |
|
Path for the generated standalone JAR file |
install |
|
Installed version string |
deploy |
|
Deployed version string |
update-documents |
|
Tagged version string |
If you’d like to automate your release process with GitHub Actions, it is good to refer following examples:
Of course, build.edn itself is using build.edn for releasing.
Copyright © 2022 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.