loli-2009.6.29: Nemesis
nemesis = do
clean
[ "**/*.hi"
, "**/*.o"
, "manifest"
, "Test"
, "myloli"
, "pure_hack"
]
desc "prepare cabal dist"
task "dist" $ do
sh "cabal clean"
sh "cabal configure"
sh "cabal sdist"
desc "start console"
task "i" (sh "ghci -isrc src/Test.hs")
desc "put all .hs files in manifest"
task "manifest" $ do
sh "find . | grep 'hs$' > manifest"
desc "show sloc"
task "stat" $ do
sh "cloc -match-f=hs$ --quiet src --no3"
ghci "template" "Network/Loli/Template"
ghci "ipaste" "Test/LoliPaste"
bin "test" "Test/Test"
bin "paste" "Test/LoliPaste"
bin "myloli" "Test/myloli"
-- test
task "tl" $ sh "curl j:3000"
task "tp" $ sh "curl -d 'src=print' j:3000"
-- deploy
task "deploy" $ sh "scp -C .bin/paste easymic.com:~/link/loli/.bin"
task "start" $ do
sh "echo starting.."
sh ".bin/paste"
where
ghci n x = task n $ sh $ "ghci -isrc src/" ++ x ++ ".hs"
bin n x = task n $ do
sh $ "ghc --make -Wall -isrc src/" ++ x ++ ".hs -o .bin/" ++ n
sh $ "echo done.."
sh $ ".bin/" ++ n