summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvmchale <>2018-11-01 01:49:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2018-11-01 01:49:00 (GMT)
commit804c986102b27198cf0bf49278c05eb9f04494e4 (patch)
treec6f6c4890e567d4a3b6cc7842b523554022db41d
parent23992702312b3ee68a4341df2ed6564a19395c3d (diff)
version 1.10.2.01.10.2.0
-rw-r--r--CHANGELOG.md4
-rw-r--r--shake-ats.cabal4
-rw-r--r--src/Development/Shake/ATS.hs2
-rw-r--r--src/Development/Shake/ATS/Rules.hs5
-rw-r--r--src/Development/Shake/ATS/Type.hs1
5 files changed, 11 insertions, 5 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index d1f5d35..b338b1d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,9 @@
# shake-ats
+## 1.10.2.0
+
+ * `genATS` takes `cpphs` parameter again
+
## 1.10.1.0
* `genATS` no longer takes `cpphs` parameter
diff --git a/shake-ats.cabal b/shake-ats.cabal
index be286a7..6502580 100644
--- a/shake-ats.cabal
+++ b/shake-ats.cabal
@@ -1,6 +1,6 @@
cabal-version: 1.18
name: shake-ats
-version: 1.10.1.0
+version: 1.10.2.0
license: BSD3
license-file: LICENSE
copyright: Copyright: (c) 2018 Vanessa McHale
@@ -41,7 +41,7 @@ library
base >=4.9 && <5,
language-ats -any,
shake-ext >=3.0.0.0,
- hs2ats >=0.4.0.0,
+ hs2ats >=0.5.0.0,
directory -any,
microlens -any,
text -any,
diff --git a/src/Development/Shake/ATS.hs b/src/Development/Shake/ATS.hs
index 9a3d7ee..addfcd0 100644
--- a/src/Development/Shake/ATS.hs
+++ b/src/Development/Shake/ATS.hs
@@ -154,7 +154,7 @@ doLib Executable = pure mempty
doLib _ = id
hsAts :: ATSGen -> Rules ()
-hsAts (ATSGen x y) = genATS x y
+hsAts (ATSGen x y z) = genATS x y z
satsGen :: HATSGen -> Rules ()
satsGen (HATSGen x y) = genLinks x y
diff --git a/src/Development/Shake/ATS/Rules.hs b/src/Development/Shake/ATS/Rules.hs
index b25c2f6..4ea108a 100644
--- a/src/Development/Shake/ATS/Rules.hs
+++ b/src/Development/Shake/ATS/Rules.hs
@@ -26,11 +26,12 @@ import System.Directory
-- the equivalent types.
genATS :: FilePath -- ^ Haskell source
-> FilePattern -- ^ @.sats@ file to generate
+ -> Bool -- ^ Whether to call cpphs preprocessor
-> Rules ()
-genATS src' target =
+genATS src' target cpphs' =
target %> \out -> liftIO $ do
createDirectoryIfMissing True (takeDirectory out)
- genATSTypes src' out
+ genATSTypes src' out cpphs'
genLinks :: FilePath -> FilePath -> Rules ()
genLinks dats link =
diff --git a/src/Development/Shake/ATS/Type.hs b/src/Development/Shake/ATS/Type.hs
index 4ba6720..296da63 100644
--- a/src/Development/Shake/ATS/Type.hs
+++ b/src/Development/Shake/ATS/Type.hs
@@ -72,6 +72,7 @@ data HATSGen = HATSGen { satsFile :: FilePath -- ^ @.sats@ file containing type
data ATSGen = ATSGen { _hsFile :: FilePath -- ^ Haskell file containing types
, _atsTarget :: FilePath -- ^ ATS file to be generated
+ , _cpphs :: Bool -- ^ Whether to use the C preprocessor on the Haskell code
} deriving (Generic, Binary)
-- TODO split off haskell-related types and leave it more general??