Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pelletier/lein-dynamic-version
A Leiningen plugin to populate the :version field of your lein project dynamically
https://github.com/pelletier/lein-dynamic-version
clojure leiningen
Last synced: 25 days ago
JSON representation
A Leiningen plugin to populate the :version field of your lein project dynamically
- Host: GitHub
- URL: https://github.com/pelletier/lein-dynamic-version
- Owner: pelletier
- License: epl-1.0
- Created: 2017-02-08T01:51:38.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-11-19T16:29:12.000Z (almost 6 years ago)
- Last Synced: 2024-09-16T23:13:17.033Z (about 2 months ago)
- Topics: clojure, leiningen
- Language: Clojure
- Homepage: https://github.com/pelletier/lein-dynamic-version
- Size: 16.6 KB
- Stars: 1
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# lein-dynamic-version
A Leiningen plugin to populate the `:version` field of your lein project dynamically.
[![Clojars Project](https://img.shields.io/clojars/v/lein-dynamic-version.svg)](https://clojars.org/lein-dynamic-version)
[![Build Status](https://travis-ci.org/pelletier/lein-dynamic-version.svg?branch=master)](https://travis-ci.org/pelletier/lein-dynamic-version)## Usage
Put `[lein-dynamic-version "0.1.0"]` (or the newest version) into the `:plugins` vector of your project.clj.
From then on, dynamic-version will replace the `:version` field of the project automatically.## How it works
This is simply a lein middleware that goes through a list of "loaders", which define how to fetch the number version. The first version returned by a loader is used to replace the `:version` key of the lein project definition.
## Configuration
You can set a `:dynamic-version` key to your project which contains any of the following entries:
#### `:env`
Fetch the version from an environment variable.
Example:
```clj
:dynamic-version {:env "FOO"}
```This will use the environment variable `FOO` to populate the version.
#### `:file`
Fetch the version from a file on the filesystem.
##### Example
```clj
:dynamic-version {:file "../VERSION"}
```#### `:order`
A vector that contains the loaders names in order they should be used. Existing loaders are:
* `:env` - load version from an environment variable
* `:file` - load version from a file
* `:default` - use the version specified in the project.clj file##### Default
`[:env :file :default]`
##### Example
Load from a file, and themm default:
```clj
:dynamic-version {:order [:file :default]}
```## License
Copyright © 2017 Thomas Pelletier
Distributed under the Eclipse Public License either version 1.0 or (at
your option) any later version.