third_party/androidx/fetch_all_androidx.py
def _write_cipd_yaml(libs_dir, version, 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', 'VERSION.txt', 'additional_readme_paths.json',
        'build.gradle'
    ]
    for lib_dir in lib_dirs:
        abs_lib_dir = os.path.join(libs_dir, lib_dir)
        androidx_rel_lib_dir = os.path.relpath(abs_lib_dir, _ANDROIDX_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

        for lib_file in lib_files:
            if lib_file == 'cipd.yaml' or lib_file == 'OWNERS':
                continue
            data_files.append(os.path.join(androidx_rel_lib_dir, lib_file))

    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.',
        '# version: ' + version,
        'package: chromium/third_party/androidx',
        'description: androidx',
        '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, version, 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', 'VERSION.txt', 'additional_readme_paths.json',
        'build.gradle'
    ]
    for lib_dir in lib_dirs:
        abs_lib_dir = os.path.join(libs_dir, lib_dir)
        androidx_rel_lib_dir = os.path.relpath(abs_lib_dir, _ANDROIDX_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
        for lib_file in lib_files:
            if lib_file == 'cipd.yaml' or lib_file == 'OWNERS':
                continue
            data_files.append(os.path.join(androidx_rel_lib_dir, lib_file))
    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.',
        '# version: ' + version,
        'package: chromium/third_party/androidx',
        'description: androidx',
        '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 , version , 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' , 'VERSION.txt' , 'additional_readme_paths.json' , 'build.gradle' ] for lib_dir in lib_dirs : abs_lib_dir = os . path . join ( libs_dir , lib_dir ) androidx_rel_lib_dir = os . path . relpath ( abs_lib_dir , _ANDROIDX_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 for lib_file in lib_files : if lib_file == 'cipd.yaml' or lib_file == 'OWNERS' : continue data_files . append ( os . path . join ( androidx_rel_lib_dir , lib_file ) ) 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.' , '# version: ' + version , 'package: chromium/third_party/androidx' , 'description: androidx' , '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
version
cipd_yaml_path