@@ -320,7 +320,7 @@ protected void setRunOptions(CompilerOptions options) throws IOException {
320320 DiagnosticGroups diagnosticGroups = getDiagnosticGroups ();
321321
322322 if (config .shouldSaveAfterStage1 () || config .shouldContinueCompilation ()) {
323- if (options .checksOnly ) {
323+ if (options .isChecksOnly () ) {
324324 throw new FlagUsageException (
325325 "checks_only mode is incompatible with multi-stage compilation" );
326326 }
@@ -361,12 +361,13 @@ protected void setRunOptions(CompilerOptions options) throws IOException {
361361 options .setDependencyOptions (config .dependencyOptions );
362362 }
363363
364- options .devMode = config .jscompDevMode ;
364+ options .setDevMode ( config .jscompDevMode ) ;
365365 options .setCodingConvention (config .codingConvention );
366366 options .setSummaryDetailLevel (config .summaryDetailLevel );
367367 options .setTrustedStrings (true );
368368
369- legacyOutputCharset = options .outputCharset = getLegacyOutputCharset ();
369+ legacyOutputCharset = getLegacyOutputCharset ();
370+ options .setOutputCharset (legacyOutputCharset );
370371 outputCharset2 = getOutputCharset2 ();
371372 inputCharset = getInputCharset ();
372373
@@ -395,26 +396,26 @@ protected void setRunOptions(CompilerOptions options) throws IOException {
395396 } else if (isOutputInJson ()) {
396397 options .setSourceMapOutputPath ("%outname%" );
397398 }
398- options .sourceMapDetailLevel = config .sourceMapDetailLevel ;
399- options .sourceMapFormat = config .sourceMapFormat ;
400- options .sourceMapLocationMappings = config .sourceMapLocationMappings ;
401- options .parseInlineSourceMaps = config .parseInlineSourceMaps ;
402- options .applyInputSourceMaps = config .applyInputSourceMaps ;
399+ options .setSourceMapDetailLevel ( config .sourceMapDetailLevel ) ;
400+ options .setSourceMapFormat ( config .sourceMapFormat ) ;
401+ options .setSourceMapLocationMappings ( config .sourceMapLocationMappings ) ;
402+ options .setParseInlineSourceMaps ( config .parseInlineSourceMaps ) ;
403+ options .setApplyInputSourceMaps ( config .applyInputSourceMaps ) ;
403404
404405 ImmutableMap .Builder <String , SourceMapInput > inputSourceMaps = new ImmutableMap .Builder <>();
405406 for (Map .Entry <String , String > files : config .sourceMapInputFiles .entrySet ()) {
406407 SourceFile sourceMap =
407408 SourceFile .builder ().withKind (SourceKind .NON_CODE ).withPath (files .getValue ()).build ();
408409 inputSourceMaps .put (files .getKey (), new SourceMapInput (sourceMap ));
409410 }
410- options .inputSourceMaps = inputSourceMaps .buildOrThrow ();
411+ options .setInputSourceMaps ( inputSourceMaps .buildOrThrow () );
411412
412413 if (!config .variableMapInputFile .isEmpty ()) {
413- options .inputVariableMap = VariableMap .load (config .variableMapInputFile );
414+ options .setInputVariableMap ( VariableMap .load (config .variableMapInputFile ) );
414415 }
415416
416417 if (!config .propertyMapInputFile .isEmpty ()) {
417- options .inputPropertyMap = VariableMap .load (config .propertyMapInputFile );
418+ options .setInputPropertyMap ( VariableMap .load (config .propertyMapInputFile ) );
418419 }
419420
420421 if (!config .outputManifests .isEmpty ()) {
@@ -439,7 +440,7 @@ protected void setRunOptions(CompilerOptions options) throws IOException {
439440
440441 options .setProcessCommonJSModules (config .processCommonJSModules );
441442 options .setModuleRoots (config .moduleRoots );
442- options .angularPass = config .angularPass ;
443+ options .setAngularPass ( config .angularPass ) ;
443444
444445 if (!config .jsonWarningsFile .isEmpty ()) {
445446 options .addReportGenerator (
@@ -1045,11 +1046,11 @@ void writeOutput(
10451046 @ Nullable Function <String , String > escaper ,
10461047 String filename )
10471048 throws IOException {
1048- if (compiler .getOptions ().outputJs == OutputJs .SENTINEL ) {
1049+ if (compiler .getOptions ().getOutputJs () == OutputJs .SENTINEL ) {
10491050 out .append ("// No JS output because the compiler was run in checks-only mode.\n " );
10501051 return ;
10511052 }
1052- checkState (compiler .getOptions ().outputJs == OutputJs .NORMAL );
1053+ checkState (compiler .getOptions ().getOutputJs () == OutputJs .NORMAL );
10531054
10541055 String code = chunk == null ? compiler .toSource () : compiler .toSource (licenseTracker , chunk );
10551056 writeOutput (out , compiler , code , wrapper , codePlaceholder , escaper , filename );
@@ -1197,8 +1198,8 @@ protected int doRun() throws IOException {
11971198 }
11981199
11991200 if (foundJsonInputSourceMap ) {
1200- inputSourceMaps .putAll (options .inputSourceMaps );
1201- options .inputSourceMaps = inputSourceMaps .buildOrThrow ();
1201+ inputSourceMaps .putAll (options .getInputSourceMaps () );
1202+ options .setInputSourceMaps ( inputSourceMaps .buildOrThrow () );
12021203 }
12031204
12041205 compiler .initWebpackMap (inputPathByWebpackId .buildOrThrow ());
@@ -1363,7 +1364,7 @@ private void runCompilerPasses(CompileMetricsRecorderInterface metricsRecorder)
13631364 } else {
13641365 // This is the code path taken when "building" a library by just checking it for errors
13651366 // and generating an .ijs file and also when doing a full compilation.
1366- actionMetricsName = compiler .getOptions ().checksOnly ? "checks-only" : "full compile" ;
1367+ actionMetricsName = compiler .getOptions ().isChecksOnly () ? "checks-only" : "full compile" ;
13671368 runStage1 = true ;
13681369 runStage2 = true ;
13691370 runStage3 = true ;
@@ -1516,7 +1517,7 @@ int processResults(Result result, List<JSChunk> chunks, B options) throws IOExce
15161517 outputBundle ();
15171518 outputChunkGraphJson ();
15181519 return 0 ;
1519- } else if (options .outputJs != OutputJs .NONE && result .success ) {
1520+ } else if (options .getOutputJs () != OutputJs .NONE && result .success ) {
15201521 outputChunkGraphJson ();
15211522 if (chunks == null ) {
15221523 outputSingleBinary (options );
@@ -2230,8 +2231,8 @@ void printBundleTo(JSChunk chunk, Appendable out) throws IOException {
22302231 CompilerOptions options = compiler .getOptions ();
22312232 // Prebuild ASTs before they're needed in getLoadFlags, for performance and because
22322233 // StackOverflowErrors can be hit if not prebuilt.
2233- if (options .numParallelThreads > 1 ) {
2234- new PrebuildAst (compiler , compiler .getOptions ().numParallelThreads ).prebuild (inputs );
2234+ if (options .getNumParallelThreads () > 1 ) {
2235+ new PrebuildAst (compiler , compiler .getOptions ().getNumParallelThreads () ).prebuild (inputs );
22352236 }
22362237 if (options .getRuntimeLibraryMode () == RuntimeJsLibManager .RuntimeLibraryMode .INJECT ) {
22372238 // ES6 modules will need a runtime in a bundle. Skip appending this runtime if there are no
0 commit comments