def _write_meta(element, source_dir_one, source_dir_two, dest_dir):
    'Writes a meta file for the given element, resulting from the merge of the\n    meta files for that element in the two given SDK directories.\n    '
    meta_one = _get_meta(element, source_dir_one)
    meta_two = _get_meta(element, source_dir_two)
    type = _get_type(meta_one)
    meta = {}
    if (type in ('cc_prebuilt_library', 'loadable_module')):
        meta = meta_one
        meta['binaries'].update(meta_two['binaries'])
    elif (type == 'sysroot'):
        meta = meta_one
        meta['versions'].update(meta_two['versions'])
    elif (type in ['host_tool', 'companion_host_tool']):
        meta = meta_one
        if (not ('target_files' in meta)):
            meta['target_files'] = {}
        if ('target_files' in meta_two):
            meta['target_files'].update(meta_two['target_files'])
    elif (type in ('cc_source_library', 'dart_library', 'fidl_library', 'documentation', 'device_profile', 'config', 'license', 'component_manifest', 'bind_library', 'version_history')):
        meta = meta_one
    else:
        raise Exception(('Unknown element type: ' + type))
    meta_path = os.path.join(dest_dir, element)
    _ensure_directory(meta_path)
    with open(meta_path, 'w') as meta_file:
        json.dump(meta, meta_file, indent=2, sort_keys=True, separators=(',', ': '))
    return True
Writes a meta file for the given element, resulting from the merge of the
meta files for that element in the two given SDK directories.
def _write_meta(element, source_dir_one, source_dir_two, dest_dir):
    'Writes a meta file for the given element, resulting from the merge of the\n    meta files for that element in the two given SDK directories.\n    '
    meta_one = _get_meta(element, source_dir_one)
    meta_two = _get_meta(element, source_dir_two)
    type = _get_type(meta_one)
    meta = {}
    if (type in ('cc_prebuilt_library', 'loadable_module')):
        meta = meta_one
        meta['binaries'].update(meta_two['binaries'])
    elif (type == 'sysroot'):
        meta = meta_one
        meta['versions'].update(meta_two['versions'])
    elif (type in ['host_tool', 'companion_host_tool']):
        meta = meta_one
        if (not ('target_files' in meta)):
            meta['target_files'] = {}
        if ('target_files' in meta_two):
            meta['target_files'].update(meta_two['target_files'])
    elif (type in ('cc_source_library', 'dart_library', 'fidl_library', 'documentation', 'device_profile', 'config', 'license', 'component_manifest', 'bind_library', 'version_history')):
        meta = meta_one
    else:
        raise Exception(('Unknown element type: ' + type))
    meta_path = os.path.join(dest_dir, element)
    _ensure_directory(meta_path)
    with open(meta_path, 'w') as meta_file:
        json.dump(meta, meta_file, indent=2, sort_keys=True, separators=(',', ': '))
    return True