Skip to content
Newer
Older
100644 35 lines (27 sloc) 838 Bytes
9f9c0b1 @dmpots Initial Revision
authored
1 #!/usr/bin/env runhaskell
2 import Distribution.Simple
4d8fb90 @dmpots Use separate repository for config dir
authored
3 import Distribution.PackageDescription
031c266 @dmpots Added ability to use local run configurations
authored
4 import Control.Monad
5 import System.Directory
fed1050 @dmpots Rename benchmark finding file
authored
6 import FindBench
ae70834 @dmpots Stop using template haskell for config finder
authored
7 import FindConfig
031c266 @dmpots Added ability to use local run configurations
authored
8
4d8fb90 @dmpots Use separate repository for config dir
authored
9 main = defaultMainWithHooks simpleUserHooks {
10 preConf = createConfDir
11 , postConf = writeLocalConf
12 , postClean = deleteLocalConf}
13
14 createConfDir _ _ = do
15 e <- doesDirectoryExist configDir
16 unless e (createDirectory configDir)
17 return emptyHookedBuildInfo
031c266 @dmpots Added ability to use local run configurations
authored
18
19 writeLocalConf _ _ _ _ = do
ae70834 @dmpots Stop using template haskell for config finder
authored
20 findLocalConfigs configDir
21 findLocalBenchmarks benchmarkDir
031c266 @dmpots Added ability to use local run configurations
authored
22
23 deleteLocalConf _ _ _ _ = do
ae70834 @dmpots Stop using template haskell for config finder
authored
24 deleteIfExists (localConfigsFileName configDir)
031c266 @dmpots Added ability to use local run configurations
authored
25
ae70834 @dmpots Stop using template haskell for config finder
authored
26 deleteIfExists :: FilePath -> IO ()
27 deleteIfExists f = do
031c266 @dmpots Added ability to use local run configurations
authored
28 e <- doesFileExist f
29 when e (removeFile f)
30
31
a179ae1 @dmpots Generate the benchmarks list automatically
authored
32 configDir, benchmarkDir :: FilePath
031c266 @dmpots Added ability to use local run configurations
authored
33 configDir = "config"
a179ae1 @dmpots Generate the benchmarks list automatically
authored
34 benchmarkDir = "benchmarks"
Something went wrong with that request. Please try again.