def generate_dictionary_code(self, definitions, dictionary_name, dictionary): # pylint: disable=unused-argument interfaces_info = self.info_provider.interfaces_info header_template = self.jinja_env.get_template('dictionary_v8.h.tmpl') cpp_template = self.jinja_env.get_template('dictionary_v8.cc.tmpl') interface_info = interfaces_info[dictionary_name] component_info = self.info_provider.component_info template_context = v8_dictionary.dictionary_context( dictionary, interfaces_info, component_info) include_paths = interface_info.get('dependencies_include_paths') # Add the include for interface itself template_context['header_includes'].add(interface_info['include_path']) if not is_testing_target(interface_info.get('full_path')): template_context['header_includes'].add( self.info_provider.include_path_for_export) template_context['exported'] = \ self.info_provider.specifier_for_export header_path, cpp_path = self.output_paths(dictionary_name) this_include_header_path = self.normalize_this_header_path(header_path) template_context['this_include_header_path'] = this_include_header_path template_context['header_guard'] = to_header_guard( this_include_header_path) header_text, cpp_text = self.render_templates(include_paths, header_template, cpp_template, template_context) return ( (header_path, header_text), (cpp_path, cpp_text), )
def generate_dictionary_code(self, definitions, dictionary_name, dictionary): interfaces_info = self.info_provider.interfaces_info header_template = self.jinja_env.get_template('dictionary_v8.h') cpp_template = self.jinja_env.get_template('dictionary_v8.cpp') interface_info = interfaces_info[dictionary_name] template_context = v8_dictionary.dictionary_context( dictionary, interfaces_info) include_paths = interface_info.get('dependencies_include_paths') # Add the include for interface itself if interface_info['include_path']: template_context['header_includes'].add( interface_info['include_path']) if not is_testing_target(interface_info.get('full_path')): template_context['header_includes'].add( self.info_provider.include_path_for_export) template_context[ 'exported'] = self.info_provider.specifier_for_export header_text, cpp_text = render_template(include_paths, header_template, cpp_template, template_context) header_path, cpp_path = self.output_paths(dictionary_name) return ( (header_path, header_text), (cpp_path, cpp_text), )
def generate_dictionary_bindings(self, dictionary_name, interface_info, dictionary): header_template = self.jinja_env.get_template('dictionary_v8.h') cpp_template = self.jinja_env.get_template('dictionary_v8.cpp') template_context = v8_dictionary.dictionary_context(dictionary) # Add the include for interface itself template_context['header_includes'].add(interface_info['include_path']) header_text, cpp_text = render_template( interface_info, header_template, cpp_template, template_context) header_path, cpp_path = self.output_paths_for_bindings(dictionary_name) return ( (header_path, header_text), (cpp_path, cpp_text), )
def generate_dictionary_code(self, definitions, dictionary_name, dictionary): header_template = self.jinja_env.get_template('dictionary_v8.h') cpp_template = self.jinja_env.get_template('dictionary_v8.cpp') template_context = v8_dictionary.dictionary_context(dictionary) interface_info = self.interfaces_info[dictionary_name] # Add the include for interface itself template_context['header_includes'].add(interface_info['include_path']) header_text, cpp_text = render_template( interface_info, header_template, cpp_template, template_context) header_path, cpp_path = self.output_paths(dictionary_name) return ( (header_path, header_text), (cpp_path, cpp_text), )
def generate_dictionary_code(self, definitions, dictionary_name, dictionary): header_template = self.jinja_env.get_template('dictionary_v8.h') cpp_template = self.jinja_env.get_template('dictionary_v8.cpp') template_context = v8_dictionary.dictionary_context(dictionary) interface_info = self.interfaces_info[dictionary_name] include_paths = interface_info.get('dependencies_include_paths') # Add the include for interface itself template_context['header_includes'].add(interface_info['include_path']) header_text, cpp_text = render_template( include_paths, header_template, cpp_template, template_context) header_path, cpp_path = self.output_paths(dictionary_name) return ( (header_path, header_text), (cpp_path, cpp_text), )
def generate_dictionary_code(self, definitions, dictionary_name, dictionary): # pylint: disable=unused-argument interfaces_info = self.info_provider.interfaces_info header_template = self.jinja_env.get_template("dictionary_v8.h.tmpl") cpp_template = self.jinja_env.get_template("dictionary_v8.cpp.tmpl") interface_info = interfaces_info[dictionary_name] template_context = v8_dictionary.dictionary_context(dictionary, interfaces_info) include_paths = interface_info.get("dependencies_include_paths") # Add the include for interface itself if interface_info["include_path"]: template_context["header_includes"].add(interface_info["include_path"]) if not is_testing_target(interface_info.get("full_path")): template_context["header_includes"].add(self.info_provider.include_path_for_export) template_context["exported"] = self.info_provider.specifier_for_export header_text, cpp_text = self.render_template(include_paths, header_template, cpp_template, template_context) header_path, cpp_path = self.output_paths(dictionary_name) return ((header_path, header_text), (cpp_path, cpp_text))
def generate_dictionary_code(self, definitions, dictionary_name, dictionary): interfaces_info = self.info_provider.interfaces_info header_template = self.jinja_env.get_template('dictionary_v8.h') cpp_template = self.jinja_env.get_template('dictionary_v8.cpp') interface_info = interfaces_info[dictionary_name] template_context = v8_dictionary.dictionary_context( dictionary, interfaces_info) include_paths = interface_info.get('dependencies_include_paths') # Add the include for interface itself if interface_info['include_path']: template_context['header_includes'].add(interface_info['include_path']) if not is_testing_target(interface_info.get('full_path')): template_context['header_includes'].add(self.info_provider.include_path_for_export) template_context['exported'] = self.info_provider.specifier_for_export header_text, cpp_text = render_template( include_paths, header_template, cpp_template, template_context) header_path, cpp_path = self.output_paths(dictionary_name) return ( (header_path, header_text), (cpp_path, cpp_text), )