@@ -52,10 +52,10 @@ func (s *ContainerFindIncludes) Run(context map[string]interface{}, ctx *types.C
5252 return i18n .WrapError (err )
5353 }
5454
55- foldersWithSources := context [ constants . CTX_FOLDERS_WITH_SOURCES_QUEUE ].( * types. UniqueSourceFolderQueue )
55+ foldersWithSources := ctx . FoldersWithSourceFiles
5656 foldersWithSources .Push (types.SourceFolder {Folder : ctx .SketchBuildPath , Recurse : true })
57- if utils . MapHas ( context , constants . CTX_IMPORTED_LIBRARIES ) {
58- for _ , library := range context [ constants . CTX_IMPORTED_LIBRARIES ].([] * types. Library ) {
57+ if len ( ctx . ImportedLibraries ) > 0 {
58+ for _ , library := range ctx . ImportedLibraries {
5959 sourceFolders := types .LibraryToSourceFolder (library )
6060 for _ , sourceFolder := range sourceFolders {
6161 foldersWithSources .Push (sourceFolder )
@@ -68,7 +68,7 @@ func (s *ContainerFindIncludes) Run(context map[string]interface{}, ctx *types.C
6868 return i18n .WrapError (err )
6969 }
7070
71- sourceFilePaths := context [ constants . CTX_COLLECTED_SOURCE_FILES_QUEUE ].( * types. UniqueStringQueue )
71+ sourceFilePaths := ctx . CollectedSourceFiles
7272
7373 for ! sourceFilePaths .Empty () {
7474 err = findIncludesUntilDone (context , ctx , sourceFilePaths .Pop ().(string ))
@@ -100,7 +100,7 @@ func runCommand(context map[string]interface{}, ctx *types.Context, command type
100100
101101func findIncludesUntilDone (context map [string ]interface {}, ctx * types.Context , sourceFilePath string ) error {
102102 targetFilePath := utils .NULLFile ()
103- importedLibraries := context [ constants . CTX_IMPORTED_LIBRARIES ].([] * types. Library )
103+ importedLibraries := ctx . ImportedLibraries
104104 done := false
105105 for ! done {
106106 commands := []types.Command {
@@ -116,11 +116,11 @@ func findIncludesUntilDone(context map[string]interface{}, ctx *types.Context, s
116116 }
117117 if len (context [constants .CTX_INCLUDES_JUST_FOUND ].([]string )) == 0 {
118118 done = true
119- } else if len (context [ constants . CTX_IMPORTED_LIBRARIES ].([] * types. Library ) ) == len (importedLibraries ) {
119+ } else if len (ctx . ImportedLibraries ) == len (importedLibraries ) {
120120 err := runCommand (context , ctx , & GCCPreprocRunner {TargetFileName : constants .FILE_CTAGS_TARGET_FOR_GCC_MINUS_E })
121121 return i18n .WrapError (err )
122122 }
123- importedLibraries = context [ constants . CTX_IMPORTED_LIBRARIES ].([] * types. Library )
123+ importedLibraries = ctx . ImportedLibraries
124124 context [constants .CTX_INCLUDES_JUST_FOUND ] = []string {}
125125 }
126126 return nil
0 commit comments