public < T extends SourceFile > Result compileModules ( List < T > externs , List < JSModule > modules , CompilerOptions options ) { // The compile method should only be called once. checkState ( jsRoot == null ) ; try { initModules ( externs , modules , options ) ; if ( options . printConfig ) { printConfig ( System . err ) ; } if ( ! hasErrors ( ) ) { parseForCompilation ( ) ; } if ( ! hasErrors ( ) ) { // TODO(bradfordcsmith): The option to instrument for coverage only should belong to the // runner, not the compiler. if ( options . getInstrumentForCoverageOnly ( ) ) { instrumentForCoverage ( ) ; } else { stage1Passes ( ) ; if ( ! hasErrors ( ) ) { stage2Passes ( ) ; } } performPostCompilationTasks ( ) ; } } finally { generateReport ( ) ; } return getResult ( ) ; }
Compiles a list of modules .