@@ -723,58 +723,6 @@ def parse_kconfig(self):
723
723
# Clean up the temporary directory
724
724
shutil .rmtree (kconfiglib_dir )
725
725
726
- def module_kconfigs (self , regex ):
727
- manifest = Manifest .from_file ()
728
- kconfigs = ""
729
-
730
- for project in manifest .get_projects ([]):
731
- if not manifest .is_active (project ):
732
- continue
733
-
734
- if not project .is_cloned ():
735
- continue
736
-
737
- module_path = PurePath (project .abspath )
738
- module_yml = module_path .joinpath ('zephyr/module.yml' )
739
-
740
- if not Path (module_yml ).is_file ():
741
- module_yml = module_path .joinpath ('zephyr/module.yaml' )
742
-
743
- if Path (module_yml ).is_file ():
744
- dirs = []
745
-
746
- with Path (module_yml ).open ('r' , encoding = 'utf-8' ) as f :
747
- meta = yaml .load (f .read (), Loader = SafeLoader )
748
-
749
- for folder_type in ['samples' , 'tests' ]:
750
- if folder_type in meta :
751
- for path_ext in meta [folder_type ]:
752
- path_full = module_path .joinpath (path_ext )
753
-
754
- if Path (path_full ).is_dir ():
755
- dirs .append (":" + path_ext )
756
-
757
- # Add ext. module root, if one is defined. For zephyr, the base one is added
758
- # directly since in CMake it is added statically instead of by parsing the
759
- # zephyr module file
760
- if module_path == ZEPHYR_BASE :
761
- dirs .append (":" + str (module_path / "modules" ))
762
- elif 'build' in meta and 'settings' in meta ['build' ] and \
763
- 'module_ext_root' in meta ['build' ]['settings' ]:
764
- path_full = module_path .joinpath (meta ['build' ]['settings' ]['module_ext_root' ])
765
-
766
- if Path (path_full ).is_dir ():
767
- dirs .append (":" + meta ['build' ]['settings' ]['module_ext_root' ])
768
-
769
- if len (dirs ) > 0 :
770
- tmp_output = git ("grep" , "-I" , "-h" , "--perl-regexp" , regex , "--" ,
771
- * dirs , cwd = module_path , ignore_non_zero = True )
772
-
773
- if len (tmp_output ) > 0 :
774
- kconfigs += tmp_output + "\n "
775
-
776
- return kconfigs
777
-
778
726
def get_logging_syms (self , kconf ):
779
727
# Returns a set() with the names of the Kconfig symbols generated with
780
728
# logging template in samples/tests folders. The Kconfig symbols doesn't
@@ -795,8 +743,9 @@ def get_logging_syms(self, kconf):
795
743
# Warning: Needs to work with both --perl-regexp and the 're' module.
796
744
regex = r"^\s*(?:module\s*=\s*)([A-Z0-9_]+)\s*(?:#|$)"
797
745
798
- # Grep samples/ and tests/ for symbol definitions in all modules
799
- grep_stdout = self .module_kconfigs (regex )
746
+ # Grep samples/ and tests/ for symbol definitions
747
+ grep_stdout = git ("grep" , "-I" , "-h" , "--perl-regexp" , regex , "--" ,
748
+ ":samples" , ":tests" , cwd = ZEPHYR_BASE )
800
749
801
750
names = re .findall (regex , grep_stdout , re .MULTILINE )
802
751
@@ -949,8 +898,9 @@ def get_defined_syms(self, kconf):
949
898
# (?:...) is a non-capturing group.
950
899
regex = r"^\s*(?:menu)?config\s*([A-Z0-9_]+)\s*(?:#|$)"
951
900
952
- # Grep samples/ and tests/ for symbol definitions in all modules
953
- grep_stdout = self .module_kconfigs (regex )
901
+ # Grep samples/ and tests/ for symbol definitions
902
+ grep_stdout = git ("grep" , "-I" , "-h" , "--perl-regexp" , regex , "--" ,
903
+ ":samples" , ":tests" , cwd = ZEPHYR_BASE )
954
904
955
905
# Generate combined list of configs and choices from the main Kconfig tree.
956
906
kconf_syms = kconf .unique_defined_syms + kconf .unique_choices
0 commit comments