|
8 | 8 | from fosslight_util.write_opossum import write_opossum |
9 | 9 | from fosslight_util.write_yaml import write_yaml |
10 | 10 | from fosslight_util.write_spdx import write_spdx |
| 11 | +from fosslight_util.write_cyclonedx import write_cyclonedx |
11 | 12 | from typing import Tuple |
12 | 13 |
|
13 | 14 | SUPPORT_FORMAT = {'excel': '.xlsx', 'csv': '.csv', 'opossum': '.json', 'yaml': '.yaml', |
14 | 15 | 'spdx-yaml': '.yaml', 'spdx-json': '.json', 'spdx-xml': '.xml', |
15 | | - 'spdx-tag': '.tag'} |
| 16 | + 'spdx-tag': '.tag', 'cyclonedx-json': '.json', 'cyclonedx-xml': '.xml'} |
16 | 17 |
|
17 | 18 |
|
18 | 19 | def check_output_format(output='', format='', customized_format={}): |
@@ -188,6 +189,8 @@ def write_output_file(output_file_without_ext: str, file_extension: str, scan_it |
188 | 189 | msg = f'{platform.system()} not support spdx format.' |
189 | 190 | else: |
190 | 191 | success, msg, _ = write_spdx(output_file_without_ext, file_extension, scan_item, spdx_version) |
| 192 | + elif format.startswith('cyclonedx'): |
| 193 | + success, msg, _ = write_cyclonedx(output_file_without_ext, file_extension, scan_item) |
191 | 194 | else: |
192 | 195 | if file_extension == '.xlsx': |
193 | 196 | success, msg = write_result_to_excel(result_file, scan_item, extended_header, hide_header) |
|
0 commit comments