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

Functions

def noop (*args, **kwargs)
 
def select_simulator (d)
 
def BUILD_glob_single (pattern)
 
def BUILD_glob (include, exclude=())
 

Variables

 DOUBLE_STAR_RE = re.compile(r'/\*\*/')
 
 STAR_RE = re.compile(r'\*')
 
string DOUBLE_STAR_PLACEHOLDER = "xxxdoublestarxxx"
 
string STAR_PLACEHOLDER = "xxxstarxxx"
 
dictionary global_names
 
dictionary local_names = {}
 

Function Documentation

◆ BUILD_glob()

def tools.BUILD_simulator.BUILD_glob (   include,
  exclude = () 
)

Definition at line 62 of file BUILD_simulator.py.

62def BUILD_glob(include, exclude=()):
63 files = set()
64 for pattern in include:
65 files.update(BUILD_glob_single(pattern))
66 for pattern in exclude:
67 files.difference_update(BUILD_glob_single(pattern))
68 return list(sorted(files))
69
70# With these namespaces, we can treat BUILD.public as if it were
71# Python code. This pulls its variable definitions (SRCS, HDRS,
72# DEFINES, etc.) into local_names.
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not set
Definition: switches.h:76
def BUILD_glob(include, exclude=())
def BUILD_glob_single(pattern)

◆ BUILD_glob_single()

def tools.BUILD_simulator.BUILD_glob_single (   pattern)

Definition at line 35 of file BUILD_simulator.py.

35def BUILD_glob_single(pattern):
36 if pattern.find('**') < 0:
37 # If pattern doesn't include **, glob.glob more-or-less does the right
38 # thing.
39 return glob.glob(pattern)
40 # First transform pattern into a regexp.
41 # Temporarily remove ** and *.
42 pattern2 = DOUBLE_STAR_RE.sub(DOUBLE_STAR_PLACEHOLDER, pattern)
43 pattern3 = STAR_RE.sub(STAR_PLACEHOLDER, pattern2)
44 # Replace any regexp special characters.
45 pattern4 = re.escape(pattern3)
46 # Replace * with [^/]* and ** with .*.
47 pattern5 = pattern4.replace(STAR_PLACEHOLDER, '[^/]*')
48 pattern6 = pattern5.replace(DOUBLE_STAR_PLACEHOLDER, '.*/')
49 # Anchor the match at the beginning and end.
50 pattern7 = "^" + pattern6 + "$"
51 pattern_re = re.compile(pattern7)
52 matches = set()
53 for root, _, files in os.walk('.'):
54 for fname in files:
55 # Remove initial "./".
56 path = os.path.join(root, fname)[2:]
57 if pattern_re.match(path):
58 matches.add(path)
59 return matches
60
61# Simulates BUILD file glob().

◆ noop()

def tools.BUILD_simulator.noop ( args,
**  kwargs 
)

Definition at line 18 of file BUILD_simulator.py.

18def noop(*args, **kwargs):
19 pass
20
def noop(*args, **kwargs)

◆ select_simulator()

def tools.BUILD_simulator.select_simulator (   d)

Definition at line 21 of file BUILD_simulator.py.

21def select_simulator(d):
22 result = []
23 for k in d:
24 result.append("*** BEGIN %s ***" % k)
25 result.extend(d[k])
26 result.append("*** END %s ***" % k)
27 return result
28

Variable Documentation

◆ DOUBLE_STAR_PLACEHOLDER

string tools.BUILD_simulator.DOUBLE_STAR_PLACEHOLDER = "xxxdoublestarxxx"

Definition at line 31 of file BUILD_simulator.py.

◆ DOUBLE_STAR_RE

tools.BUILD_simulator.DOUBLE_STAR_RE = re.compile(r'/\*\*/')

Definition at line 29 of file BUILD_simulator.py.

◆ global_names

dictionary tools.BUILD_simulator.global_names
Initial value:
1= {
2 'cc_library': noop,
3 'cc_test': noop,
4 'exports_files': noop,
5 'glob': BUILD_glob,
6 'select': select_simulator,
7 'BASE_DIR': '',
8 'BASE_EXTERNAL_DEPS_ANDROID': [],
9 'BASE_EXTERNAL_DEPS_IOS': [],
10 'BASE_EXTERNAL_DEPS_UNIX': [],
11 'CONDITION_ANDROID': 'CONDITION_ANDROID',
12 'CONDITION_IOS': 'CONDITION_IOS',
13 'DM_EXTERNAL_DEPS': [],
14 'EXTERNAL_DEPS_ALL': [],
15 'EXTERNAL_INCLUDES': [],
16}

Definition at line 73 of file BUILD_simulator.py.

◆ local_names

dictionary tools.BUILD_simulator.local_names = {}

Definition at line 89 of file BUILD_simulator.py.

◆ STAR_PLACEHOLDER

string tools.BUILD_simulator.STAR_PLACEHOLDER = "xxxstarxxx"

Definition at line 32 of file BUILD_simulator.py.

◆ STAR_RE

tools.BUILD_simulator.STAR_RE = re.compile(r'\*')

Definition at line 30 of file BUILD_simulator.py.