Flutter Engine
The Flutter Engine
Functions | Variables
generate_buildfiles Namespace Reference

Functions

def DisableBuildfiles ()
 
def Execute (args)
 
def RunAndroidGn (options)
 
def RunCrossGn (options)
 
def RunHostGn (options)
 
def RunGn (options)
 
def ParseArgs (args)
 
def main (argv)
 

Variables

 HOST_OS = utils.GuessOS()
 
 SCRIPT_DIR = os.path.dirname(sys.argv[0])
 
 DART_ROOT = os.path.realpath(os.path.join(SCRIPT_DIR, '..'))
 
string DART_DISABLE_BUILDFILES = "DART_DISABLE_BUILDFILES"
 

Function Documentation

◆ DisableBuildfiles()

def generate_buildfiles.DisableBuildfiles ( )

Definition at line 18 of file generate_buildfiles.py.

19 return DART_DISABLE_BUILDFILES in os.environ
20
21

◆ Execute()

def generate_buildfiles.Execute (   args)

Definition at line 22 of file generate_buildfiles.py.

22def Execute(args):
23 process = subprocess.Popen(args, cwd=DART_ROOT)
24 process.wait()
25 return process.returncode
26
27

◆ main()

def generate_buildfiles.main (   argv)

Definition at line 104 of file generate_buildfiles.py.

104def main(argv):
105 # Check the environment and become a no-op if directed.
107 return 0
108 options = ParseArgs(argv)
109 RunGn(options)
110
111

◆ ParseArgs()

def generate_buildfiles.ParseArgs (   args)

Definition at line 89 of file generate_buildfiles.py.

89def ParseArgs(args):
90 args = args[1:]
91 parser = argparse.ArgumentParser(
92 description="A script to generate Dart's build files.")
93
94 parser.add_argument(
95 "-v",
96 "--verbose",
97 help='Verbose output.',
98 default=False,
99 action="store_true")
100
101 return parser.parse_args(args)
102
103

◆ RunAndroidGn()

def generate_buildfiles.RunAndroidGn (   options)

Definition at line 28 of file generate_buildfiles.py.

28def RunAndroidGn(options):
29 if not HOST_OS in ['linux', 'macos']:
30 return 0
31 gn_command = [
32 'python3',
33 os.path.join(DART_ROOT, 'tools', 'gn.py'),
34 '-m',
35 'all',
36 '-a',
37 'arm,arm64',
38 '--os',
39 'android',
40 ]
41 if options.verbose:
42 gn_command.append('-v')
43 print(' '.join(gn_command))
44 return Execute(gn_command)
45
46
def print(*args, **kwargs)
Definition: run_tests.py:49
static SkString join(const CommandLineFlags::StringArray &)
Definition: skpbench.cpp:741

◆ RunCrossGn()

def generate_buildfiles.RunCrossGn (   options)

Definition at line 47 of file generate_buildfiles.py.

47def RunCrossGn(options):
48 if HOST_OS != 'linux':
49 return 0
50 gn_command = [
51 'python3',
52 os.path.join(DART_ROOT, 'tools', 'gn.py'),
53 '-m',
54 'all',
55 '-a',
56 'arm,arm64',
57 ]
58 if options.verbose:
59 gn_command.append('-v')
60 print(' '.join(gn_command))
61 return Execute(gn_command)
62
63

◆ RunGn()

def generate_buildfiles.RunGn (   options)

Definition at line 79 of file generate_buildfiles.py.

79def RunGn(options):
80 status = RunHostGn(options)
81 if status != 0:
82 return status
83 status = RunCrossGn(options)
84 if status != 0:
85 return status
86 return RunAndroidGn(options)
87
88

◆ RunHostGn()

def generate_buildfiles.RunHostGn (   options)

Definition at line 64 of file generate_buildfiles.py.

64def RunHostGn(options):
65 gn_command = [
66 'python3',
67 os.path.join(DART_ROOT, 'tools', 'gn.py'),
68 '-m',
69 'all',
70 '-a',
71 'all',
72 ]
73 if options.verbose:
74 gn_command.append('-v')
75 print(' '.join(gn_command))
76 return Execute(gn_command)
77
78

Variable Documentation

◆ DART_DISABLE_BUILDFILES

string generate_buildfiles.DART_DISABLE_BUILDFILES = "DART_DISABLE_BUILDFILES"

Definition at line 15 of file generate_buildfiles.py.

◆ DART_ROOT

generate_buildfiles.DART_ROOT = os.path.realpath(os.path.join(SCRIPT_DIR, '..'))

Definition at line 14 of file generate_buildfiles.py.

◆ HOST_OS

generate_buildfiles.HOST_OS = utils.GuessOS()

Definition at line 12 of file generate_buildfiles.py.

◆ SCRIPT_DIR

generate_buildfiles.SCRIPT_DIR = os.path.dirname(sys.argv[0])

Definition at line 13 of file generate_buildfiles.py.