No description or website provided.
Haskell Nix
Latest commit 9e50c5d Mar 19, 2016 @nfjinjing clean up language ext
Permalink
Failed to load latest commit information.
src clean up language ext Mar 19, 2016
test update readme and tests Mar 19, 2016
.gitignore update Mar 19, 2016
LICENSE update cabal Mar 19, 2016
Nemesis.hs expose utils Mar 19, 2016
Setup.lhs init Jun 12, 2009
changelog.md fix cabal Mar 19, 2016
default.nix refactoring Mar 19, 2016
known-issues.md rename Jun 23, 2009
nemesis.cabal expose utils Mar 19, 2016
nemesis.nix update Mar 19, 2016
readme.md update readme and tests Mar 19, 2016
shell.nix refactoring Mar 19, 2016

readme.md

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