From f29e10402d7cba68264f06d8644712e189e17142 Mon Sep 17 00:00:00 2001 From: Daniel Gröber Date: Tue, 30 Jul 2019 16:08:18 +0200 Subject: Split SProjType along build-tool line This makes it much easier to deal with differences between the build tools as we can now have functions that only make sense for Cabal and statically enforce this by passing a 'SCabalProjType pt' as evidence that $pt \in {V1, V2}$. --- tests/Examples.hs | 2 +- tests/GhcSession.hs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'tests') diff --git a/tests/Examples.hs b/tests/Examples.hs index 607b83d..e1fda9e 100644 --- a/tests/Examples.hs +++ b/tests/Examples.hs @@ -49,7 +49,7 @@ parseOpts argv = doCabalV2 :: IO () doCabalV2 = do _ <- systemV "cabal new-build --builddir=dist-newstyle" - qe <- mkQueryEnv (ProjLocV2Dir ".") (DistDirV2 "dist-newstyle/") + qe <- mkQueryEnv (ProjLocV2Dir ".") (DistDirCabal SCV2 "dist-newstyle/") printUnitInfos qe doCabalV1 :: IO () diff --git a/tests/GhcSession.hs b/tests/GhcSession.hs index 871fddd..22b94b4 100644 --- a/tests/GhcSession.hs +++ b/tests/GhcSession.hs @@ -419,8 +419,8 @@ data ProjSetupImpl pt = oldBuildProjSetup :: ProjSetup0 oldBuildProjSetup = ProjSetupDescr "cabal-v1" $ Right $ Ex $ ProjSetupImpl - { psiProjType = SV1 - , psiDistDir = \dir -> DistDirV1 (dir "dist") + { psiProjType = SCabal SCV1 + , psiDistDir = \dir -> DistDirCabal SCV1 (dir "dist") , psiProjLoc = \(CabalFile cf) projdir -> ProjLocV1CabalFile cf projdir , psiConfigure = \progs dir -> runWithCwd dir (cabalProgram progs) [ "configure" ] @@ -433,8 +433,8 @@ oldBuildProjSetup = ProjSetupDescr "cabal-v1" $ Right $ Ex $ ProjSetupImpl newBuildProjSetup :: ProjSetup0 newBuildProjSetup = ProjSetupDescr "cabal-v2" $ Right $ Ex $ ProjSetupImpl - { psiProjType = SV2 - , psiDistDir = \dir -> DistDirV2 (dir "dist-newstyle") + { psiProjType = SCabal SCV2 + , psiDistDir = \dir -> DistDirCabal SCV2 (dir "dist-newstyle") , psiProjLoc = \_cabal_file projdir -> ProjLocV2File $ projdir "cabal.project" -- TODO: check if cabal.project is there and only use -- V2File then, also remove addCabalProject below so we -- cgit v1.2.3