Skip to content

Commit fbe5d8e

Browse files
committed
Tweaks to plan.json format
- New "exe-depends" field - Dropped "depends" when it's a package; you can use "components" to get the information Signed-off-by: Edward Z. Yang <[email protected]>
1 parent c24ec41 commit fbe5d8e

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

cabal-install/Distribution/Client/ProjectPlanOutput.hs

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -73,20 +73,23 @@ encodePlanAsJson elaboratedInstallPlan _elaboratedSharedConfig =
7373
J.object $
7474
[ "type" J..= J.String "configured"
7575
, "id" J..= (jdisplay . installedUnitId) elab
76-
, "depends" J..= map (jdisplay . confInstId) (elabLibDependencies elab)
7776
, "flags" J..= J.object [ fn J..= v
7877
| (PD.FlagName fn,v) <-
7978
elabFlagAssignment elab ]
8079
] ++
8180
case elabPkgOrComp elab of
82-
ElabPackage pkg ->
83-
let components = J.object
84-
[ comp2str c J..= J.object
85-
[ "depends" J..= map (jdisplay . confInstId) v ]
86-
-- NB: does NOT contain non-lib dependencies
87-
| (c,v) <- ComponentDeps.toList (pkgLibDependencies pkg) ]
88-
in ["components" J..= components ]
89-
ElabComponent _ -> []
81+
ElabPackage pkg ->
82+
let components = J.object $
83+
[ comp2str c J..= J.object
84+
[ "depends" J..= map (jdisplay . confInstId) v ]
85+
| (c,v) <- ComponentDeps.toList (pkgLibDependencies pkg) ] ++
86+
[ comp2str c J..= J.object
87+
[ "exe-depends" J..= map (jdisplay . confInstId) v ]
88+
| (c,v) <- ComponentDeps.toList (pkgExeDependencies pkg) ]
89+
in ["components" J..= components]
90+
ElabComponent _ ->
91+
["depends" J..= map (jdisplay . confInstId) (elabLibDependencies elab)
92+
,"exe-depends" J..= map jdisplay (elabExeDependencies elab)]
9093

9194
-- TODO: maybe move this helper to "ComponentDeps" module?
9295
-- Or maybe define a 'Text' instance?

0 commit comments

Comments
 (0)