module Distribution.Simple.Program.Hpc
( markup
, union
) where
import Distribution.ModuleName ( ModuleName )
import Distribution.Simple.Program.Run
( ProgramInvocation, programInvocation, runProgramInvocation )
import Distribution.Simple.Program.Types ( ConfiguredProgram )
import Distribution.Text ( display )
import Distribution.Verbosity ( Verbosity )
markup :: ConfiguredProgram
-> Verbosity
-> FilePath
-> FilePath
-> FilePath
-> [ModuleName]
-> IO ()
markup hpc verbosity tixFile hpcDir destDir excluded =
runProgramInvocation verbosity
(markupInvocation hpc tixFile hpcDir destDir excluded)
markupInvocation :: ConfiguredProgram
-> FilePath
-> FilePath
-> FilePath
-> [ModuleName]
-> ProgramInvocation
markupInvocation hpc tixFile hpcDir destDir excluded =
let args = [ "markup", tixFile
, "--hpcdir=" ++ hpcDir
, "--destdir=" ++ destDir
]
++ ["--exclude=" ++ display moduleName
| moduleName <- excluded ]
in programInvocation hpc args
union :: ConfiguredProgram
-> Verbosity
-> [FilePath]
-> FilePath
-> [ModuleName]
-> IO ()
union hpc verbosity tixFiles outFile excluded =
runProgramInvocation verbosity
(unionInvocation hpc tixFiles outFile excluded)
unionInvocation :: ConfiguredProgram
-> [FilePath]
-> FilePath
-> [ModuleName]
-> ProgramInvocation
unionInvocation hpc tixFiles outFile excluded =
programInvocation hpc $ concat
[ ["sum", "--union"]
, tixFiles
, ["--output=" ++ outFile]
, ["--exclude=" ++ display moduleName
| moduleName <- excluded ]
]