Flutter Engine
The Flutter Engine
Classes | Functions | Variables
compiler Namespace Reference

Classes

class  IdlCompilerDart
 

Functions

def parse_options ()
 
def idl_filename_to_interface_name (idl_filename)
 
def main ()
 

Variables

 dart_script_path = os.path.dirname(os.path.abspath(__file__))
 
 script_path
 

Function Documentation

◆ idl_filename_to_interface_name()

def compiler.idl_filename_to_interface_name (   idl_filename)

Definition at line 70 of file compiler.py.

70def idl_filename_to_interface_name(idl_filename):
71 basename = os.path.basename(idl_filename)
72 interface_name, _ = os.path.splitext(basename)
73 return interface_name
74
75
def idl_filename_to_interface_name(idl_filename)
Definition: compiler.py:70

◆ main()

def compiler.main ( )

Definition at line 105 of file compiler.py.

105def main():
106 options, idl_filename = parse_options()
107
108 if options.generate_global:
109 idl_compiler = IdlCompilerDart(
110 options.output_directory,
111 interfaces_info_filename=options.interfaces_info_file,
112 only_if_changed=options.write_file_only_if_changed)
113 idl_compiler.generate_global()
114 else:
115 idl_compiler = IdlCompilerDart(
116 options.output_directory,
117 interfaces_info_filename=options.interfaces_info_file,
118 only_if_changed=options.write_file_only_if_changed)
119 idl_compiler.compile_file(idl_filename)
120
121
def main()
Definition: compiler.py:105
def parse_options()
Definition: compiler.py:47

◆ parse_options()

def compiler.parse_options ( )

Definition at line 47 of file compiler.py.

47def parse_options():
48 parser = OptionParser()
49 parser.add_option('--output-directory')
50 parser.add_option('--interfaces-info-file')
51 parser.add_option('--write-file-only-if-changed', type='int', default='1')
52 parser.add_option('--generate-global', type='int')
53
54 # ensure output comes last, so command line easy to parse via regexes
55 parser.disable_interspersed_args()
56
57 options, args = parser.parse_args()
58 if options.output_directory is None:
59 parser.error('Must specify output directory using --output-directory.')
60 options.write_file_only_if_changed = bool(
61 options.write_file_only_if_changed)
62 options.generate_global = bool(options.generate_global)
63 if len(args) != 1:
64 # parser.error('Must specify exactly 1 input file as argument, but %d given.' % len(args))
65 return options, None
66 idl_filename = os.path.realpath(args[0])
67 return options, idl_filename
68
69

Variable Documentation

◆ dart_script_path

compiler.dart_script_path = os.path.dirname(os.path.abspath(__file__))

Definition at line 38 of file compiler.py.

◆ script_path

compiler.script_path
Initial value:
1= os.path.join(
2 os.path.dirname(os.path.dirname(dart_script_path)), 'scripts')

Definition at line 39 of file compiler.py.