From f220628f92fcd2c62c73869c9f774768809c51dd Mon Sep 17 00:00:00 2001 From: Jimmy Brisson Date: Tue, 2 Oct 2018 09:55:31 -0500 Subject: [PATCH 1/4] Tools: Use logical paths in ignored_dirs ### Description Exporting to GNU ARM Eclipse, E2 Studio, and other exclude-based IDEs currently generats unusable project files online. This is because the list of directories ignored in the scan is inconsistant about what sort of paths are used: logical paths, or phisical paths. This patch makes all paths in ignored_dirs logical. This should fix the excluding tags in these project files. ### Pull request type [x] Fix [ ] Refactor [ ] Target update [ ] Functionality change [ ] Breaking change --- tools/resources/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/resources/__init__.py b/tools/resources/__init__.py index f49af77259d..aaca5c708ab 100644 --- a/tools/resources/__init__.py +++ b/tools/resources/__init__.py @@ -379,7 +379,7 @@ def add_directory( base_path = path if into_path is None: into_path = path - if self._collect_ignores and path in self.ignored_dirs: + if self._collect_ignores and relpath(path, base_path) in self.ignored_dirs: self.ignored_dirs.remove(path) if exclude_paths: self.add_ignore_patterns( @@ -407,11 +407,11 @@ def add_directory( if (any(self._not_current_label(d, t) for t in self._labels.keys())): self._label_paths.append((dir_path, base_path, into_path)) - self.ignore_dir(dir_path) + self.ignore_dir(relpath(dir_path, base_path)) dirs.remove(d) elif (d.startswith('.') or d in self._legacy_ignore_dirs or self._ignoreset.is_ignored(join(root_path, d, ""))): - self.ignore_dir(dir_path) + self.ignore_dir(relpath(dir_path, base_path)) dirs.remove(d) # Add root to include paths From b84cef9c62357a88b13ec0255c4d5e78ce4805d2 Mon Sep 17 00:00:00 2001 From: Jimmy Brisson Date: Tue, 2 Oct 2018 09:55:49 -0500 Subject: [PATCH 2/4] Fix minor formatting mistake --- tools/resources/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/resources/__init__.py b/tools/resources/__init__.py index aaca5c708ab..ca988da390b 100644 --- a/tools/resources/__init__.py +++ b/tools/resources/__init__.py @@ -392,7 +392,7 @@ def add_directory( self._ignoreset.add_mbedignore( real_base, join(root, IGNORE_FILENAME)) - root_path =join(relpath(root, base_path)) + root_path = join(relpath(root, base_path)) if self._ignoreset.is_ignored(join(root_path,"")): self.ignore_dir(root_path) dirs[:] = [] From 98e0faa551c78b23c5f4b4d6cdd80a8a455019f2 Mon Sep 17 00:00:00 2001 From: Jimmy Brisson Date: Tue, 2 Oct 2018 09:56:10 -0500 Subject: [PATCH 3/4] Remove unused local --- tools/export/gnuarmeclipse/__init__.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/tools/export/gnuarmeclipse/__init__.py b/tools/export/gnuarmeclipse/__init__.py index 9b9ce43116d..bb94d4200f2 100644 --- a/tools/export/gnuarmeclipse/__init__.py +++ b/tools/export/gnuarmeclipse/__init__.py @@ -361,9 +361,6 @@ def compute_exclusions(self): - recurse the tree and collect all unused folders; descend the hierarchy only for used nodes """ - source_folders = [self.filter_dot(s) for s in set(dirname( - src) for src in self.resources.c_sources + self.resources.cpp_sources + self.resources.s_sources)] - self.excluded_folders = set(self.resources.ignored_dirs) - set(self.resources.inc_dirs) From 418ca3a473d4b59e098d5319a8ca4e7a9ff9b72a Mon Sep 17 00:00:00 2001 From: Jimmy Brisson Date: Fri, 19 Oct 2018 10:19:51 -0500 Subject: [PATCH 4/4] Remove what we're checking for membership --- tools/resources/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/resources/__init__.py b/tools/resources/__init__.py index ca988da390b..9bc6be38c02 100644 --- a/tools/resources/__init__.py +++ b/tools/resources/__init__.py @@ -380,7 +380,7 @@ def add_directory( if into_path is None: into_path = path if self._collect_ignores and relpath(path, base_path) in self.ignored_dirs: - self.ignored_dirs.remove(path) + self.ignored_dirs.remove(relpath(path, base_path)) if exclude_paths: self.add_ignore_patterns( path, base_path, [join(e, "*") for e in exclude_paths])