private Map < String , DependencyInfo > parseSources ( Set < String > preparsedFiles ) throws IOException { Map < String , DependencyInfo > parsedFiles = new LinkedHashMap <> ( ) ; JsFileParser jsParser = new JsFileParser ( errorManager ) . setModuleLoader ( loader ) ; Compiler compiler = new Compiler ( ) ; compiler . init ( ImmutableList . of ( ) , ImmutableList . of ( ) , new CompilerOptions ( ) ) ; for ( SourceFile file : srcs ) { String closureRelativePath = PathUtil . makeRelative ( closurePathAbs , PathUtil . makeAbsolute ( file . getName ( ) ) ) ; if ( logger . isLoggable ( Level . FINE ) ) { logger . fine ( "Closure-relative path: " + closureRelativePath ) ; } if ( InclusionStrategy . WHEN_IN_SRCS == mergeStrategy || ! preparsedFiles . contains ( closureRelativePath ) ) { DependencyInfo depInfo = jsParser . parseFile ( file . getName ( ) , closureRelativePath , file . getCode ( ) ) ; depInfo = new LazyParsedDependencyInfo ( depInfo , new JsAst ( file ) , compiler ) ; // Kick the source out of memory. file . clearCachedSource ( ) ; parsedFiles . put ( closureRelativePath , depInfo ) ; } } return parsedFiles ; }
Parses all source files for dependency information .