A task runner for Swift projects
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
.gitignore
LICENSE
Package.swift
README.md

README.md

Swish

Current Version: 0.1.0

A task runner for Swift projects

Features

  • runs on Linux and Mac (note: only the open-source Swift is supported, sorry XCode users)
  • simple interface for declaring namespaces, tasks, and task dependencies
  • links with project library targets to run project-specific tasks

Installation

Swish can be installed using the Swift package manager. Add this line to your Package.swift file to install the latest version.

.Package(url: "https://github.com/bppr/Swish.git", Version(0,1,0))

Configuration

Create a Tasks target that depends on your project libraries. In your main.swift file, add the following:

import Swish
try Swish.run()

Defining tasks

import Swish

// create a task executable with `swish say-hello`
Swish.task("say-hello") {
  print("Hello, world")
}

// create a task executable with `swish say-hello-and-goodbye`
// declare a dependency on `say-hello`
// Swish will run say-hello before it runs this task
Swish.task("say-hello-and-goodbye", ["say-hello"]) {
  print("And goodnight!")
}

Usage

Once you've defined some tasks, simply build your task project (swift build) and run Swish

.build/Tasks/Tasks

To run a task, give Swish a task key

.build/Tasks/Tasks say-hello
.build/Tasks/Tasks say-hello-and-goodbye

Swish can run multiple tasks at once:

.build/Tasks/Tasks say-hello say-hello-and-goodbye

But it only runs dependent tasks once -- since say-hello is a dependency, Swish checks to see if it's been run before running it again with say-hello-and-goodbye.

Pluggable

Swish exposes its task API as a simple key-to-function relationship. If you can run it, you can run it from Swish.