summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorarmink <[email protected]>2019-11-28 17:54:44 +0800
committerarmink <[email protected]>2019-11-28 17:54:44 +0800
commitb91ba1894a6cbd9a6a214ce379131f4b585c9794 (patch)
tree92832d7382955c82712de775e39c510e6b73d075 /tools
parent6b5af71e62fdb2444b43c2a7fd9c2935cc8933c4 (diff)
[tools] Update eclipse target for excluding.
Diffstat (limited to 'tools')
-rw-r--r--tools/eclipse.py39
1 files changed, 28 insertions, 11 deletions
diff --git a/tools/eclipse.py b/tools/eclipse.py
index 191cfc2b3a..4939277496 100644
--- a/tools/eclipse.py
+++ b/tools/eclipse.py
@@ -399,6 +399,33 @@ def RelativeProjectPath(env, path):
return path
+def HandleExcludingOption(entry, sourceEntries, excluding):
+ old_excluding = []
+ if entry != None:
+ old_excluding = entry.get('excluding').split('|')
+ sourceEntries.remove(entry)
+
+ value = ''
+ for item in old_excluding:
+ if item.startswith('//') :
+ old_excluding.remove(item)
+ else :
+ if value == '':
+ value = item
+ else:
+ value += '|' + item
+
+ for item in excluding:
+ # add special excluding path prefix for RT-Thread
+ item = '//' + item
+ if value == '':
+ value = item
+ else:
+ value += '|' + item
+
+ SubElement(sourceEntries, 'entry', {'excluding': value, 'flags': 'VALUE_WORKSPACE_PATH|RESOLVED', 'kind':'sourcePath', 'name':""})
+
+
def UpdateCproject(env, project, excluding, reset):
excluding = sorted(excluding)
@@ -412,17 +439,7 @@ def UpdateCproject(env, project, excluding, reset):
sourceEntries = cconfiguration.find('storageModule/configuration/sourceEntries')
entry = sourceEntries.find('entry')
- if entry != None:
- sourceEntries.remove(entry)
-
- value = ''
- for item in excluding:
- if value == '':
- value = item
- else:
- value += '|' + item
-
- SubElement(sourceEntries, 'entry', {'excluding': value, 'flags': 'VALUE_WORKSPACE_PATH|RESOLVED', 'kind':'sourcePath', 'name':""})
+ HandleExcludingOption(entry, sourceEntries, excluding)
# write back to .cproject
out = open('.cproject', 'w')