summaryrefslogtreecommitdiff
path: root/tools/eclipse.py
diff options
context:
space:
mode:
authorarmink <[email protected]>2019-11-28 18:34:22 +0800
committerarmink <[email protected]>2019-11-28 18:34:22 +0800
commit470372c5be170d8cbf262bd4560577d308cae25f (patch)
tree4f95762c96875b9e8a55b1cf005eb0011c87b8a4 /tools/eclipse.py
parentb91ba1894a6cbd9a6a214ce379131f4b585c9794 (diff)
[tools] update eclipse target for refreshScope support.
Diffstat (limited to 'tools/eclipse.py')
-rw-r--r--tools/eclipse.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/tools/eclipse.py b/tools/eclipse.py
index 4939277496..daac72befe 100644
--- a/tools/eclipse.py
+++ b/tools/eclipse.py
@@ -426,7 +426,7 @@ def HandleExcludingOption(entry, sourceEntries, excluding):
SubElement(sourceEntries, 'entry', {'excluding': value, 'flags': 'VALUE_WORKSPACE_PATH|RESOLVED', 'kind':'sourcePath', 'name':""})
-def UpdateCproject(env, project, excluding, reset):
+def UpdateCproject(env, project, excluding, reset, prj_name):
excluding = sorted(excluding)
cproject = etree.parse('.cproject')
@@ -440,6 +440,14 @@ def UpdateCproject(env, project, excluding, reset):
sourceEntries = cconfiguration.find('storageModule/configuration/sourceEntries')
entry = sourceEntries.find('entry')
HandleExcludingOption(entry, sourceEntries, excluding)
+ # update refreshScope
+ if prj_name:
+ prj_name = '/' + prj_name
+ configurations = root.findall('storageModule/configuration')
+ for configuration in configurations:
+ resource = configuration.find('resource')
+ configuration.remove(resource)
+ SubElement(configuration, 'resource', {'resourceType': "PROJECT", 'workspacePath': prj_name})
# write back to .cproject
out = open('.cproject', 'w')
@@ -468,7 +476,7 @@ def TargetEclipse(env, reset = False, prj_name = None):
excluding = GenExcluding(env, project)
# update the project configuration on '.cproject' file
- UpdateCproject(env, project, excluding, reset)
+ UpdateCproject(env, project, excluding, reset, prj_name)
print('done!')