def METHOD_NAME(root_paths, helm_values, merge_build_path=DEFAULT_MERGE_PATH):
    if not isabs(merge_build_path):
        merge_build_path = join(os.getcwd(), merge_build_path)
    if len(root_paths) < 2:
        return root_paths
    if not os.path.exists(merge_build_path):
        os.makedirs(merge_build_path)
    else:
        shutil.rmtree(merge_build_path)
    merged = False
    artifacts = {}
    def merge_appdir(root_path, base_path):
        app_name = app_name_from_path(basename(base_path))
        dest_path = join(
                        merge_build_path,
                        relpath( base_path, root_path)
                    )
        merge_configuration_directories(artifacts[app_name], dest_path)
        merge_configuration_directories(base_path, dest_path)
    for root_path in root_paths:
        for base_path in find_subdirs(join(root_path, BASE_IMAGES_PATH)):
            app_name = app_name_from_path(basename(base_path))
            if app_name not in artifacts:
                artifacts[app_name] = base_path
            elif app_name in helm_values[KEY_TASK_IMAGES]:
                libraries_path = join(root_path, 'libraries')
                if exists(libraries_path):
                    merge_configuration_directories(
                        libraries_path,
                        join(merge_build_path, 'libraries')
                    )
                merge_appdir(root_path, base_path)
                merged = True
    for root_path in root_paths:
        for base_path in find_subdirs(join(root_path, STATIC_IMAGES_PATH)):
            app_name = app_name_from_path(basename(base_path))
            if app_name not in artifacts:
                artifacts[app_name] = base_path
            elif app_name in helm_values[KEY_TASK_IMAGES]:
                merge_appdir(root_path, base_path)
                merged = True
    for root_path in root_paths:
        for base_path in find_subdirs(join(root_path, APPS_PATH)):
            app_name = app_name_from_path(basename(base_path))
            if app_name not in artifacts:
                artifacts[app_name] = base_path
            elif app_name.replace("-", "_") in helm_values[KEY_APPS]:
                merge_appdir(root_path, base_path)
                merged = True
    if exists(merge_build_path):
        with open(join(merge_build_path, ".dockerignore"), "a") as dst:
            for root_path in root_paths:
                ignore_file = join(root_path, ".dockerignore")
                if os.path.exists(ignore_file):
                    with open(ignore_file) as src:
                        dst.write(src.read())
    return (root_paths + [merge_build_path]) if merged else root_paths