Skip to content

Commit

Permalink
Fix source locations for generated version number
Browse files Browse the repository at this point in the history
  • Loading branch information
david-christiansen committed Jan 2, 2014
1 parent e985815 commit b6a14bc
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ tutorial/*.fdb_latexmk
tutorial/*.fls
tags
TAGS
src/Version_idris.hs
13 changes: 11 additions & 2 deletions Setup.hs
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,16 @@ idrisConfigure _ flags _ local = do
idrisPreSDist args flags = do
let dir = S.fromFlag (S.sDistDirectory flags)
let verb = S.fromFlag (S.sDistVerbosity flags)
generateVersionModule verb (dir </> "dist" </>"build" </> "autogen") True
generateVersionModule verb ("src") True
preSDist simpleUserHooks args flags

idrisPostSDist args flags desc lbi = do
Control.Exception.catch (do let file = "src" </> "Version_idris" Px.<.> "hs"
putStrLn $ "Removing generated module " ++ file
removeFile file)
(\e -> let e' = (e :: SomeException) in return ())
postSDist simpleUserHooks args flags desc lbi

-- -----------------------------------------------------------------------------
-- Build

Expand Down Expand Up @@ -203,4 +211,5 @@ main = defaultMainWithHooks $ simpleUserHooks
idrisInstall (S.fromFlag $ S.installVerbosity flags)
NoCopyDest pkg local
, preSDist = idrisPreSDist --do { putStrLn (show args) ; putStrLn (show flags) ; return emptyHookedBuildInfo }
}
, postSDist = idrisPostSDist
}
2 changes: 1 addition & 1 deletion idris.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ Flag release
manual: True

Library
hs-source-dirs: src, dist/build/autogen
hs-source-dirs: src
Exposed-modules:
Idris.Core.CaseTree
, Idris.Core.Constraints
Expand Down

0 comments on commit b6a14bc

Please sign in to comment.