aboutsummaryrefslogtreecommitdiff
path: root/src/CabalHelper
diff options
context:
space:
mode:
authorDaniel Gröber <dxld@darkboxed.org>2019-04-01 20:40:05 +0200
committerDaniel Gröber <dxld@darkboxed.org>2019-04-01 21:00:45 +0200
commita078ea73f07f95b0e55d13b51c104be749d0ed3d (patch)
tree5f4773ae0c245bc920ebb80be63d9019be1b0912 /src/CabalHelper
parent8111c0d83bb2619a68d72ff5d65e6ae81786b7e5 (diff)
Add ProjLocV1Dir for easier forward porting
Diffstat (limited to 'src/CabalHelper')
-rw-r--r--src/CabalHelper/Compiletime/Types.hs10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/CabalHelper/Compiletime/Types.hs b/src/CabalHelper/Compiletime/Types.hs
index 95eea9f..cffa663 100644
--- a/src/CabalHelper/Compiletime/Types.hs
+++ b/src/CabalHelper/Compiletime/Types.hs
@@ -66,7 +66,12 @@ data ProjLoc (pt :: ProjType) where
-- ending in @.cabal@ existing in the directory. More than one such files
-- existing is a user error. Note: For this project type the concepts of
-- project and package coincide.
- ProjLocCabalFile :: { plCabalFile :: !FilePath } -> ProjLoc 'V1
+ ProjLocV1CabalFile :: { plCabalFile :: !FilePath } -> ProjLoc 'V1
+
+ -- | A @cabal v1-build@ project directory. Same as 'ProjLocV1CabalFile' but
+ -- will search for the cabal file for you. If more than one @.cabal@ file
+ -- exists it will shamelessly throw an obscure exception.
+ ProjLocV1Dir :: { plPackageDir :: !FilePath } -> ProjLoc 'V1
-- | A @cabal v2-build@ project\'s marker file is called
-- @cabal.project@. This configuration file points to the packages that make
@@ -81,7 +86,8 @@ data ProjLoc (pt :: ProjType) where
deriving instance Show (ProjLoc pt)
plV1Dir :: ProjLoc 'V1 -> FilePath
-plV1Dir (ProjLocCabalFile cabal_file) = takeDirectory cabal_file
+plV1Dir (ProjLocV1CabalFile cabal_file) = takeDirectory cabal_file
+plV1Dir (ProjLocV1Dir pkgdir) = pkgdir
data DistDir (pt :: ProjType) where
-- | Build directory for cabal /old-build/ aka. /v1-build/ aka. just