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

Function CLGenWorkspace

tools/targets/codelite.py:130–150  ·  view source on GitHub ↗
(project_name, project_path)

Source from the content-addressed store, hash-verified

128
129
130def CLGenWorkspace(project_name, project_path):
131 if os.path.isfile('codelite_template.workspace'):
132 tree = etree.parse('codelite_template.workspace')
133 else:
134 tree = etree.parse(os.path.join(os.path.dirname(__file__), 'codelite_template.workspace'))
135
136 root = tree.getroot()
137 root.attrib['Name'] = project_name
138
139 node = root.find('Project')
140 node.attrib['Name'] = project_name
141 node.attrib['Path'] = project_name + '.project'
142
143 node = root.find('BuildMatrix').find('WorkspaceConfiguration').find('Project')
144 node.attrib['Name'] = project_name
145
146 out = open(project_name + '.workspace', 'w')
147 out.write('<?xml version="1.0" encoding="UTF-8"?>\n')
148 xml_indent(root)
149 out.write(etree.tostring(root, encoding='utf-8'))
150 out.close()
151
152def TargetCodelite(script, program):
153 project_name = os.path.abspath('.').replace('\\', '/').split('/')[-1]

Callers 1

TargetCodeliteFunction · 0.85

Calls 4

xml_indentFunction · 0.90
openFunction · 0.50
joinMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected