third_party/android_deps_autorolled/fetch_all_autorolled.py
def _write_cipd_yaml(libs_dir, cipd_yaml_path):
    """Writes cipd.yaml file at the passed-in path."""

    lib_dirs = os.listdir(libs_dir)
    if not lib_dirs:
        raise Exception('No generated libraries in {}'.format(libs_dir))

    data_files = ['BUILD.gn', 'additional_readme_paths.json']
    for lib_dir in lib_dirs:
        abs_lib_dir = os.path.join(libs_dir, lib_dir)
        autorolled_rel_lib_dir = os.path.relpath(abs_lib_dir, _AUTOROLLED_PATH)
        if not os.path.isdir(abs_lib_dir):
            continue
        lib_files = os.listdir(abs_lib_dir)
        if not 'cipd.yaml' in lib_files:
            continue

        if not 'README.chromium' in lib_files:
            raise Exception('README.chromium not in {}'.format(abs_lib_dir))
        if not 'LICENSE' in lib_files:
            raise Exception('LICENSE not in {}'.format(abs_lib_dir))
        data_files.append(os.path.join(autorolled_rel_lib_dir,
                                       'README.chromium'))
        data_files.append(os.path.join(autorolled_rel_lib_dir, 'LICENSE'))

        _rel_extracted_files = _extract_files_from_yaml(
            os.path.join(abs_lib_dir, 'cipd.yaml'))
        data_files.extend(
            os.path.join(autorolled_rel_lib_dir, f)
            for f in _rel_extracted_files)

    contents = [
        '# Copyright 2021 The Chromium Authors. All rights reserved.',
        '# Use of this source code is governed by a BSD-style license that can be',
        '# found in the LICENSE file.',
        'package: chromium/third_party/android_deps_autorolled', 'description: android_deps_autorolled',
        'data:'
    ]
    contents.extend('- file: ' + f for f in data_files)

    with open(cipd_yaml_path, 'w') as out:
        out.write('\n'.join(contents))
Writes cipd.yaml file at the passed-in path.
Writes cipd.yaml file at the passed-in path.
Writes cipd . yaml file at the passed - in path .
def _write_cipd_yaml(libs_dir, cipd_yaml_path):
    lib_dirs = os.listdir(libs_dir)
    if not lib_dirs:
        raise Exception('No generated libraries in {}'.format(libs_dir))
    data_files = ['BUILD.gn', 'additional_readme_paths.json']
    for lib_dir in lib_dirs:
        abs_lib_dir = os.path.join(libs_dir, lib_dir)
        autorolled_rel_lib_dir = os.path.relpath(abs_lib_dir, _AUTOROLLED_PATH)
        if not os.path.isdir(abs_lib_dir):
            continue
        lib_files = os.listdir(abs_lib_dir)
        if not 'cipd.yaml' in lib_files:
            continue
        if not 'README.chromium' in lib_files:
            raise Exception('README.chromium not in {}'.format(abs_lib_dir))
        if not 'LICENSE' in lib_files:
            raise Exception('LICENSE not in {}'.format(abs_lib_dir))
        data_files.append(os.path.join(autorolled_rel_lib_dir,
                                       'README.chromium'))
        data_files.append(os.path.join(autorolled_rel_lib_dir, 'LICENSE'))
        _rel_extracted_files = _extract_files_from_yaml(
            os.path.join(abs_lib_dir, 'cipd.yaml'))
        data_files.extend(
            os.path.join(autorolled_rel_lib_dir, f)
            for f in _rel_extracted_files)
    contents = [
        '# Copyright 2021 The Chromium Authors. All rights reserved.',
        '# Use of this source code is governed by a BSD-style license that can be',
        '# found in the LICENSE file.',
        'package: chromium/third_party/android_deps_autorolled', 'description: android_deps_autorolled',
        'data:'
    ]
    contents.extend('- file: ' + f for f in data_files)
    with open(cipd_yaml_path, 'w') as out:
        out.write('\n'.join(contents))
def _write_cipd_yaml ( libs_dir , cipd_yaml_path ) : lib_dirs = os . listdir ( libs_dir ) if not lib_dirs : raise Exception ( 'No generated libraries in {}' . format ( libs_dir ) ) data_files = [ 'BUILD.gn' , 'additional_readme_paths.json' ] for lib_dir in lib_dirs : abs_lib_dir = os . path . join ( libs_dir , lib_dir ) autorolled_rel_lib_dir = os . path . relpath ( abs_lib_dir , _AUTOROLLED_PATH ) if not os . path . isdir ( abs_lib_dir ) : continue lib_files = os . listdir ( abs_lib_dir ) if not 'cipd.yaml' in lib_files : continue if not 'README.chromium' in lib_files : raise Exception ( 'README.chromium not in {}' . format ( abs_lib_dir ) ) if not 'LICENSE' in lib_files : raise Exception ( 'LICENSE not in {}' . format ( abs_lib_dir ) ) data_files . append ( os . path . join ( autorolled_rel_lib_dir , 'README.chromium' ) ) data_files . append ( os . path . join ( autorolled_rel_lib_dir , 'LICENSE' ) ) _rel_extracted_files = _extract_files_from_yaml ( os . path . join ( abs_lib_dir , 'cipd.yaml' ) ) data_files . extend ( os . path . join ( autorolled_rel_lib_dir , f ) for f in _rel_extracted_files ) contents = [ '# Copyright 2021 The Chromium Authors. All rights reserved.' , '# Use of this source code is governed by a BSD-style license that can be' , '# found in the LICENSE file.' , 'package: chromium/third_party/android_deps_autorolled' , 'description: android_deps_autorolled' , 'data:' ] contents . extend ( '- file: ' + f for f in data_files ) with open ( cipd_yaml_path , 'w' ) as out : out . write ( '\n' . join ( contents ) )
Writes cipd.yaml file at the passed-in path.
Writes cipd . yaml file at the passed - in path .
"""Writes cipd.yaml file at the passed-in path."""
libs_dir
cipd_yaml_path