• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# JSON module graph queries
2
3This directory contains `jq` scripts that query Soong's module graph.
4`jq` may be installed through your distribution's repository.
5
6Usage:
7
8```
9m json-module-graph
10query.sh [-C] <command> <base-of-your-tree>/out/soong/module-graph.json [argument]
11```
12
13The following commands are available:
14* `directDeps` prints the names of the direct dependencies of the given module
15* `distanceFromLeaves` prints the longest distance each module has from a leaf
16  in the module graph within the transitive closure of given module
17* `filterSubtree` dumps only those modules that are in the given subtree of the
18  source tree
19* `fullTransitiveDeps` returns the full transitive dependencies of the given
20  module
21* `moduleTypeStats`: returns of a summary of the module types present on the
22  input
23* `modulesOfType`: returns the names of modules of the input type
24* `printModule` prints all variations of a given module
25* `printModule`: returns a slightly more consise view of the input module
26* `properties`: returns the properties set in the input module, includes
27  properties set via defaults
28* `transitiveDeps` prints the names of the transitive dependencies of the given
29  module
30* `usedVariations` returns a map that shows which variations are used in the
31  input and what values they take
32* `variantTransitions`  summarizes the variant transitions in the transitive
33  closure of the given module
34* `fullTransitiveDepsProperties` returns the properties set (including via
35  defaults) grouped by module type of the modules in the transitive closure of
36  the given module
37
38It's best to filter the full module graph to the part you are interested in
39because `jq` isn't too fast on the full graph.
40