Skip to content

Commit

Permalink
Use prett show to show component name
Browse files Browse the repository at this point in the history
  • Loading branch information
fendor committed Mar 27, 2019
1 parent 2ade9bb commit 056c810
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Cabal/Distribution/Simple/ShowBuildInfo.hs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ import Distribution.Simple.Utils (cabalVersion)
import Distribution.Simple.Utils.Json
import Distribution.Types.TargetInfo
import Distribution.Text
import Distribution.Pretty

-- | Construct a JSON document describing the build information for a package
mkBuildInfo :: PackageDescription -- ^ Mostly information from the .cabal file
Expand All @@ -89,7 +90,7 @@ mkBuildInfo pkg_descr lbi _flags targetsToBuild = info
]

mkCompilerInfo = JsonObject
[ "flavour" .= JsonString (show $ compilerFlavor $ compiler lbi)
[ "flavour" .= JsonString (prettyShow $ compilerFlavor $ compiler lbi)
, "compiler_id" .= JsonString (showCompilerId $ compiler lbi)
, "path" .= path
]
Expand All @@ -99,7 +100,7 @@ mkBuildInfo pkg_descr lbi _flags targetsToBuild = info

mkComponentInfo (name, clbi) = JsonObject
[ "type" .= JsonString compType
, "name" .= JsonString (show name)
, "name" .= JsonString (prettyShow name)
, "compiler_args" .= JsonArray (map JsonString $ getCompilerArgs bi lbi clbi)
, "modules" .= JsonArray (map (JsonString . display) modules)
, "source_files" .= JsonArray (map JsonString source_files)
Expand Down

0 comments on commit 056c810

Please sign in to comment.