MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / generate_toolchain_yaml

Function generate_toolchain_yaml

tools/ci/bsp_detail.py:36–58  ·  view source on GitHub ↗
(input_file, output_file, header_comment)

Source from the content-addressed store, hash-verified

34}
35# 产生toolchain.yml文件
36def generate_toolchain_yaml(input_file, output_file, header_comment):
37 with open(input_file, 'r', encoding='utf-8') as file:
38 data = yaml.safe_load(file)
39
40 toolchain_data = {}
41 for folder, details in data.items():
42 gcc = details.get('gcc')
43 if gcc:
44 if gcc not in toolchain_data:
45 toolchain_data[gcc] = {'bsp': []}
46 toolchain_data[gcc]['bsp'].append(folder)
47
48
49 # 添加每个工具链的个数
50 for gcc, details in toolchain_data.items():
51 details['count'] = len(details['bsp'])
52 download_url = download_urls.get(gcc)
53 if download_url:
54 details['download_url'] = download_url
55
56 with open(output_file, 'w', encoding='utf-8') as file:
57 file.write(f"# {header_comment}\n")
58 yaml.dump(toolchain_data, file, default_flow_style=False, allow_unicode=True)
59
60
61# 这个函数通过检查文件是否存在来检查bsp的支持情况

Callers 1

bsp_detail.pyFile · 0.85

Calls 4

openFunction · 0.50
getMethod · 0.45
writeMethod · 0.45
dumpMethod · 0.45

Tested by

no test coverage detected