File: Manual.hs

package info (click to toggle)
haskell-shake 0.13.2%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 888 kB
  • ctags: 127
  • sloc: haskell: 6,388; makefile: 35; ansic: 25; sh: 2
file content (24 lines) | stat: -rw-r--r-- 877 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

module Examples.Test.Manual(main) where

import Development.Shake
import Development.Shake.FilePath
import Examples.Util
import General.Base


main = shaken test $ \args obj ->
    action $ liftIO $ error "The 'manual' example should only be used in test mode"

test build obj = do
    copyDirectoryChanged "docs/manual" $ obj "manual"
    copyDirectoryChanged "Development" $ obj "manual/Development"
    copyDirectoryChanged "General" $ obj "manual/General"
    copyFileChanged "Paths.hs" $ obj "manual/Paths_shake.hs"
    let cmdline = if isWindows then "build.bat" else "/bin/sh build.sh"
    () <- cmd [Cwd $ obj "manual", Shell] cmdline "-j2"
    assertExists $ obj "manual/_build/run" <.> exe
    () <- cmd [Cwd $ obj "manual", Shell] cmdline
    () <- cmd [Cwd $ obj "manual", Shell] [cmdline,"clean"]
    assertMissing $ obj "manual/_build/run" <.> exe
    return ()