Dependency manager for the Crystal language.
Crystal applications and libraries are expected to have a shard.yml file
at their root looking like this:
name: shards
version: 0.1.0
dependencies:
openssl:
github: datanoise/openssl.cr
branch: master
development_dependencies:
minitest:
git: https://github.com/ysbaddaden/minitest.cr.git
version: ~> 0.3.1
license: MITWhen libraries are installed from Git repositories, the repository is expected
to have version tags following a semver-like format,
prefixed with a v. Examples: v1.2.3, v2.0.0-rc1 or v2017.04.1.
Please see the SPEC for more details about the
shard.yml format.
Shards is usually distributed with Crystal itself (e.g. Homebrew and Debian
packages). Alternatively, a shards package may be available for your system.
You can download a source tarball from the same page (or clone the repository)
then run make release=1and copy bin/shards into your PATH. For
example /usr/local/bin.
You are now ready to create a shard.yml for your projects (see details in
SPEC). You can type shards init to have an example
shard.yml file created for your project.
Run shards install to install your dependencies, which will lock your
dependencies into a shard.lock file. You should check both shard.yml and
shard.lock into version control, so further shards install will always
install locked versions, achieving reproducible installations across computers.
Run shards --help to list other commands with their options.
Happy Hacking!
These requirements are only necessary for compiling Shards.
-
Crystal
Please refer to https://crystal-lang.org/install/ for instructions for your operating system.
-
libyaml
On Debian/Ubuntu Linux you may install the
libyaml-devpackage.On Mac OS X you may install it using homebrew with
brew install libyamlthen make sure to have/usr/local/libin yourLIBRARY_PATHenvironment variable (eg:export LIBRARY_PATH="/usr/local/lib:$LIBRARY_PATH"). Please adjust the path per your Homebrew installation. -
Needed for building manpages.
It is strongly recommended to use make for building shards and developing it.
The Makefile contains recipes for compiling and testing.
Run make bin/shards to build the binary.
release=1for a release build (applies optimizations)static=1for static linking (only works with musl-libc)debug=1for full symbolic debug info
Run make install to install the binary. Target path can be adjusted with PREFIX (default: PREFIX=/usr/bin).
Run make test to run the test suites:
make test_unitruns unit tests (./spec/unit)make test_integrationruns integration tests (./spec/integration) onbin/shards
Run make docs to build the manpages.
This repository contains a configuration for devenv.sh which makes it easy to setup a reproducible environment with all necessary tools for building and testing.
- Checkout the repository
- Run
devenv shellto get a shell with development environment
A hook for automatic shell activation
is also included. If you have direnv installed, the devenv environment loads
automatically upon entering the repo folder.
Licensed under the Apache License, Version 2.0. See LICENSE for details.