on master help sign in
Add -f execonly to omit library/rts builds

This reduces the compile/test cycle time in development when there's no effect on the libraries.

commitb4938580b25be56b22246d51acb5f53aeb2c3257 authorEdwin Brady <ecb10@st-andrews.ac.uk> dateTue 17 Mar 2015, 11:40 (12 years ago) parente6d1cfd
2 files changed+14−2
Setup.hs+9−2 idris.cabal+5
Setup.hs+9−2
@@ -57,6 +57,13 @@ usesGMP flags =
5757 Just False -> False
5858 Nothing -> True
5959
60+execOnly :: S.ConfigFlags -> Bool
61+execOnly flags =
62+ case lookup (FlagName "execonly") (S.configConfigurationsFlags flags) of
63+ Just True -> True
64+ Just False -> False
65+ Nothing -> True
66+
6067isRelease :: S.ConfigFlags -> Bool
6168isRelease flags =
6269 case lookup (FlagName "release") (S.configConfigurationsFlags flags) of
@@ -176,7 +183,7 @@ getVersion args flags = do
176183 let buildinfo = (emptyBuildInfo { cppOptions = ["-DVERSION="++hash] }) :: BuildInfo
177184 return (Just buildinfo, [])
178185
179−idrisBuild _ flags _ local = do
186+idrisBuild _ flags _ local = unless (execOnly (configFlags local)) $ do
180187 buildStdLib
181188 buildRTS
182189 where
@@ -199,7 +206,7 @@ idrisBuild _ flags _ local = do
199206-- -----------------------------------------------------------------------------
200207-- Copy/Install
201208
202−idrisInstall verbosity copy pkg local = do
209+idrisInstall verbosity copy pkg local = unless (execOnly (configFlags local)) $ do
203210 installStdLib
204211 installRTS
205212 where
idris.cabal+5
@@ -658,6 +658,11 @@ Flag CI
658658 Default: False
659659 manual: True
660660
661+Flag execonly
662+ Description: Build executables only, skip the libraries and RTS
663+ Default: False
664+ manual: True
665+
661666Library
662667 hs-source-dirs: src
663668 Exposed-modules: