Flutter Engine
The Flutter Engine
Functions | Variables
tools.rewrite_includes Namespace Reference

Functions

def fix_path (p)
 
def to_rewrite ()
 

Variables

 parser = argparse.ArgumentParser()
 
 action
 
 help
 
 nargs
 
 args = parser.parse_args()
 
list roots
 
list ignorelist
 
dictionary headers = {}
 
tuple message
 
list need_rewriting = []
 
 lines = open(file_path).readlines()
 
 output = StringIO() if args.dry_run else open(file_path, 'w')
 
list includes = []
 
 parts = line.replace('<', '"').replace('>', '"').split('"')
 
def header = fix_path(os.path.relpath(headers[os.path.basename(parts[1])], '.'))
 
int rc = 1
 

Function Documentation

◆ fix_path()

def tools.rewrite_includes.fix_path (   p)

Definition at line 62 of file rewrite_includes.py.

62def fix_path(p):
63 return p.replace(os.sep, os.altsep) if os.altsep else p
64
65# Map short name -> absolute path for all Skia headers.

◆ to_rewrite()

def tools.rewrite_includes.to_rewrite ( )

Definition at line 78 of file rewrite_includes.py.

78def to_rewrite():
79 if args.sources:
80 for path in args.sources:
81 yield path
82 else:
83 for root in roots:
84 for path, _, files in os.walk(root):
85 for file_name in files:
86 yield os.path.join(path, file_name)
87
88# Rewrite any #includes relative to Skia's top-level directory.

Variable Documentation

◆ action

tools.rewrite_includes.action

Definition at line 17 of file rewrite_includes.py.

◆ args

tools.rewrite_includes.args = parser.parse_args()

Definition at line 21 of file rewrite_includes.py.

◆ header

def tools.rewrite_includes.header = fix_path(os.path.relpath(headers[os.path.basename(parts[1])], '.'))

Definition at line 123 of file rewrite_includes.py.

◆ headers

dictionary tools.rewrite_includes.headers = {}

Definition at line 66 of file rewrite_includes.py.

◆ help

tools.rewrite_includes.help

Definition at line 18 of file rewrite_includes.py.

◆ ignorelist

list tools.rewrite_includes.ignorelist
Initial value:
1= [
2 # Don't count our local Vulkan headers as Skia headers; # we don't want #include <vulkan/vulkan_foo.h> rewritten to point to them.
3 'include/third_party/vulkan',
4 # Some node_modules/ files (used by CanvasKit et al) have c++ code which we should ignore.
5 'node_modules',
6 'include/third_party/skcms',
7 'src/gpu/vk/vulkanmemoryallocator',
8 # Used by Jetski and Graphite
9 'Surface.h',
10 # Used by Ganesh and Graphite
11 'Device.h',
12 # Temporary shims
13 'GrGLMakeEGLInterface.h',
14 'GrGLMakeEpoxyEGLInterface.h',
15 'GrGLMakeGLXInterface.h',
16 # Transitional
17 'tools/window',
18]

Definition at line 41 of file rewrite_includes.py.

◆ includes

list tools.rewrite_includes.includes = []

Definition at line 116 of file rewrite_includes.py.

◆ lines

tools.rewrite_includes.lines = open(file_path).readlines()

Definition at line 111 of file rewrite_includes.py.

◆ message

tuple tools.rewrite_includes.message
Initial value:
1= ('Header filename is used more than once!\n- ' + path + '/' + file_name +
2 '\n- ' + headers[file_name])

Definition at line 73 of file rewrite_includes.py.

◆ nargs

tools.rewrite_includes.nargs

Definition at line 19 of file rewrite_includes.py.

◆ need_rewriting

list tools.rewrite_includes.need_rewriting = []

Definition at line 89 of file rewrite_includes.py.

◆ output

tools.rewrite_includes.output = StringIO() if args.dry_run else open(file_path, 'w')

Definition at line 114 of file rewrite_includes.py.

◆ parser

tools.rewrite_includes.parser = argparse.ArgumentParser()

Definition at line 16 of file rewrite_includes.py.

◆ parts

tools.rewrite_includes.parts = line.replace('<', '"').replace('>', '"').split('"')

Definition at line 118 of file rewrite_includes.py.

◆ rc

int tools.rewrite_includes.rc = 1

Definition at line 138 of file rewrite_includes.py.

◆ roots

list tools.rewrite_includes.roots
Initial value:
1= [
2 'bench',
3 'dm',
4 'docs',
5 'experimental',
6 'fuzz',
7 'gm',
8 'include',
9 'modules',
10 'platform_tools/android/apps',
11 'samplecode',
12 'src',
13 'tests',
14 'third_party/etc1',
15 'third_party/gif',
16 'tools'
17]

Definition at line 23 of file rewrite_includes.py.