nemesis

a task management tool for Haskell http://github.com/nfjinjing/nemesis

Latest on Hackage:2016.3.19

This package is not currently in any snapshots. If you're interested in using it, we recommend adding it to Stackage Nightly. Doing so will make builds more reliable, and allow stackage.org to host generated Haddocks.

BSD3 licensed by Jinjing Wang
Maintained by Jinjing Wang

Nemesis: a task management tool for Haskell

Demo

import System.Nemesis

main = run $ do

  clean
    [ "**/*.hi"
    , "**/*.o"
    , "manifest"
    ]

  task "dist" $ do
    sh "cabal clean"
    sh "cabal configure"
    sh "cabal sdist"

  task "i" (sh "ghci -isrc src/System/Nemesis.hs")

  task "manifest" $ do
    sh "find . | grep 'hs$' > manifest"

Tutorial

Install

cabal update
cabal install nemesis

DSL

Create a file named Nemesis

import System.Nemesis
import System.Nemesis.Utils ((-))
import Prelude hiding ((-))

main = run - do

  -- desc is optional, it gives some description to the task
  -- task syntax: task "keyword: space seperated dependencies" io-action
  desc "Hunter attack macro"
  task "attack: pet-attack auto-attack" (putStrLn "attack macro done!")

  desc "Pet attack"
  task "pet-attack: mark" - do
    sh "echo 'pet attack'"

  desc "Hunter's mark"
  task "mark" - do
    sh "echo \"casting hunter's mark\""

  desc "Auto attack"
  task "auto-attack" - do
    sh "echo 'auto shoot'"

Run

runghc Nemesis

attack          Hunter attack macro
auto-attack     Auto attack
mark            Hunter's mark
pet-attack      Pet attack

runghc Nemesis attack

casting hunter's mark
pet attack
auto shoot
attack macro done!

Namespace

Create namespaces for tasks with the keyword namespace

import System.Nemesis
import System.Nemesis.Utils ((-))
import Prelude hiding ((-))

main = run - do

  namespace "eat" - do

    task "bread: salad" - putStrLn "eating bread"
    task "salad: /drink/coke" - putStrLn "eating salad"


  namespace "drink" - do

    task "coke" - putStrLn "drinking coke"

Namespaces are referenced as path components.

runghc Nemesis bread

Nemesis: bread does not exist!

runghc Nemesis eat/bread

drinking coke
eating salad
eating bread

Hints

  • alias runghc Nemesis to something sweeter, e.g. n

Changes

2016.3.19

  • remove air dependency

2013.6.16

  • add Glob dependency
  • remove binary version as it's not 'simple'

2009.10.7

Feature

  • allows 3 namespaces to be displayed in menu

2009.8.18

Fix

  • mps dep

2009.8.17

Feature

  • use - syntax in Nemesis file

2009.8.16

Feature

  • no $ noise

2009.8.4

Fix for Air ljust / rjust bug

2009.6.25

Fix

  • fail when can not compile
  • detect all possible nemesis name

2009.6.24

Feature

  • enrich nemesis to do task management too

2009.6.14.3

Feature

  • new keyword namespace

2009.6.14.2

Feature

  • nemesis bin rename to .nemesis, this keeps working directory clean

2009.6.14.1

Fix

  • only check "main ="
  • do not generate tmp file when name is Nemesis.hs

2009.6.14

Feature

  • Support compilable Nemesis, i.e. with import and main
  • sort task list when output

2009.6.13.2

Fix

  • use glob instead of zsh specific feature

2009.6.13.1

Feature

  • add clean keyword

Fix

  • allow space before ":" in task description
  • remove .o .hi for temp file

2009.6.13

Feature

  • add desc keyword

Fix

  • super fast compile
  • -Wall clean

2009.6.12

Init

Used by 1 package:
comments powered byDisqus