github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

nfjinjing / nemesis

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 16
    • 1
  • Source
  • Commits
  • Network (1)
  • Issues (0)
  • Downloads (0)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (1)
    • master ✓
  • Tags (0)
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

a rake like task management tool — Read more

  cancel

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

clean up 
nfjinjing (author)
Wed Oct 28 05:05:29 -0700 2009
commit  de9134d6140ddc70ffcd097033f4d8ace77b5900
tree    c081757f2d4433eebcae86a7df175c5d6fb0b0bd
parent  223007ca567d6dec70c785b2bfa6aa138a7be712
nemesis /
name age
history
message
file .gitignore Sat Jun 13 16:15:36 -0700 2009 6.14.2 release [nfjinjing]
file LICENSE Wed Oct 28 05:03:59 -0700 2009 remove jpg [nfjinjing]
file Nemesis Sun Aug 16 09:49:22 -0700 2009 nemesis use - syntax [nfjinjing]
file Setup.lhs Thu Jun 11 22:09:21 -0700 2009 init [nfjinjing]
file changelog.md Tue Oct 06 22:04:40 -0700 2009 new release [nfjinjing]
file known-issues.md Tue Jun 23 08:46:02 -0700 2009 rename [nfjinjing]
file nemesis.cabal Tue Oct 06 22:04:40 -0700 2009 new release [nfjinjing]
file readme.md Wed Oct 28 05:05:29 -0700 2009 clean up [nfjinjing]
directory src/ Tue Oct 06 22:04:40 -0700 2009 new release [nfjinjing]
readme.md

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

Use a separator below language extensions, e.g.

{-# LANGUAGE QuasiQuotes #-}

-- Nem

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

currently the separator -- Nem is hard coded

Build it yourself

If you don't want nemesis to compile Nemesis through intermediate nemesis-tmp.hs file, rename your Nemesis to Nemesis.hs, then start with this template.

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

The logic is that whenever main is defined in Nemesis.hs, nemesis will act as ghc --make wrapper, so you can get nice error messages.

Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server