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: MIT
When 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 CRFLAGS=--release
and 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 for compiling Shards.
Crystal
Please refer to http://crystal-lang.org/docs/installation for instructions for your operating system.
libyaml
On Debian/Ubuntu Linux you may install the libyaml-dev
package.
On Mac OS X you may install it using homebrew with brew install libyaml
then make sure to have /usr/local/lib
in your LIBRARY_PATH
environment
variable (eg: export LIBRARY_PATH="/usr/local/lib:$LIBRARY_PATH"
).
Please adjust the path per your Homebrew installation.
Licensed under the Apache License, Version 2.0. See LICENSE for details.
Fixes:
lib
directory.Fixes:
shard.yml
at commit (not version).Breaking changes:
tag: v1.0.0
is converted to version: 1.0.0
).Features:
--local
argument to use the cache as-is, allowing to skip git fetches
when you know the cache is up-to-date;Fixes:
Breaking changes:
shard.yml
spec is now required in libraries.Features:
1.2.3.alpha
or 1.0.0-rc1
.Fixes:
~> 0.1.0
wrongly matched 0.10.0
).1.0.0
and 1.0.0.1
are now correctly
ordered and compared as 1.0.0.1 > 1.0.0
.install -t
isn't supported on macOS.Fixes:
update
command.Features:
Changes:
~/.cache/shards
). Customizable with SHARDS_CACHE_PATH
.man
folder.Fixes:
Features:
Fixes:
shard.lock
when shard.yml
has no dependencies, see #145Fixes:
Features:
targets
entry in SPECcrystal
entry in SPEClibraries
entry in SPECBreaking Changes:
lib
directorysrc
folderpostinstall
scripts are now executed from the root of the dependency,
not the src
directoryFixes:
tar
command usage on OpenBSDFixes:
Fixes:
Fixes:
Fixes:
Features:
Fixes:
Fixes:
Fixes:
Fixes:
Fixes:
shard.yml
when installing legacy dependencies, see #60libs
and .shards
folders when required, see #61Breaking Change:
--no-colors
option as --no-color
to match crystalFeatures:
shard.yml
filesEnhancements:
Fixes:
Features:
--production
parameter to skip development dependenciesBreaking Changes:
development_dependencies
), see #27Fixes:
Fixes:
Features:
shard.yml
from Git tags and Projectfile
dependencies, see #6Fixes:
Fixes:
shard.yml
files;src
folder as the libs/<name>
folder for both
Git and path resolvers.Initial release.
Other