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

Function CLAddFile

tools/targets/codelite.py:79–105  ·  view source on GitHub ↗
(root, file_path)

Source from the content-addressed store, hash-verified

77 node.attrib['Value'] = lib
78
79def CLAddFile(root, file_path):
80 file_path = file_path.replace('\\', '/')
81
82 dir_list = file_path.split('/')
83 dir_list.pop()
84 if not len(dir_list):
85 dir_list.append(os.path.abspath('.').replace('\\', '/').split('/')[-1])
86
87 parent = root
88 for dir_name in dir_list:
89 if dir_name == '..':
90 continue
91
92 node = None
93 nodes = parent.findall('VirtualDirectory')
94 for iter in nodes:
95 if iter.attrib['Name'] == dir_name:
96 node = iter
97 break
98 if node is None:
99 node = SubElement(parent, 'VirtualDirectory')
100 node.attrib['Name'] = dir_name
101 parent = node
102
103 if parent != root:
104 node = SubElement(parent, 'File')
105 node.attrib['Name'] = file_path
106
107def CLAddHeaderFiles(parent, program, project_path):
108 utils.source_ext = []

Callers 2

CLAddHeaderFilesFunction · 0.85
CLAddCFilesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected