nemesis: a Rake like task management tool

[ bsd3, library, tools ] [ Propose Tags ]

smart per project code snippets


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 2009.6.12, 2009.6.13, 2009.6.13.1, 2009.6.13.2, 2009.6.14, 2009.6.14.1, 2009.6.14.2, 2009.6.14.3, 2009.6.24, 2009.6.25, 2009.8.4, 2009.8.16, 2009.8.17, 2009.8.18, 2009.10.7, 2010.10.4, 2010.10.4.1.1, 2011.6.12, 2011.6.19, 2011.10.12, 2012.5.24, 2012.5.24.1, 2012.12.18, 2013.6.13, 2013.6.16, 2013.6.22, 2013.7.27, 2014.5.19, 2015.5.4, 2016.3.19, 2018.1.27
Change log changelog.md
Dependencies base (>=4 && <5), containers, data-default, directory, Glob (>=0.4), haskell98, mps (>=2009.9.18), mtl, old-time, process, time [details]
License BSD-3-Clause
Author Jinjing Wang
Maintainer Jinjing Wang <nfjinjing@gmail.com>
Category Web
Home page http://github.com/nfjinjing/nemesis
Uploaded by JinjingWang at 2010-10-03T21:05:46Z
Distributions NixOS:2018.1.27
Reverse Dependencies 2 direct, 0 indirect [details]
Executables nemesis
Downloads 22159 total (81 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]

Readme for nemesis-2010.10.4

[back to package description]

Nemesis: a rake like task management tool for haskell

Demo

nemesis = 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

Put the following code into a file named Nemesis

nemesis = do

  -- desc is optional, it gives some description to the following task
  desc "Hunter attack macro"

  -- syntax: task "keyword: dependencies" io-action
  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

run nemesis

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

run nemesis attack

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

Namespace

Suppose you have the following tasks

nemesis = do

  namespace "eat" - do

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


  namespace "drink" - do

    task "coke" - putStrLn "drinking coke"

then

nemesis bread =>
.nemesis: bread does not exist!

nemesis eat/bread =>
drinking coke
nice salad
eating bread

Advance usage

Use LANGUAGE progam

Put a -- Nem token after the Langauge progma

{-# LANGUAGE QuasiQuotes #-}

-- Nem

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

currently the separator -- Nem is hard coded

By pass preprocessing, e.g. use custom imports

Define main, i.e. add main = run nemesis in the code. The preprocessor look for the function main, if it's defined, it skip preprocessing, and Nemesis because pure EDSL that can be run by runhaskell.

For example:

import System.Nemesis (run)
import System.Nemesis.DSL
import MPS.Light ((-))
import Prelude hiding ((-))

nemesis = do
  task "i" (sh "ghci -isrc src/System/Nemesis.hs")
    
main = run nemesis

Test out by:

runghc Nemesis

Who is mnemosyne?

mnemosyne

OK, I made a mistake in the project name, but she's a cool goddess none the less.