Coder Social home page Coder Social logo

vknabel / rock Goto Github PK

View Code? Open in Web Editor NEW
13.0 5.0 0.0 81 KB

With Rock you can easily install CLIs built with Swift Package Manager. Prefer vknabel/Archery and yonaskolb/Mint instead

License: MIT License

Swift 91.36% Ruby 8.64%
swift clis linux swift-package-manager install dependancy-manager swift-3 swiftpm

rock's Introduction

Rock

With Rock you can easily manage your Project, metadata and Swift CLI dependencies. Additionally you can install Swift CLIs globally. The index of all supported libraries can be found on the RockSpecs repository, but you can declare your own at your Rockfile.

Overview

Dependencies are called Rockets (aka πŸš€). If they can be build with the Swift Package Manager, they should already be compatible out of the box. Each πŸš€ has a RocketSpec which defines the Git url and how it has to be installed.

Project

You can create a project by simply running:

$ rock init

This will create you an empty Rockfile which declares all your dependencies and metadata.

name: YourProject
dependencies:
  - empty # Just an empty dependency that installs fast
  # Insert your dependencies here
  # - [email protected]
  # - name: owncli
  #   url: https://github.com/your/owncli

Additionally you may create any additional tags. Each value will be interpreted as a Stencil template, that will be executed in a context of all previously declared values. The tags constants, version, license, name and url will have precedence.

After you have set up your metadata and dependencies, you can install those by running:

$ rock install

Now you can work with all your CLIs. If you want to create your own custom scripts, you can add the script tag:

name: YourProject
dependencies: [] # your dependencies
author:
  name: Valentin Knabel
  email: [email protected]
scripts:
  hello: echo Hello {{ author.name }}
  xcodeproj:
    - swift package generate-xcodeproj
    - open {{ name }}.xcodeproj

Thereafter you are able to run all your scripts with ease:

$ rock run hello
Hello Valentin Knabel

Additionally there are convenience commands with default scripts made for the Swift Package Manager:

$ rock build
πŸƒ swift build
$ rock test
πŸƒ swift test
$ rock archive
πŸƒ swift build -c release

Global

Installing dependencies globally is currently only supported for Rockets that can be found in the RockSpecs repository. You may install them by simply running:

# With a fixed version/tag/branch
$ rock install [email protected] [email protected]
# Or using the default (e.g. master)
$ rock install swiftgen

If you want to uninstall specific Rockets, just run:

$ rock uninstall sourcery swiftlint swiftgen

Installation

First add the rock-bin to your $PATH variable to your .bashrc, .bash_profile or .zshrc.

export ROCK_PATH="$HOME/.rock" # default
export PATH="$PATH:./.rock/bin:$ROCK_PATH/bin"

Thereafter start 🎸ing your πŸš€s by simply cloning the repository, building the swift module and installing rock itself.

$ git clone https://github.com/vknabel/rock $ROCK_PATH/sources/rock
$ cd $ROCK_PATH/sources/rock
$ swift build
$ mkdir $ROCK_PATH/bin
$ cp $ROCK_PATH/sources/rock/.build/debug/rock $ROCK_PATH/bin

Alternatively you may try out our Swift Installer (you still need to set up your $PATH and ROCK_PATH):

$ curl -sL https://raw.githubusercontent.com/vknabel/Rock/master/Scripts/Install.generated.swift | swift -

Updates

Rock can be updated by simply running installing itself with a version specified.

$ rock install [email protected]

Limitations

  • Rock downloads and compiles all of your dependencies isolated and therefore installations may take a while.
  • Currently there is no version handling. Instead only the master branch will be checked out by default.

Author

Valentin Knabel, @vknabel, [email protected]

License

Rock is available under the MIT license.

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.