@@ -51,11 +51,15 @@ elm lbi = (buildDir lbi) </> "elm" </> "elm"
5151
5252
5353main :: IO ()
54−main = defaultMainWithHooks simpleUserHooks { buildHook = myBuild, postBuild = myPostBuild }
54+main = defaultMainWithHooks simpleUserHooks { {-- buildHook = myBuild, --} postBuild = myPostBuildWithTypes }
5555
5656
5757-- Build
5858
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
5963myBuild :: PackageDescription -> LocalBuildInfo -> UserHooks -> BuildFlags -> IO ()
6064myBuild pd lbi uh bf = do
6165 putStrLn $ "Custom build step started: compile " ++ elmDoc
@@ -97,6 +101,12 @@ buildTypes lbi = do
97101
98102-- Post Build
99103
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
109+
100110myPostBuild :: Args -> BuildFlags -> PackageDescription -> LocalBuildInfo -> IO ()
101111myPostBuild as bfs pd lbi = do
102112 putStrLn "Custom post build step started: build elm-runtime.js"