parameters: (aar_zip, resource_zips, include_globs)
docstring: Adds all resource zips to the given aar_zip.
  
    Ensures all res/values/* files have unique names by prefixing them.
docstring_summary: Adds all resource zips to the given aar_zip.
docstring_tokens: Adds all resource zips to the given aar_zip .
function: def _AddResources(aar_zip, resource_zips, include_globs):
    """Adds all resource zips to the given aar_zip.
  
    Ensures all res/values/* files have unique names by prefixing them.
    """
    for i, path in enumerate(resource_zips):
      if include_globs and not build_utils.MatchesGlob(path, include_globs):
        continue
      with zipfile.ZipFile(path) as res_zip:
        for info in res_zip.infolist():
          data = res_zip.read(info)
          dirname, basename = posixpath.split(info.filename)
          if 'values' in dirname:
            root, ext = os.path.splitext(basename)
            basename = '{}_{}{}'.format(root, i, ext)
            info.filename = posixpath.join(dirname, basename)
          info.filename = posixpath.join('res', info.filename)
          aar_zip.writestr(info, data)
function_tokens: def _AddResources ( aar_zip , resource_zips , include_globs ) : for i , path in enumerate ( resource_zips ) : if include_globs and not build_utils . MatchesGlob ( path , include_globs ) : continue with zipfile . ZipFile ( path ) as res_zip : for info in res_zip . infolist ( ) : data = res_zip . read ( info ) dirname , basename = posixpath . split ( info . filename ) if 'values' in dirname : root , ext = os . path . splitext ( basename ) basename = '{}_{}{}' . format ( root , i , ext ) info . filename = posixpath . join ( dirname , basename ) info . filename = posixpath . join ( 'res' , info . filename ) aar_zip . writestr ( info , data )