parameters: (self, code_gen_output)
docstring: Decode json object and process return from generator
          :param code_gen_output: json string
          :return True on success, False on failure
docstring_summary: Decode json object and process return from generator
          :param code_gen_output: json string
          :return True on success, False on failure
docstring_tokens: Decode json object and process return from generator : param code_gen_output : json string : return True on success False on failure
function: def handle_code_generator_output(self, code_gen_output):
          """
          Decode json object and process return from generator
          :param code_gen_output: json string
          :return True on success, False on failure
          """
          try:
              json_object = json.loads(code_gen_output)
              errors_reported = False
              for output_object in json_object:
                  if output_object['type'] == 'info':
                      output = output_object['info']
                      Logs.debug('az_code_gen: {}'.format(output))
                      if (self.profile and output.startswith('Profile')):
                          Logs.debug('az_code_gen: ' + output)
                  elif output_object['type'] == 'error':
                      Logs.error('{} - az_code_gen task error'.format(output_object['error']))
                      errors_reported = True
                  elif output_object['type'] == 'generated_file':
                      self.register_output_file(output_object['file_name'],
                                                output_object['should_be_added_to_build'])
                  elif output_object['type'] == 'dependency_file':
                      self.register_dependency_file(str(output_object['file_name']))
                  else:
                      Logs.error('az_code_gen: Unknown output json type returned from Code Generator. Type is: {} - Raw output: {}'.format(output_object['type'], code_gen_output))
                      errors_reported = True
  
              # Fail the task if errors were reported
              if errors_reported:
                  return False
  
              # Add local folder of each output node to include path of the task_gen and store path off to pickle for future runs
              azcg_paths = self.azcg_get('AZCG_INCPATHS', [])
              for output_node in self.outputs:
                  # This check is here to ensure that tasks that were written out that had None outputs will be skipped.
                  # The origin of this problem should have been solved by returning after the None checking during register output
                  if output_node is None:
                      Logs.warn('az_code_gen: Task output has a None entry, skipping!')
                      continue
                  output_path = output_node.parent.abspath()
                  if output_path not in azcg_paths:
                      azcg_paths.append(output_path)
  
              # Append any additional paths relative to the output directory found in export includes
              output_dir_node = get_azcg_output_dir_node(self.generator)
              for export_include in self.generator.export_includes:
                  if isinstance(export_include, waflib.Node.Node) and export_include.is_child_of(output_dir_node):
                      export_path = export_include.abspath()
                      if export_path not in azcg_paths:
                          azcg_paths.append(export_path)
  
              self.azcg_set('AZCG_INCPATHS', azcg_paths)
              self.propagate_azcg_incpaths(azcg_paths)
  
              return True
          except ValueError as value_error:
              # If we get output that isn't JSON, it means Clang errored before
              # the code generator gained control. Likely invalid commandline arguments.
              Logs.error('az_code_gen: Failed to json.loads output with error "{}" - output string was:\n{}'.format(str(value_error), code_gen_output))
              import traceback
              import sys
              tb_list = traceback.extract_tb(sys.exc_info()[2])
              for filename, lineno, name, line in tb_list:
                  Logs.error(
                      '{}({}): error {}: in {}: {}'.format(filename, lineno,
                                                           value_error.__class__.__name__,
                                                           name, line))
              filename, lineno, _, _ = tb_list[-1]
              Logs.error('{}({}): error {}: {}'.format(filename, lineno,
                                                       value_error.__class__.__name__,
                                                       str(value_error)))
              return False
function_tokens: def handle_code_generator_output ( self , code_gen_output ) : try : json_object = json . loads ( code_gen_output ) errors_reported = False for output_object in json_object : if output_object [ 'type' ] == 'info' : output = output_object [ 'info' ] Logs . debug ( 'az_code_gen: {}' . format ( output ) ) if ( self . profile and output . startswith ( 'Profile' ) ) : Logs . debug ( 'az_code_gen: ' + output ) elif output_object [ 'type' ] == 'error' : Logs . error ( '{} - az_code_gen task error' . format ( output_object [ 'error' ] ) ) errors_reported = True elif output_object [ 'type' ] == 'generated_file' : self . register_output_file ( output_object [ 'file_name' ] , output_object [ 'should_be_added_to_build' ] ) elif output_object [ 'type' ] == 'dependency_file' : self . register_dependency_file ( str ( output_object [ 'file_name' ] ) ) else : Logs . error ( 'az_code_gen: Unknown output json type returned from Code Generator. Type is: {} - Raw output: {}' . format ( output_object [ 'type' ] , code_gen_output ) ) errors_reported = True # Fail the task if errors were reported if errors_reported : return False # Add local folder of each output node to include path of the task_gen and store path off to pickle for future runs azcg_paths = self . azcg_get ( 'AZCG_INCPATHS' , [ ] ) for output_node in self . outputs : # This check is here to ensure that tasks that were written out that had None outputs will be skipped. # The origin of this problem should have been solved by returning after the None checking during register output if output_node is None : Logs . warn ( 'az_code_gen: Task output has a None entry, skipping!' ) continue output_path = output_node . parent . abspath ( ) if output_path not in azcg_paths : azcg_paths . append ( output_path ) # Append any additional paths relative to the output directory found in export includes output_dir_node = get_azcg_output_dir_node ( self . generator ) for export_include in self . generator . export_includes : if isinstance ( export_include , waflib . Node . Node ) and export_include . is_child_of ( output_dir_node ) : export_path = export_include . abspath ( ) if export_path not in azcg_paths : azcg_paths . append ( export_path ) self . azcg_set ( 'AZCG_INCPATHS' , azcg_paths ) self . propagate_azcg_incpaths ( azcg_paths ) return True except ValueError as value_error : # If we get output that isn't JSON, it means Clang errored before # the code generator gained control. Likely invalid commandline arguments. Logs . error ( 'az_code_gen: Failed to json.loads output with error "{}" - output string was:\n{}' . format ( str ( value_error ) , code_gen_output ) ) import traceback import sys tb_list = traceback . extract_tb ( sys . exc_info ( ) [ 2 ] ) for filename , lineno , name , line in tb_list : Logs . error ( '{}({}): error {}: in {}: {}' . format ( filename , lineno , value_error . __class__ . __name__ , name , line ) ) filename , lineno , _ , _ = tb_list [ - 1 ] Logs . error ( '{}({}): error {}: {}' . format ( filename , lineno , value_error . __class__ . __name__ , str ( value_error ) ) ) return False