Skip to content
This repository has been archived by the owner on Jul 16, 2023. It is now read-only.

dependency reflection, from .json outputed by ninja-hacked.ToolOrigin, figuring out all output modules related on given file / node / target

License

Notifications You must be signed in to change notification settings

AOSPworking/deps_reflection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

deps_reflection

1. Requirement

  • node: v16.13.1+
  • npm: 8.1.0+

2. Usgae

> nvm use 16
>
> # Installation
> npm install
> # 会输出 out.nodes 但这是个 json
> node src/index.js --tool=nodes
>
> # 会输出 out.svg
> node src/index.js --tool=graphviz

3. About

需要 ninja-hacked 中新增的 ToolOrigin 的输出 ninja_origin_out.json。此外还需要给定 pkg_repo_tool 输出的 repo_pkg_module.json

前者需要保证如下的输出结构:

{
    "nodes": [
        {
            "name": "str",
            "distance": "int"
        }
    ],
    "edges": [
        {
            "target": ["str"],
            "source": ["str"],
            "impact_source": ["str"]
        }
    ],
    "node_num": "int",
    "edge_nun": "int"
}

而且最讲究的是,edges 字段列表中的元素,一定要保证是 ninja 数据结构中拓扑排序的结果。也就是说:

对于每一个 edge,其 target 中的元素必须在先前 edge 中的 source 中出现过。

(这也就意味着,先出现的 target 对应 “在 nodes 中的 node” 的 distance 是一定比后出现的要小的)

对于每一个 edge.source 中的元素,都要保证存在于 nodes;同时,edge.impact_source 中的元素,都要保证一定不存在于 nodes 中。

About

dependency reflection, from .json outputed by ninja-hacked.ToolOrigin, figuring out all output modules related on given file / node / target

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published