(env, project, excluding, reset, prj_name)
| 494 | |
| 495 | |
| 496 | def UpdateCproject(env, project, excluding, reset, prj_name): |
| 497 | excluding = sorted(excluding) |
| 498 | |
| 499 | cproject = etree.parse('.cproject') |
| 500 | |
| 501 | root = cproject.getroot() |
| 502 | cconfigurations = root.findall('storageModule/cconfiguration') |
| 503 | for cconfiguration in cconfigurations: |
| 504 | tools = cconfiguration.findall('storageModule/configuration/folderInfo/toolChain/tool') |
| 505 | HandleToolOption(tools, env, project, reset) |
| 506 | |
| 507 | sourceEntries = cconfiguration.find('storageModule/configuration/sourceEntries') |
| 508 | if sourceEntries != None: |
| 509 | entry = sourceEntries.find('entry') |
| 510 | HandleExcludingOption(entry, sourceEntries, excluding) |
| 511 | # update refreshScope |
| 512 | if prj_name: |
| 513 | prj_name = '/' + prj_name |
| 514 | configurations = root.findall('storageModule/configuration') |
| 515 | for configuration in configurations: |
| 516 | resource = configuration.find('resource') |
| 517 | configuration.remove(resource) |
| 518 | SubElement(configuration, 'resource', {'resourceType': "PROJECT", 'workspacePath': prj_name}) |
| 519 | |
| 520 | # write back to .cproject |
| 521 | out = open('.cproject', 'w') |
| 522 | out.write('<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n') |
| 523 | out.write('<?fileVersion 4.0.0?>') |
| 524 | xml_indent(root) |
| 525 | out.write(etree.tostring(root, encoding='utf-8').decode('utf-8')) |
| 526 | out.close() |
| 527 | |
| 528 | |
| 529 | def TargetEclipse(env, reset=False, prj_name=None): |
no test coverage detected