Skip to content

Commit

Permalink
Add parsing of profiling-shared and use-unicode
Browse files Browse the repository at this point in the history
  • Loading branch information
jgotoh committed Aug 11, 2024
1 parent 48ed25f commit 41a611e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ packageConfigFieldGrammar knownPrograms =
<*> optionalFieldDef "executable-static" L.packageConfigFullyStaticExe mempty
<*> optionalFieldDef "profiling" L.packageConfigProf mempty
<*> optionalFieldDef "library-profiling" L.packageConfigProfLib mempty
<*> optionalFieldDef "profiling-shared" L.packageConfigProfShared mempty
<*> optionalFieldDef "executable-profiling" L.packageConfigProfExe mempty
<*> optionalFieldDef "profiling-detail" L.packageConfigProfDetail mempty
<*> optionalFieldDef "library-profiling-detail" L.packageConfigProfLibDetail mempty
Expand Down Expand Up @@ -162,6 +163,7 @@ packageConfigFieldGrammar knownPrograms =
<*> optionalFieldDefAla "haddock-base-url" (alaFlag Token) L.packageConfigHaddockBaseUrl mempty
<*> optionalFieldDefAla "haddock-resources-dir" (alaFlag Token) L.packageConfigHaddockResourcesDir mempty
<*> optionalFieldDefAla "haddock-output-dir" (alaFlag FilePathNT) L.packageConfigHaddockOutputDir mempty
<*> optionalFieldDef "haddock-use-unicode" L.packageConfigHaddockUseUnicode mempty
<*> optionalFieldDef "haddock-for-hackage" L.packageConfigHaddockForHackage mempty
<*> optionalFieldDef "test-log" L.packageConfigTestHumanLog mempty
<*> optionalFieldDef "test-machine-log" L.packageConfigTestMachineLog mempty
Expand Down
8 changes: 8 additions & 0 deletions cabal-install/src/Distribution/Client/ProjectConfig/Lens.hs
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,10 @@ packageConfigProfLib :: Lens' PackageConfig (Flag Bool)
packageConfigProfLib f s = fmap (\x -> s{T.packageConfigProfLib = x}) (f (T.packageConfigProfLib s))
{-# INLINEABLE packageConfigProfLib #-}

packageConfigProfShared :: Lens' PackageConfig (Flag Bool)
packageConfigProfShared f s = fmap (\x -> s{T.packageConfigProfShared = x}) (f (T.packageConfigProfShared s))
{-# INLINEABLE packageConfigProfShared #-}

packageConfigProfExe :: Lens' PackageConfig (Flag Bool)
packageConfigProfExe f s = fmap (\x -> s{T.packageConfigProfExe = x}) (f (T.packageConfigProfExe s))
{-# INLINEABLE packageConfigProfExe #-}
Expand Down Expand Up @@ -512,6 +516,10 @@ packageConfigHaddockOutputDir :: Lens' PackageConfig (Flag FilePath)
packageConfigHaddockOutputDir f s = fmap (\x -> s{T.packageConfigHaddockOutputDir = x}) (f (T.packageConfigHaddockOutputDir s))
{-# INLINEABLE packageConfigHaddockOutputDir #-}

packageConfigHaddockUseUnicode :: Lens' PackageConfig (Flag Bool)
packageConfigHaddockUseUnicode f s = fmap (\x -> s{T.packageConfigHaddockUseUnicode = x}) (f (T.packageConfigHaddockUseUnicode s))
{-# INLINEABLE packageConfigHaddockUseUnicode #-}

packageConfigHaddockForHackage :: Lens' PackageConfig (Flag HaddockTarget)
packageConfigHaddockForHackage f s = fmap (\x -> s{T.packageConfigHaddockForHackage = x}) (f (T.packageConfigHaddockForHackage s))
{-# INLINEABLE packageConfigHaddockForHackage #-}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@ testProjectConfigLocalPackages = do
packageConfigFullyStaticExe = Flag True
packageConfigProf = Flag True
packageConfigProfLib = Flag True
packageConfigProfShared = Flag False
packageConfigProfExe = Flag True
packageConfigProfDetail = Flag ProfDetailAllFunctions
packageConfigProfLibDetail = Flag ProfDetailExportedFunctions
Expand Down Expand Up @@ -386,6 +387,7 @@ testProjectConfigLocalPackages = do
packageConfigHaddockBaseUrl = Flag "https://example.com/haddock-base-url"
packageConfigHaddockResourcesDir = Flag "/haddock/static"
packageConfigHaddockOutputDir = Flag "/haddock/output"
packageConfigHaddockUseUnicode = Flag False
packageConfigHaddockForHackage = Flag ForHackage
packageConfigTestHumanLog = Flag $ toPathTemplate "human-log.log"
packageConfigTestMachineLog = Flag $ toPathTemplate "machine.log"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ executable-dynamic: True
executable-static: True
profiling: True
library-profiling: True
profiling-shared: False
executable-profiling: True
profiling-detail: all-functions
library-profiling-detail: exported-functions
Expand Down Expand Up @@ -56,6 +57,7 @@ haddock-index-location: separately-generated/HTML/index
haddock-base-url: https://example.com/haddock-base-url
haddock-resources-dir: /haddock/static
haddock-output-dir: /haddock/output
haddock-use-unicode: False
haddock-for-hackage: for-hackage

test-log: human-log.log
Expand Down

0 comments on commit 41a611e

Please sign in to comment.