@@ -51,11 +51,15 @@ elm lbi = (buildDir lbi) </> "elm" </> "elm"
53main :: IO ()
53main :: IO ()
54−main = defaultMainWithHooks simpleUserHooks { buildHook = myBuild, postBuild = myPostBuild }
54+main = defaultMainWithHooks simpleUserHooks { {-- buildHook = myBuild, --} postBuild = myPostBuildWithTypes }
59+-- Not currently used. buildTypes is in 'myPostBuildWithTypes'
60+-- If using this again, change postBuild to 'myPostBuild'
61+-- Purpose is to make sure docs.json was built before elm exec was (as elm exec depended on it)
62+-- This is no longer true and the code below seems to affect cabal's build dependencies
59myBuild :: PackageDescription -> LocalBuildInfo -> UserHooks -> BuildFlags -> IO ()
63myBuild :: PackageDescription -> LocalBuildInfo -> UserHooks -> BuildFlags -> IO ()
60myBuild pd lbi uh bf = do
64myBuild pd lbi uh bf = do
61 putStrLn $ "Custom build step started: compile " ++ elmDoc
65 putStrLn $ "Custom build step started: compile " ++ elmDoc
@@ -97,6 +101,12 @@ buildTypes lbi = do
98-- Post Build
102-- Post Build
104+myPostBuildWithTypes :: Args -> BuildFlags -> PackageDescription -> LocalBuildInfo -> IO ()
105+myPostBuildWithTypes as bfs pd lbi = do
106+ putStrLn "Custom build step started: build docs.json"
107+ buildTypes lbi -- see note(1) below
108+ myPostBuild as bfs pd lbi
100myPostBuild :: Args -> BuildFlags -> PackageDescription -> LocalBuildInfo -> IO ()
110myPostBuild :: Args -> BuildFlags -> PackageDescription -> LocalBuildInfo -> IO ()
101myPostBuild as bfs pd lbi = do
111myPostBuild as bfs pd lbi = do
102 putStrLn "Custom post build step started: build elm-runtime.js"
112 putStrLn "Custom post build step started: build elm-runtime.js"