From b6a14bce539c88da35783b2760afff28d7c4e579 Mon Sep 17 00:00:00 2001 From: David Raymond Christiansen Date: Thu, 2 Jan 2014 16:46:56 +0100 Subject: [PATCH] Fix source locations for generated version number --- .gitignore | 1 + Setup.hs | 13 +++++++++++-- idris.cabal | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index b06dca407f..a754059777 100644 --- a/.gitignore +++ b/.gitignore @@ -29,3 +29,4 @@ tutorial/*.fdb_latexmk tutorial/*.fls tags TAGS +src/Version_idris.hs diff --git a/Setup.hs b/Setup.hs index 4fad5637dd..a8c3930bce 100644 --- a/Setup.hs +++ b/Setup.hs @@ -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 @@ -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 + } diff --git a/idris.cabal b/idris.cabal index 7c97d724aa..acf324804f 100644 --- a/idris.cabal +++ b/idris.cabal @@ -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