From 018596446e1d8f7bf3b386104a7173a0890cca6e Mon Sep 17 00:00:00 2001 From: Jimmy Brisson Date: Tue, 3 Apr 2018 11:23:42 -0500 Subject: [PATCH] Exclude files like `.main.cpp` from builds --- tools/toolchains/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/toolchains/__init__.py b/tools/toolchains/__init__.py index d55c4e70ba..07af4dd07a 100644 --- a/tools/toolchains/__init__.py +++ b/tools/toolchains/__init__.py @@ -731,12 +731,13 @@ class mbedToolchain: # A helper function for both scan_resources and _add_dir. _add_file adds one file # (*file_path*) to the resources object based on the file type. def _add_file(self, file_path, resources, base_path, exclude_paths=None): - resources.file_basepath[file_path] = base_path - if self.is_ignored(relpath(file_path, base_path)): + if (self.is_ignored(relpath(file_path, base_path)) or + basename(file_path).startswith(".")): resources.ignore_dir(relpath(file_path, base_path)) return + resources.file_basepath[file_path] = base_path _, ext = splitext(file_path) ext = ext.lower()