https://github.com/otto-de/lein-files-hash
https://github.com/otto-de/lein-files-hash
filesystem hashcode
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/otto-de/lein-files-hash
- Owner: otto-de
- License: apache-2.0
- Created: 2019-06-25T07:33:11.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-12-12T14:07:45.000Z (about 1 year ago)
- Last Synced: 2025-06-27T17:49:16.846Z (6 months ago)
- Topics: filesystem, hashcode
- Language: Clojure
- Size: 34.2 KB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# lein-files-hash
A Leiningen plugin to save hash trees of files and directories to properties
files.
## Usage
Add the dependency to the `:plugins` vector of your project.clj:
[](http://clojars.org/de.otto/lein-files-hash)
Configure what should be hashed and saved where:
```
:files-hash [{:properties-file "resources/versions.properties"
:property-key "graph-hash"
:deps ["org.some.dependency/dependency"
"org.some.other.dependency/other-dependency"]
:paths ["src/de/otto/package1"
"src/de/otto/package2"]}]
```
This will then on invocation create a SHA-256 Merkle hash tree of all files
(using filenames under the given paths) and dependencies (using dependency names and
the corresponding version). The resulting hash is stored under the given
key in the given properties file. As the format hints, you can have multiple
such configurations. You can also refer to single file names in the paths
vector.
The properties file is read and written through `java.util.Properties` (_not_
`org.apache.commons.configuration.PropertiesConfiguration`!). This means that
comments are clobbered and in the case of duplicate keys, the last one wins.
Call from shell:
$ lein files-hash
You might want to do this in your project's build aliases:
:aliases {"uberjar" ["do" ["clean"] ["files-hash"] "uberjar"]}
## Maintainers
See [MAINTAINERS](MAINTAINERS).
## Lifecyle status
See [OSSMETADATA](OSSMETADATA).
## License
Copyright © 2019 OTTO GmbH & Co. KG
This program and the accompanying materials are made available under the terms
of the Apache License 2.0, see the [LICENSE file](LICENSE) or
https://www.apache.org/licenses/LICENSE-2.0.html