Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Functions | Variables
make_treemap Namespace Reference

Functions

 main ()
 

Variables

str DOCKER_IMAGE = 'gcr.io/skia-public/binary-size:v1'
 
str DOCKER_SCRIPT = '/opt/binary_size/src/run_binary_size_analysis.py'
 

Detailed Description

Creates a .tar.gz file containing an HTML treemap displaying the codesize.

   Requires docker to be installed.

   Example usage:
   python make_treemap.py $SKIA_ROOT/out/Release/skottie_tool /tmp/size

Function Documentation

◆ main()

make_treemap.main ( )

Definition at line 24 of file make_treemap.py.

24def main():
25 input_file = sys.argv[1]
26 out_dir = sys.argv[2]
27
28 input_base = os.path.basename(input_file)
29 input_dir = os.path.dirname(input_file)
30 temp_out = tempfile.mkdtemp('treemap')
31
32 subprocess.check_call(['docker', 'run', '--volume', '%s:/IN' % input_dir,
33 '--volume', '%s:/OUT' % temp_out,
34 DOCKER_IMAGE, DOCKER_SCRIPT,
35 '--library', '/IN/%s' % input_base,
36 '--destdir', '/OUT'])
37
38 subprocess.check_call(['tar', '--directory=%s' % temp_out, '-zcf',
39 '%s/%s_tree.tar.gz' % (out_dir, input_base),
40 '.'])
41
42 # Delete our temporary directory
43 subprocess.check_call(['docker', 'run',
44 '--volume', '%s:/OUT' % temp_out,
45 DOCKER_IMAGE, '/bin/sh', '-c', 'rm -rf /OUT/*'])
46
Definition main.py:1

Variable Documentation

◆ DOCKER_IMAGE

str make_treemap.DOCKER_IMAGE = 'gcr.io/skia-public/binary-size:v1'

Definition at line 21 of file make_treemap.py.

◆ DOCKER_SCRIPT

str make_treemap.DOCKER_SCRIPT = '/opt/binary_size/src/run_binary_size_analysis.py'

Definition at line 22 of file make_treemap.py.