Haskell的`Distribution.SimpleSetup``buildProgramPaths`和`buildProgramArgs`做了什么?

时间:2014-02-09 03:36:39

标签: haskell cabal

我尝试过向我的Setup.hs添加一个构建挂钩,如下所示:

ourBuildHook :: PackageDescription -> LocalBuildInfo -> UserHooks -> BuildFlags -> IO ()
ourBuildHook =
    let
        defaultBuildHook = buildHook simpleUserHooks

        doBuild descr info hooks flags =
            let
                originalPaths = buildProgramPaths flags
                originalArgs = buildProgramArgs flags
                modifiedFlags = flags {
                        buildProgramPaths = originalPaths ++ [("yo", "dawg")],
                        buildProgramArgs = originalArgs ++ [("what", ["up"])],
                        buildVerbosity = flag verbose
                    }
            in do
                defaultBuildHook descr info hooks modifiedFlags
    in
        doBuild

main = defaultMainWithHooks simpleUserHooks { buildHook = ourBuildHook }

然后我运行cabal build

但是我发现buildProgramPathsbuildProgramArgsbuildVerbosity defaultMainWithHooks添加后,我看不到任何影响。这些字段实际上是由{{1}}使用的,还是被忽略了?

0 个答案:

没有答案