Skip to content

Commit

Permalink
Add suggestion of haskell/hie-bios#352
Browse files Browse the repository at this point in the history
  • Loading branch information
hanjoosten committed Jun 17, 2022
1 parent 410074d commit 442269a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
1 change: 1 addition & 0 deletions ReleaseNotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Unreleased changes
* [Issue #1293](https://github.com/AmpersandTarski/Ampersand/issues/1293) Fixed a bug in expressions of the form `r;V;s`
* Improve devcontainer functionality for developers of Ampersand.
* make the devcontainer experience even smoother (see https://github.com/haskell/hie-bios/issues/352)

## v4.6.3 (28 April 2022)
* [Issue #1267](https://github.com/AmpersandTarski/Ampersand/issues/1267) Automatically add ReleaseNotes to release artefacts
Expand Down
19 changes: 15 additions & 4 deletions Setup.hs
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,27 @@ import System.Process (readProcessWithExitCode)
import Prelude (print, putStrLn)

main :: IO ()
main = defaultMainWithHooks (simpleUserHooks {buildHook = generateHook})

generateHook :: PackageDescription -> LocalBuildInfo -> UserHooks -> BuildFlags -> IO ()
main =
defaultMainWithHooks
simpleUserHooks
{ buildHook = customBuildHook,
replHook = customReplHook
}

-- | Generate Haskell modules that are required for the build and start the build
generateHook pd lbi uh bf = do
customBuildHook :: PackageDescription -> LocalBuildInfo -> UserHooks -> BuildFlags -> IO ()
customBuildHook pd lbi uh bf = do
generateBuildInfoModule (T.pack . prettyShow . pkgVersion . package $ pd)
generateStaticFileModule
buildHook simpleUserHooks pd lbi uh bf -- start the build

-- | Generate Haskell modules that are required for the build and start the build
customReplHook :: PackageDescription -> LocalBuildInfo -> UserHooks -> ReplFlags -> [String] -> IO ()
customReplHook pd lbi uh rf args = do
generateBuildInfoModule (T.pack . prettyShow . pkgVersion . package $ pd)
generateStaticFileModule
replHook simpleUserHooks pd lbi uh rf args -- start the build

generateBuildInfoModule :: Text -> IO ()

-- | Generate a Haskell module that contains information that is available
Expand Down

0 comments on commit 442269a

Please sign in to comment.