aboutsummaryrefslogtreecommitdiff
path: root/src/CabalHelper/Compiletime/Program/CabalInstall.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/CabalHelper/Compiletime/Program/CabalInstall.hs')
-rw-r--r--src/CabalHelper/Compiletime/Program/CabalInstall.hs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/CabalHelper/Compiletime/Program/CabalInstall.hs b/src/CabalHelper/Compiletime/Program/CabalInstall.hs
index a4df188..637d577 100644
--- a/src/CabalHelper/Compiletime/Program/CabalInstall.hs
+++ b/src/CabalHelper/Compiletime/Program/CabalInstall.hs
@@ -1,3 +1,5 @@
+{-# LANGUAGE DataKinds #-}
+
-- cabal-helper: Simple interface to Cabal's configuration state
-- Copyright (C) 2018 Daniel Gröber <cabal-helper@dxld.at>
--
@@ -181,7 +183,7 @@ cabalWithGHCProgOpts = concat
else []
]
-planUnits :: CP.PlanJson -> IO [Unit]
+planUnits :: CP.PlanJson -> IO [Unit 'V2]
planUnits plan = do
units <- fmap catMaybes $ mapM takeunit $ Map.elems $ CP.pjUnits plan
case lefts units of
@@ -195,13 +197,16 @@ planUnits plan = do
{ uType=CP.UnitTypeLocal
, uDistDir=Just distdirv1
, uPkgSrc=Just (CP.LocalUnpackedPackage pkgdir)
+ , uComps=comps
} = do
cabal_file <- Cabal.findCabalFile pkgdir
+ let uiV2Components = map (Text.unpack . CP.dispCompName) $ Map.keys comps
return $ Just $ Right $ Unit
{ uUnitId = UnitId $ Text.unpack (coerce (CP.uId u))
, uPackageDir = pkgdir
, uCabalFile = CabalFile cabal_file
, uDistDir = DistDirLib distdirv1
+ , uImpl = UnitImplV2 {..}
}
takeunit u@CP.Unit {uType=CP.UnitTypeLocal} =
return $ Just $ Left u