MyNixOS website logo
Description

simple and interactive command-line build tool.

Shaker is a build tool which allow to simply compile or launch test on an haskell project and provides some interesting features like continuous action. With continuous action, an action (compile or test) will be automatically executed when a source modification is detected.

All configuration are made via cabal; Shaker will read cabal configuration to discover source directories, compilation options and targets to compile.

Usage

The cabal configuration file should be generated beforehand with cabal configure. If you change your cabal configuration, you will need to recreate the configuration file.

Launch interactive prompt

In the root of your haskell project, launch shaker. An interactive prompt will allow you to execute different actions.

Launch a shaker action from command-line

In the root of your haskell project, launch shaker with your action as a command argument; shaker will execute the given action and exit. See examples for more details.

Action execution

Simple Execution

An action can be launched normally, by entering the action name.

Multiple action execution

You can specify multiple action to execute simply by separating action by spaces.

Continuous Action

A continuous action will execute the action when a file modification has been detected. Every action are elligible to continuous action, you simply need to prefix them with ~. To stop a continuous action, simply use ^C.

Available actions

compile

Compile the project. Targets of the compilation are main files (in case of executable) and exposed modules (in case of library).

fullcompile

Compile all hs files found in source directory. It is usefull to compile sources not declared in cabal. Since it is not possible to compile multiple modules with main, all modules with a main function are excluded.

help

Print all available action.

clean

Clean the directory containing .o and .hi files.

test

Launch all quickcheck properties and hunit tests of the project using test-framework. You can provide one or several regexps as argument and shaker will execute all tests matching one regexp. Quickcheck properties and HUnit tests are automatically discovered using GHC Api. All functions begining with “prop_” are considered as quickcheck properties and all functions of type Test.HUnit.Lang.Assertion and TestCase are considered as HUnit tests.

test-module

Same as test but test-module takes one or several module patterns as arguments.

quit

Exit the application. You can also use ^C or ^D to exit shaker.

Examples with interactive prompt

% compile

Simply compile the project

% clean compile

Clean and compile the project

% ~compile

Switch to continuous mode and will compile the project when sources are modified.

% ~clean compile

Switch to continuous mode and will clean and compile the project when sources are modified.

% test

Execute all tests in the project

% test prop_.*

Execute all quickcheck properties of the project.

% test testExecute.* testFilter.*

Execute all tests matching testExecute.* or testFilter.*

% test-module Regex Refle

Launch all tests in modules matching Regex.* or Refle.*

Examples with command-line

% shaker fullcompile

Launch shaker, execute the fullcompile action and give back the control.

% shaker "~fullcompile"

Launch shaker, continuously execute the fullcompile action until shaker is interrupted.

Metadata

Version

0.5.1

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows