This setup assumes Chromium is in a cr
directory (~/cr/src/...
). To make setup easier, you can modify and export the following variables:
export DEP_ANALYSIS_DIR=~/cr/src/tools/android/dependency_analysis export DEP_ANALYSIS_JAR=~/cr/src/out/Default/obj/chrome/android/chrome_java__process_prebuilt.desugar.jar
See ../README.md
for instructions on using generate_json_dependency_graph.py
, then generate a graph file in this directory (js/json_graph.txt
) with that exact name:
cd $DEP_ANALYSIS_DIR ./generate_json_dependency_graph.py --target $DEP_ANALYSIS_JAR --output js/json_graph.txt
The following instructions assume you are in the dependency_analysis/js
= $DEP_ANALYSIS_DIR/js
directory.
You will need to install npm
if it is not already installed (check with npm -v
), either from the site or via nvm (Node Version Manager).
To install dependencies:
npm install
To run the (highly temporary) Python server to serve the JSON at localhost:8888/json_graph.txt
:
python3 -m http.server 8888
The visualization will make requests to this server for the JSON graph on load.
To view the visualization, open localhost:8888/index.html
.
To run ESLint on the JS (and fix fixable errors) using npx (bundled with npm):
npx eslint --fix *.js