parameters: (build_config, config_json, java_dirs, relativize,
                          use_gradle_process_resources)
return_statement: return processor.Render(_JINJA_TEMPLATE_PATH, variables)
docstring: Returns the data for a project's build.gradle.
docstring_summary: Returns the data for a project's build.gradle.
docstring_tokens: Returns the data for a project s build . gradle .
function: def _GenerateGradleFile(build_config, config_json, java_dirs, relativize,
                          use_gradle_process_resources):
    """Returns the data for a project's build.gradle."""
    deps_info = build_config['deps_info']
    gradle = build_config['gradle']
  
    if deps_info['type'] == 'android_apk':
      target_type = 'android_apk'
    elif deps_info['type'] == 'java_library' and not deps_info['is_prebuilt']:
      if deps_info['requires_android']:
        target_type = 'android_library'
      else:
        target_type = 'java_library'
    else:
      return None
  
    variables = {}
    variables['template_type'] = target_type
    variables['use_gradle_process_resources'] = use_gradle_process_resources
    variables['build_tools_version'] = config_json['build_tools_version']
    variables['compile_sdk_version'] = config_json['compile_sdk_version']
    android_manifest = gradle.get('android_manifest',
                                  _DEFAULT_ANDROID_MANIFEST_PATH)
    variables['android_manifest'] = relativize(android_manifest)
    variables['java_dirs'] = relativize(java_dirs)
    variables['prebuilts'] = relativize(gradle['dependent_prebuilt_jars'])
    deps = [_ProjectEntry.FromBuildConfigPath(p)
            for p in gradle['dependent_android_projects']]
  
    variables['android_project_deps'] = [d.ProjectName() for d in deps]
    deps = [_ProjectEntry.FromBuildConfigPath(p)
            for p in gradle['dependent_java_projects']]
    variables['java_project_deps'] = [d.ProjectName() for d in deps]
  
    processor = jinja_template.JinjaProcessor(host_paths.DIR_SOURCE_ROOT)
    return processor.Render(_JINJA_TEMPLATE_PATH, variables)
function_tokens: def _GenerateGradleFile ( build_config , config_json , java_dirs , relativize , use_gradle_process_resources ) : deps_info = build_config [ 'deps_info' ] gradle = build_config [ 'gradle' ] if deps_info [ 'type' ] == 'android_apk' : target_type = 'android_apk' elif deps_info [ 'type' ] == 'java_library' and not deps_info [ 'is_prebuilt' ] : if deps_info [ 'requires_android' ] : target_type = 'android_library' else : target_type = 'java_library' else : return None variables = { } variables [ 'template_type' ] = target_type variables [ 'use_gradle_process_resources' ] = use_gradle_process_resources variables [ 'build_tools_version' ] = config_json [ 'build_tools_version' ] variables [ 'compile_sdk_version' ] = config_json [ 'compile_sdk_version' ] android_manifest = gradle . get ( 'android_manifest' , _DEFAULT_ANDROID_MANIFEST_PATH ) variables [ 'android_manifest' ] = relativize ( android_manifest ) variables [ 'java_dirs' ] = relativize ( java_dirs ) variables [ 'prebuilts' ] = relativize ( gradle [ 'dependent_prebuilt_jars' ] ) deps = [ _ProjectEntry . FromBuildConfigPath ( p ) for p in gradle [ 'dependent_android_projects' ] ] variables [ 'android_project_deps' ] = [ d . ProjectName ( ) for d in deps ] deps = [ _ProjectEntry . FromBuildConfigPath ( p ) for p in gradle [ 'dependent_java_projects' ] ] variables [ 'java_project_deps' ] = [ d . ProjectName ( ) for d in deps ] processor = jinja_template . JinjaProcessor ( host_paths . DIR_SOURCE_ROOT ) return processor . Render ( _JINJA_TEMPLATE_PATH , variables )