# Path: artman/tasks/task_base.py
# class TaskBase(Task):
# class EmptyTask(TaskBase):
#     def __init__(self, *args, **kwargs):
#     def log(self, msg, logger=artman_logger, level=logging.INFO):
#     def exec_command(self, args):
#     def execute(self):
#     def validate(self):
# 
# Path: artman/utils/task_utils.py
# def get_java_tool_path(toolkit_path, tool_name):
# def gapic_gen_task(toolkit_path, task_args):
# def run_gradle_task(toolkit_path, task_name, task_args=()):
# def api_full_name(api_name, api_version, organization_name):
# def is_output_gcloud(language, gapic_code_dir):
# def instantiate_tasks(task_class_list, inject):


import io
import os
from ruamel import yaml
from artman.tasks import task_base
from artman.utils import task_utils

    def _create_config(self, api_name, api_version, organization_name, output_dir,
                       proto_deps, test_proto_deps, language, root_dir, src_proto_path,
                       artifact_type, release_level):
        googleapis_dir = root_dir
        googleapis_path = os.path.commonprefix(
            [os.path.relpath(p, googleapis_dir) for p in src_proto_path])

        config = {
            'api_name': api_name,
            'api_version': api_version,
            'organization_name': organization_name,
            'proto_deps': proto_deps,
            'release_level': release_level,
            'artifact_type': artifact_type,
            'proto_path': googleapis_path,
        }

        if test_proto_deps:
            config['test_proto_deps'] = test_proto_deps

        return config

    # Separated so that this can be mocked for testing
    def _write_yaml(self, config_dict, dest):
        with io.open(dest, 'w', encoding='UTF-8') as f:
            yaml.safe_dump(config_dict, f, default_flow_style=False)

# Metadata gen


# Path: artman/tasks/task_base.py
# class TaskBase(Task):
# class EmptyTask(TaskBase):
#     def __init__(self, *args, **kwargs):
#     def log(self, msg, logger=artman_logger, level=logging.INFO):
#     def exec_command(self, args):
#     def execute(self):
#     def validate(self):
# 
# Path: artman/utils/task_utils.py
# def get_java_tool_path(toolkit_path, tool_name):
# def gapic_gen_task(toolkit_path, task_args):
# def run_gradle_task(toolkit_path, task_name, task_args=()):
# def api_full_name(api_name, api_version, organization_name):
# def is_output_gcloud(language, gapic_code_dir):
# def instantiate_tasks(task_class_list, inject):


# Path: artman/tasks/package_metadata_tasks.py
import io
import os
from ruamel import yaml
from artman.tasks import task_base
from artman.utils import task_utils


    def _create_config(self, api_name, api_version, organization_name, output_dir,
                       proto_deps, test_proto_deps, language, root_dir, src_proto_path,
                       artifact_type, release_level):
        googleapis_dir = root_dir
        googleapis_path = os.path.commonprefix(
            [os.path.relpath(p, googleapis_dir) for p in src_proto_path])

        config = {
            'api_name': api_name,
            'api_version': api_version,
            'organization_name': organization_name,
            'proto_deps': proto_deps,
            'release_level': release_level,
            'artifact_type': artifact_type,
            'proto_path': googleapis_path,
        }

        if test_proto_deps:
            config['test_proto_deps'] = test_proto_deps

        return config

    # Separated so that this can be mocked for testing
    def _write_yaml(self, config_dict, dest):
        with io.open(dest, 'w', encoding='UTF-8') as f:
            yaml.safe_dump(config_dict, f, default_flow_style=False)

# Metadata gen


class ProtoPackageMetadataGenTaskBase(task_base.TaskBase):