Giter VIP home page Giter VIP logo

shards's Introduction

Shards

CI

Dependency manager for the Crystal language.

Usage

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.

Install

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!

Developers

Requirements

These requirements are only necessary for compiling Shards.

  • Crystal

    Please refer to https://crystal-lang.org/install/ for instructions for your operating system.

  • molinillo

    The shard molinillo needs to be in the Crystal path. It is available at https://github.com/crystal-lang/crystal-molinillo You can install it either with a pre-existing shards binary (running shards install) or just check out the repository at lib/crystal-molinillo (make lib).

  • 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.

  • asciidoctor

    Needed for building manpages.

Getting started

It is strongly recommended to use make for building shards and developing it. The Makefile contains recipes for compiling and testing. Building with make also ensures the source dependency molinillo is installed. You don't need to take care of this yourself.

Run make bin/shards to build the binary.

  • release=1 for a release build (applies optimizations)
  • static=1 for static linking (only works with musl-libc)
  • debug=1 for 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_unit runs unit tests (./spec/unit)
  • make test_integration runs integration tests (./spec/integration) on bin/shards

Run make docs to build the manpages.

License

Licensed under the Apache License, Version 2.0. See LICENSE for details.

shards's People

Contributors

ysbaddaden avatar straight-shoota avatar waj avatar oprypin avatar asdffdsdaf avatar sija avatar rx14 avatar bcardiff avatar beta-ziliani avatar asterite avatar f-fr avatar luislavena avatar kimburgess avatar samueleaton avatar jhass avatar kalafut avatar jessedoyle avatar szabgab avatar elebow avatar syeopite avatar songjiayang avatar rdp avatar kojix2 avatar fudanchii avatar zatherz avatar willamin avatar stakach avatar sstarr avatar splattael avatar soveran avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.