private Map < String , DependencyInfo > parseDepsFiles ( ) throws IOException { DepsFileParser depsParser = createDepsFileParser ( ) ; Map < String , DependencyInfo > depsFiles = new LinkedHashMap <> ( ) ; for ( SourceFile file : deps ) { if ( ! shouldSkipDepsFile ( file ) ) { List < DependencyInfo > depInfos = depsParser . parseFileReader ( file . getName ( ) , file . getCodeReader ( ) ) ; if ( depInfos . isEmpty ( ) ) { reportNoDepsInDepsFile ( file . getName ( ) ) ; } else { for ( DependencyInfo info : depInfos ) { depsFiles . put ( info . getPathRelativeToClosureBase ( ) , removeRelativePathProvide ( info ) ) ; } } } } // If a deps file also appears in srcs, our build tools will move it // into srcs. So we need to scan all the src files for addDependency // calls as well. for ( SourceFile src : srcs ) { if ( ! shouldSkipDepsFile ( src ) ) { List < DependencyInfo > srcInfos = depsParser . parseFileReader ( src . getName ( ) , src . getCodeReader ( ) ) ; for ( DependencyInfo info : srcInfos ) { depsFiles . put ( info . getPathRelativeToClosureBase ( ) , removeRelativePathProvide ( info ) ) ; } } } return depsFiles ; }
Parses all deps . js files in the deps list and creates a map of closure - relative path - > DependencyInfo .