Package com.google.javascript.jscomp
Class AbstractCommandLineRunner.CommandLineConfig
- java.lang.Object
-
- com.google.javascript.jscomp.AbstractCommandLineRunner.CommandLineConfig
-
- Enclosing class:
- AbstractCommandLineRunner<A extends Compiler,B extends CompilerOptions>
@GwtIncompatible("Unnecessary") protected static class AbstractCommandLineRunner.CommandLineConfig extends java.lang.Object
Configurations for the command line configs. Designed for easy building, so that we can decouple the flags-parsing library from the actual configuration options.TODO(tjgq): Investigate whether this class is really needed to mediate between the CompilerOptions and runner implementations. An alternative would be for the runners to fill in the CompilerOptions directly, but that conflicts with the latter's mutability and the desire to reuse the same options across multiple compilations.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
AbstractCommandLineRunner.CommandLineConfig.ErrorFormatOption
Set of options that can be used with the --formatting flag.
-
Constructor Summary
Constructors Modifier Constructor Description protected
CommandLineConfig()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getSaveCompilationStateToFilename()
AbstractCommandLineRunner.CommandLineConfig
setAngularPass(boolean angularPass)
Sets whether to process AngularJS-specific annotations.AbstractCommandLineRunner.CommandLineConfig
setApplyInputSourceMaps(boolean applyInputSourceMaps)
Whether to apply input source maps to the output, i.e.AbstractCommandLineRunner.CommandLineConfig
setBrowserFeaturesetYear(java.lang.Integer browserFeaturesetYear)
Indicates target browser's yearAbstractCommandLineRunner.CommandLineConfig
setCharset(java.lang.String charset)
Input charset for all files.AbstractCommandLineRunner.CommandLineConfig
setCodingConvention(CodingConvention codingConvention)
Sets rules and conventions to enforce.AbstractCommandLineRunner.CommandLineConfig
setContinueSavedCompilationFileName(java.lang.String fileName, int restoredCompilationStage)
Set the compiler to resume a saved compilation state from a file.AbstractCommandLineRunner.CommandLineConfig
setCreateNameMapFiles(boolean createNameMapFiles)
If true, variable renaming and property renaming map files will be produced as {binary name}_vars_map.out and {binary name}_props_map.out.AbstractCommandLineRunner.CommandLineConfig
setCreateSourceMap(java.lang.String createSourceMap)
If specified, a source map file mapping the generated source files back to the original source file will be output to the specified path.AbstractCommandLineRunner.CommandLineConfig
setDefaultToStdin()
Whether to read a single source file from standard input if no input files are explicitly specified.AbstractCommandLineRunner.CommandLineConfig
setDefine(java.util.List<java.lang.String> define)
Override the value of a variable annotated @define.AbstractCommandLineRunner.CommandLineConfig
setDependencyOptions(@Nullable DependencyOptions dependencyOptions)
Sets the dependency management options.AbstractCommandLineRunner.CommandLineConfig
setEmitAsyncFunctionsWithZonejs(boolean emitAsyncFunctionsWithZonejs)
Relax the restriction on disallowing --language_out=ES_2017 together with Zone.jsAbstractCommandLineRunner.CommandLineConfig
setErrorFormat(AbstractCommandLineRunner.CommandLineConfig.ErrorFormatOption errorFormat)
AbstractCommandLineRunner.CommandLineConfig
setExterns(java.util.List<java.lang.String> externs)
The file containing JavaScript externs.AbstractCommandLineRunner.CommandLineConfig
setHideWarningsFor(java.util.List<java.lang.String> hideWarningsFor)
Sets the paths for which warnings will be hidden.AbstractCommandLineRunner.CommandLineConfig
setInstrumentationMappingFile(java.lang.String instrumentationMappingFile)
AbstractCommandLineRunner.CommandLineConfig
setJscompDevMode(CompilerOptions.DevMode jscompDevMode)
Turns on extra validity checksAbstractCommandLineRunner.CommandLineConfig
setJsonStreamMode(com.google.javascript.jscomp.CompilerOptions.JsonStreamMode mode)
AbstractCommandLineRunner.CommandLineConfig
setJsonWarningsFile(java.lang.String jsonWarningsFile)
AbstractCommandLineRunner.CommandLineConfig
setJsOutputFile(java.lang.String jsOutputFile)
Primary output filename.AbstractCommandLineRunner.CommandLineConfig
setLoggingLevel(java.lang.String loggingLevel)
The logging level (standard java.util.logging.Level values) for Compiler progress.AbstractCommandLineRunner.CommandLineConfig
setManifestMaps(java.util.List<java.lang.String> manifestMaps)
Sets the execPath:rootRelativePath mappingsAbstractCommandLineRunner.CommandLineConfig
setMixedJsSources(java.util.List<AbstractCommandLineRunner.FlagEntry<AbstractCommandLineRunner.JsSourceType>> mixedJsSources)
The JavaScript source file names, including .js and .zip files.AbstractCommandLineRunner.CommandLineConfig
setModule(java.util.List<java.lang.String> module)
A JavaScript module specification.AbstractCommandLineRunner.CommandLineConfig
setModuleOutputFiles(java.util.List<java.lang.String> moduleOutputFiles)
The output file name for a JavaScript chunk (optional).AbstractCommandLineRunner.CommandLineConfig
setModuleOutputPathPrefix(java.lang.String moduleOutputPathPrefix)
Prefix for filenames of compiled chunks.AbstractCommandLineRunner.CommandLineConfig
setModuleRoots(java.util.List<java.lang.String> jsChunkRoots)
Sets the module roots.AbstractCommandLineRunner.CommandLineConfig
setModuleWrapper(java.util.List<java.lang.String> moduleWrapper)
An output wrapper for a JavaScript module (optional).AbstractCommandLineRunner.CommandLineConfig
setOutputBundle(java.util.List<java.lang.String> outputBundles)
Sets whether to print output bundle files.AbstractCommandLineRunner.CommandLineConfig
setOutputManifest(java.util.List<java.lang.String> outputManifests)
Sets whether to print output manifest files.AbstractCommandLineRunner.CommandLineConfig
setOutputModuleDependencies(java.lang.String outputModuleDependencies)
Sets whether a JSON file representing the dependencies between modules should be created.AbstractCommandLineRunner.CommandLineConfig
setOutputWrapper(java.lang.String outputWrapper)
Interpolate output into this string at the place denoted by the marker token %output%, or %output|jsstring%AbstractCommandLineRunner.CommandLineConfig
setParseInlineSourceMaps(boolean parseInlineSourceMaps)
AbstractCommandLineRunner.CommandLineConfig
setPrintAst(boolean printAst)
Prints a dot file describing the internal abstract syntax tree and exitsAbstractCommandLineRunner.CommandLineConfig
setProcessCommonJSModules(boolean processCommonJSModules)
Sets whether to process Commonchunks.AbstractCommandLineRunner.CommandLineConfig
setPropertyMapInputFile(java.lang.String propertyMapInputFile)
File containing the serialized version of the property renaming map produced by a previous compilationAbstractCommandLineRunner.CommandLineConfig
setPropertyMapOutputFile(java.lang.String propertyMapOutputFile)
File where the serialized version of the property renaming map produced should be savedAbstractCommandLineRunner.CommandLineConfig
setSaveCompilationStateToFilename(java.lang.String fileName, int saveAfterCompilationStage)
Set the compiler to perform the first phase and save the intermediate result to a file.AbstractCommandLineRunner.CommandLineConfig
setSkipNormalOutputs(boolean skipNormalOutputs)
Sets whether the normal outputs of compilation should be skipped.AbstractCommandLineRunner.CommandLineConfig
setSourceMapDetailLevel(SourceMap.DetailLevel level)
The detail supplied in the source map file, if generated.AbstractCommandLineRunner.CommandLineConfig
setSourceMapFormat(SourceMap.Format format)
The source map format to use, if generated.AbstractCommandLineRunner.CommandLineConfig
setSourceMapInputFiles(java.util.Map<java.lang.String,java.lang.String> sourceMapInputFiles)
AbstractCommandLineRunner.CommandLineConfig
setSourceMapLocationMappings(java.util.List<SourceMap.LocationMapping> locationMappings)
The source map location mappings to use, if generated.AbstractCommandLineRunner.CommandLineConfig
setStringMapOutputFile(java.lang.String stringMapOutputPath)
File where the serialized version of the string map produced by the ReplaceStrings pass should be saved.AbstractCommandLineRunner.CommandLineConfig
setSummaryDetailLevel(int summaryDetailLevel)
Controls how detailed the compilation summary is.AbstractCommandLineRunner.CommandLineConfig
setTransformAMDToCJSModules(boolean transformAMDToCJSModules)
Set whether to transform AMD to Commonchunks.AbstractCommandLineRunner.CommandLineConfig
setTweakProcessing(CompilerOptions.TweakProcessing tweakProcessing)
Sets the kind of processing to do for goog.tweak functions.AbstractCommandLineRunner.CommandLineConfig
setTypedAstListInputFilename(@Nullable java.lang.String fileName)
AbstractCommandLineRunner.CommandLineConfig
setVariableMapInputFile(java.lang.String variableMapInputFile)
File containing the serialized version of the variable renaming map produced by a previous compilationAbstractCommandLineRunner.CommandLineConfig
setVariableMapOutputFile(java.lang.String variableMapOutputFile)
File where the serialized version of the variable renaming map produced should be savedAbstractCommandLineRunner.CommandLineConfig
setWarningGuards(java.util.List<AbstractCommandLineRunner.FlagEntry<CheckLevel>> warningGuards)
Add warning guards.AbstractCommandLineRunner.CommandLineConfig
setWarningsAllowlistFile(java.lang.String fileName)
Sets a allowlist file that suppresses warnings.
-
-
-
Method Detail
-
setPrintAst
@CanIgnoreReturnValue public AbstractCommandLineRunner.CommandLineConfig setPrintAst(boolean printAst)
Prints a dot file describing the internal abstract syntax tree and exits
-
setJscompDevMode
@CanIgnoreReturnValue public AbstractCommandLineRunner.CommandLineConfig setJscompDevMode(CompilerOptions.DevMode jscompDevMode)
Turns on extra validity checks
-
setLoggingLevel
@CanIgnoreReturnValue public AbstractCommandLineRunner.CommandLineConfig setLoggingLevel(java.lang.String loggingLevel)
The logging level (standard java.util.logging.Level values) for Compiler progress. Does not control errors or warnings for the JavaScript code under compilation
-
setExterns
@CanIgnoreReturnValue public AbstractCommandLineRunner.CommandLineConfig setExterns(java.util.List<java.lang.String> externs)
The file containing JavaScript externs. You may specify multiple.
-
setMixedJsSources
@CanIgnoreReturnValue public AbstractCommandLineRunner.CommandLineConfig setMixedJsSources(java.util.List<AbstractCommandLineRunner.FlagEntry<AbstractCommandLineRunner.JsSourceType>> mixedJsSources)
The JavaScript source file names, including .js and .zip files. You may specify multiple.
-
setDefaultToStdin
@CanIgnoreReturnValue public AbstractCommandLineRunner.CommandLineConfig setDefaultToStdin()
Whether to read a single source file from standard input if no input files are explicitly specified.
-
setJsOutputFile
@CanIgnoreReturnValue public AbstractCommandLineRunner.CommandLineConfig setJsOutputFile(java.lang.String jsOutputFile)
Primary output filename. If not specified, output is written to stdout
-
setContinueSavedCompilationFileName
@CanIgnoreReturnValue public AbstractCommandLineRunner.CommandLineConfig setContinueSavedCompilationFileName(java.lang.String fileName, int restoredCompilationStage)
Set the compiler to resume a saved compilation state from a file.
-
setTypedAstListInputFilename
@CanIgnoreReturnValue public AbstractCommandLineRunner.CommandLineConfig setTypedAstListInputFilename(@Nullable java.lang.String fileName)
-
setSaveCompilationStateToFilename
@CanIgnoreReturnValue public AbstractCommandLineRunner.CommandLineConfig setSaveCompilationStateToFilename(java.lang.String fileName, int saveAfterCompilationStage)
Set the compiler to perform the first phase and save the intermediate result to a file.
-
getSaveCompilationStateToFilename
public java.lang.String getSaveCompilationStateToFilename()
-
setModule
@CanIgnoreReturnValue public AbstractCommandLineRunner.CommandLineConfig setModule(java.util.List<java.lang.String> module)
A JavaScript module specification. The format is<name>:<num-js-files>[:[<dep>,...][:]]]
. Module names must be unique. Each dep is the name of a module that this module depends on. Modules must be listed in dependency order, and JS source files must be listed in the corresponding order. Where --module flags occur in relation to --js flags is unimportant
-
setSourceMapInputFiles
@CanIgnoreReturnValue public AbstractCommandLineRunner.CommandLineConfig setSourceMapInputFiles(java.util.Map<java.lang.String,java.lang.String> sourceMapInputFiles)
-
setParseInlineSourceMaps
@CanIgnoreReturnValue public AbstractCommandLineRunner.CommandLineConfig setParseInlineSourceMaps(boolean parseInlineSourceMaps)
-
setVariableMapInputFile
@CanIgnoreReturnValue public AbstractCommandLineRunner.CommandLineConfig setVariableMapInputFile(java.lang.String variableMapInputFile)
File containing the serialized version of the variable renaming map produced by a previous compilation
-
setPropertyMapInputFile
@CanIgnoreReturnValue public AbstractCommandLineRunner.CommandLineConfig setPropertyMapInputFile(java.lang.String propertyMapInputFile)
File containing the serialized version of the property renaming map produced by a previous compilation
-
setVariableMapOutputFile
@CanIgnoreReturnValue public AbstractCommandLineRunner.CommandLineConfig setVariableMapOutputFile(java.lang.String variableMapOutputFile)
File where the serialized version of the variable renaming map produced should be saved
-
setCreateNameMapFiles
@CanIgnoreReturnValue public AbstractCommandLineRunner.CommandLineConfig setCreateNameMapFiles(boolean createNameMapFiles)
If true, variable renaming and property renaming map files will be produced as {binary name}_vars_map.out and {binary name}_props_map.out. Note that this flag cannot be used in conjunction with either variable_map_output_file or property_map_output_file
-
setPropertyMapOutputFile
@CanIgnoreReturnValue public AbstractCommandLineRunner.CommandLineConfig setPropertyMapOutputFile(java.lang.String propertyMapOutputFile)
File where the serialized version of the property renaming map produced should be saved
-
setStringMapOutputFile
@CanIgnoreReturnValue public AbstractCommandLineRunner.CommandLineConfig setStringMapOutputFile(java.lang.String stringMapOutputPath)
File where the serialized version of the string map produced by the ReplaceStrings pass should be saved.
-
setInstrumentationMappingFile
@CanIgnoreReturnValue public AbstractCommandLineRunner.CommandLineConfig setInstrumentationMappingFile(java.lang.String instrumentationMappingFile)
-
setCodingConvention
@CanIgnoreReturnValue public AbstractCommandLineRunner.CommandLineConfig setCodingConvention(CodingConvention codingConvention)
Sets rules and conventions to enforce.
-
setSummaryDetailLevel
@CanIgnoreReturnValue public AbstractCommandLineRunner.CommandLineConfig setSummaryDetailLevel(int summaryDetailLevel)
Controls how detailed the compilation summary is. Values: 0 (never print summary), 1 (print summary only if there are errors or warnings), 2 (print summary if type checking is on), 3 (always print summary). The default level is 1
-
setOutputWrapper
@CanIgnoreReturnValue public AbstractCommandLineRunner.CommandLineConfig setOutputWrapper(java.lang.String outputWrapper)
Interpolate output into this string at the place denoted by the marker token %output%, or %output|jsstring%
-
setModuleWrapper
@CanIgnoreReturnValue public AbstractCommandLineRunner.CommandLineConfig setModuleWrapper(java.util.List<java.lang.String> moduleWrapper)
An output wrapper for a JavaScript module (optional). See the flag description for formatting requirements.
-
setModuleOutputPathPrefix
@CanIgnoreReturnValue public AbstractCommandLineRunner.CommandLineConfig setModuleOutputPathPrefix(java.lang.String moduleOutputPathPrefix)
Prefix for filenames of compiled chunks.<module-name>.js
will be appended to this prefix. Directories will be created as needed. Use with --module
-
setModuleOutputFiles
@CanIgnoreReturnValue public AbstractCommandLineRunner.CommandLineConfig setModuleOutputFiles(java.util.List<java.lang.String> moduleOutputFiles)
The output file name for a JavaScript chunk (optional). See the flag description for formatting requirements.
-
setCreateSourceMap
@CanIgnoreReturnValue public AbstractCommandLineRunner.CommandLineConfig setCreateSourceMap(java.lang.String createSourceMap)
If specified, a source map file mapping the generated source files back to the original source file will be output to the specified path. The %outname% placeholder will expand to the name of the output file that the source map corresponds to.
-
setSourceMapDetailLevel
@CanIgnoreReturnValue public AbstractCommandLineRunner.CommandLineConfig setSourceMapDetailLevel(SourceMap.DetailLevel level)
The detail supplied in the source map file, if generated.
-
setSourceMapFormat
@CanIgnoreReturnValue public AbstractCommandLineRunner.CommandLineConfig setSourceMapFormat(SourceMap.Format format)
The source map format to use, if generated.
-
setSourceMapLocationMappings
@CanIgnoreReturnValue public AbstractCommandLineRunner.CommandLineConfig setSourceMapLocationMappings(java.util.List<SourceMap.LocationMapping> locationMappings)
The source map location mappings to use, if generated.
-
setApplyInputSourceMaps
@CanIgnoreReturnValue public AbstractCommandLineRunner.CommandLineConfig setApplyInputSourceMaps(boolean applyInputSourceMaps)
Whether to apply input source maps to the output, i.e. map back to original inputs from input files that have source maps applied to them.
-
setWarningGuards
@CanIgnoreReturnValue public AbstractCommandLineRunner.CommandLineConfig setWarningGuards(java.util.List<AbstractCommandLineRunner.FlagEntry<CheckLevel>> warningGuards)
Add warning guards.
-
setDefine
@CanIgnoreReturnValue public AbstractCommandLineRunner.CommandLineConfig setDefine(java.util.List<java.lang.String> define)
Override the value of a variable annotated @define. The format is<name>[=<val>]
, where<name>
is the name of a @define variable and<val>
is a boolean, number, or a single-quoted string that contains no single quotes. If[=<val>]
is omitted, the variable is marked true
-
setBrowserFeaturesetYear
@CanIgnoreReturnValue public AbstractCommandLineRunner.CommandLineConfig setBrowserFeaturesetYear(java.lang.Integer browserFeaturesetYear)
Indicates target browser's year
-
setEmitAsyncFunctionsWithZonejs
@CanIgnoreReturnValue public AbstractCommandLineRunner.CommandLineConfig setEmitAsyncFunctionsWithZonejs(boolean emitAsyncFunctionsWithZonejs)
Relax the restriction on disallowing --language_out=ES_2017 together with Zone.js
-
setTweakProcessing
@CanIgnoreReturnValue public AbstractCommandLineRunner.CommandLineConfig setTweakProcessing(CompilerOptions.TweakProcessing tweakProcessing)
Sets the kind of processing to do for goog.tweak functions.
-
setCharset
@CanIgnoreReturnValue public AbstractCommandLineRunner.CommandLineConfig setCharset(java.lang.String charset)
Input charset for all files.
-
setDependencyOptions
@CanIgnoreReturnValue public AbstractCommandLineRunner.CommandLineConfig setDependencyOptions(@Nullable DependencyOptions dependencyOptions)
Sets the dependency management options.
-
setOutputManifest
@CanIgnoreReturnValue public AbstractCommandLineRunner.CommandLineConfig setOutputManifest(java.util.List<java.lang.String> outputManifests)
Sets whether to print output manifest files. Filter out empty file names.
-
setOutputModuleDependencies
@CanIgnoreReturnValue public AbstractCommandLineRunner.CommandLineConfig setOutputModuleDependencies(java.lang.String outputModuleDependencies)
Sets whether a JSON file representing the dependencies between modules should be created.
-
setOutputBundle
@CanIgnoreReturnValue public AbstractCommandLineRunner.CommandLineConfig setOutputBundle(java.util.List<java.lang.String> outputBundles)
Sets whether to print output bundle files.
-
setSkipNormalOutputs
@CanIgnoreReturnValue public AbstractCommandLineRunner.CommandLineConfig setSkipNormalOutputs(boolean skipNormalOutputs)
Sets whether the normal outputs of compilation should be skipped.
-
setManifestMaps
@CanIgnoreReturnValue public AbstractCommandLineRunner.CommandLineConfig setManifestMaps(java.util.List<java.lang.String> manifestMaps)
Sets the execPath:rootRelativePath mappings
-
setTransformAMDToCJSModules
@CanIgnoreReturnValue public AbstractCommandLineRunner.CommandLineConfig setTransformAMDToCJSModules(boolean transformAMDToCJSModules)
Set whether to transform AMD to Commonchunks.
-
setProcessCommonJSModules
@CanIgnoreReturnValue public AbstractCommandLineRunner.CommandLineConfig setProcessCommonJSModules(boolean processCommonJSModules)
Sets whether to process Commonchunks.
-
setModuleRoots
@CanIgnoreReturnValue public AbstractCommandLineRunner.CommandLineConfig setModuleRoots(java.util.List<java.lang.String> jsChunkRoots)
Sets the module roots.
-
setWarningsAllowlistFile
@CanIgnoreReturnValue public AbstractCommandLineRunner.CommandLineConfig setWarningsAllowlistFile(java.lang.String fileName)
Sets a allowlist file that suppresses warnings.
-
setHideWarningsFor
@CanIgnoreReturnValue public AbstractCommandLineRunner.CommandLineConfig setHideWarningsFor(java.util.List<java.lang.String> hideWarningsFor)
Sets the paths for which warnings will be hidden.
-
setAngularPass
@CanIgnoreReturnValue public AbstractCommandLineRunner.CommandLineConfig setAngularPass(boolean angularPass)
Sets whether to process AngularJS-specific annotations.
-
setJsonStreamMode
@CanIgnoreReturnValue public AbstractCommandLineRunner.CommandLineConfig setJsonStreamMode(com.google.javascript.jscomp.CompilerOptions.JsonStreamMode mode)
-
setErrorFormat
@CanIgnoreReturnValue public AbstractCommandLineRunner.CommandLineConfig setErrorFormat(AbstractCommandLineRunner.CommandLineConfig.ErrorFormatOption errorFormat)
-
setJsonWarningsFile
@CanIgnoreReturnValue public AbstractCommandLineRunner.CommandLineConfig setJsonWarningsFile(java.lang.String jsonWarningsFile)
-
-