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
getSaveAfterChecksFileName()
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)
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
setDefine(java.util.List<java.lang.String> define)
Override the value of a variable annotated @define.AbstractCommandLineRunner.CommandLineConfig
setDependencyOptions(DependencyOptions dependencyOptions)
Sets the dependency management options.AbstractCommandLineRunner.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 JS modules.AbstractCommandLineRunner.CommandLineConfig
setModuleRoots(java.util.List<java.lang.String> jsModuleRoots)
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
setPrintPassGraph(boolean printPassGraph)
Prints a dot file describing the passes that will get run and exitsAbstractCommandLineRunner.CommandLineConfig
setProcessCommonJSModules(boolean processCommonJSModules)
Sets whether to process CommonJS modules.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
setSaveAfterChecksFileName(java.lang.String fileName)
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 CommonJS modules.AbstractCommandLineRunner.CommandLineConfig
setTweak(java.util.List<java.lang.String> tweak)
Override the default value of a registered tweak.AbstractCommandLineRunner.CommandLineConfig
setTweakProcessing(CompilerOptions.TweakProcessing tweakProcessing)
Sets the kind of processing to do for goog.tweak functions.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
public AbstractCommandLineRunner.CommandLineConfig setPrintAst(boolean printAst)
Prints a dot file describing the internal abstract syntax tree and exits
-
setPrintPassGraph
public AbstractCommandLineRunner.CommandLineConfig setPrintPassGraph(boolean printPassGraph)
Prints a dot file describing the passes that will get run and exits
-
setJscompDevMode
public AbstractCommandLineRunner.CommandLineConfig setJscompDevMode(CompilerOptions.DevMode jscompDevMode)
Turns on extra validity checks
-
setLoggingLevel
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
public AbstractCommandLineRunner.CommandLineConfig setExterns(java.util.List<java.lang.String> externs)
The file containing JavaScript externs. You may specify multiple.
-
setMixedJsSources
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.
-
setJsOutputFile
public AbstractCommandLineRunner.CommandLineConfig setJsOutputFile(java.lang.String jsOutputFile)
Primary output filename. If not specified, output is written to stdout
-
setContinueSavedCompilationFileName
public AbstractCommandLineRunner.CommandLineConfig setContinueSavedCompilationFileName(java.lang.String fileName)
Set the compiler to resume a saved compilation state from a file.
-
setSaveAfterChecksFileName
public AbstractCommandLineRunner.CommandLineConfig setSaveAfterChecksFileName(java.lang.String fileName)
Set the compiler to perform the first phase and save the intermediate result to a file.
-
getSaveAfterChecksFileName
public java.lang.String getSaveAfterChecksFileName()
-
setModule
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
public AbstractCommandLineRunner.CommandLineConfig setSourceMapInputFiles(java.util.Map<java.lang.String,java.lang.String> sourceMapInputFiles)
-
setParseInlineSourceMaps
public AbstractCommandLineRunner.CommandLineConfig setParseInlineSourceMaps(boolean parseInlineSourceMaps)
-
setVariableMapInputFile
public AbstractCommandLineRunner.CommandLineConfig setVariableMapInputFile(java.lang.String variableMapInputFile)
File containing the serialized version of the variable renaming map produced by a previous compilation
-
setPropertyMapInputFile
public AbstractCommandLineRunner.CommandLineConfig setPropertyMapInputFile(java.lang.String propertyMapInputFile)
File containing the serialized version of the property renaming map produced by a previous compilation
-
setVariableMapOutputFile
public AbstractCommandLineRunner.CommandLineConfig setVariableMapOutputFile(java.lang.String variableMapOutputFile)
File where the serialized version of the variable renaming map produced should be saved
-
setCreateNameMapFiles
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
public AbstractCommandLineRunner.CommandLineConfig setPropertyMapOutputFile(java.lang.String propertyMapOutputFile)
File where the serialized version of the property renaming map produced should be saved
-
setStringMapOutputFile
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
public AbstractCommandLineRunner.CommandLineConfig setInstrumentationMappingFile(java.lang.String instrumentationMappingFile)
-
setCodingConvention
public AbstractCommandLineRunner.CommandLineConfig setCodingConvention(CodingConvention codingConvention)
Sets rules and conventions to enforce.
-
setSummaryDetailLevel
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, see --check_types), 3 (always print summary). The default level is 1
-
setOutputWrapper
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
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
public AbstractCommandLineRunner.CommandLineConfig setModuleOutputPathPrefix(java.lang.String moduleOutputPathPrefix)
Prefix for filenames of compiled JS modules.<module-name>.js
will be appended to this prefix. Directories will be created as needed. Use with --module
-
setModuleOutputFiles
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
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
public AbstractCommandLineRunner.CommandLineConfig setSourceMapDetailLevel(SourceMap.DetailLevel level)
The detail supplied in the source map file, if generated.
-
setSourceMapFormat
public AbstractCommandLineRunner.CommandLineConfig setSourceMapFormat(SourceMap.Format format)
The source map format to use, if generated.
-
setSourceMapLocationMappings
public AbstractCommandLineRunner.CommandLineConfig setSourceMapLocationMappings(java.util.List<SourceMap.LocationMapping> locationMappings)
The source map location mappings to use, if generated.
-
setApplyInputSourceMaps
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
public AbstractCommandLineRunner.CommandLineConfig setWarningGuards(java.util.List<AbstractCommandLineRunner.FlagEntry<CheckLevel>> warningGuards)
Add warning guards.
-
setDefine
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
public AbstractCommandLineRunner.CommandLineConfig setBrowserFeaturesetYear(java.lang.Integer browserFeaturesetYear)
Indicates target browser's year
-
setTweak
public AbstractCommandLineRunner.CommandLineConfig setTweak(java.util.List<java.lang.String> tweak)
Override the default value of a registered tweak. The format is<name>[=<val>]
, where<name>
is the ID of a tweak and<val>
is a boolean, number, or a single-quoted string that contains no single quotes. If[=<val>]
is omitted, then true is assumed.
-
setTweakProcessing
public AbstractCommandLineRunner.CommandLineConfig setTweakProcessing(CompilerOptions.TweakProcessing tweakProcessing)
Sets the kind of processing to do for goog.tweak functions.
-
setCharset
public AbstractCommandLineRunner.CommandLineConfig setCharset(java.lang.String charset)
Input charset for all files.
-
setDependencyOptions
public AbstractCommandLineRunner.CommandLineConfig setDependencyOptions(@Nullable DependencyOptions dependencyOptions)
Sets the dependency management options.
-
setOutputManifest
public AbstractCommandLineRunner.CommandLineConfig setOutputManifest(java.util.List<java.lang.String> outputManifests)
Sets whether to print output manifest files. Filter out empty file names.
-
setOutputModuleDependencies
public AbstractCommandLineRunner.CommandLineConfig setOutputModuleDependencies(java.lang.String outputModuleDependencies)
Sets whether a JSON file representing the dependencies between modules should be created.
-
setOutputBundle
public AbstractCommandLineRunner.CommandLineConfig setOutputBundle(java.util.List<java.lang.String> outputBundles)
Sets whether to print output bundle files.
-
setSkipNormalOutputs
public AbstractCommandLineRunner.CommandLineConfig setSkipNormalOutputs(boolean skipNormalOutputs)
Sets whether the normal outputs of compilation should be skipped.
-
setManifestMaps
public AbstractCommandLineRunner.CommandLineConfig setManifestMaps(java.util.List<java.lang.String> manifestMaps)
Sets the execPath:rootRelativePath mappings
-
setTransformAMDToCJSModules
public AbstractCommandLineRunner.CommandLineConfig setTransformAMDToCJSModules(boolean transformAMDToCJSModules)
Set whether to transform AMD to CommonJS modules.
-
setProcessCommonJSModules
public AbstractCommandLineRunner.CommandLineConfig setProcessCommonJSModules(boolean processCommonJSModules)
Sets whether to process CommonJS modules.
-
setModuleRoots
public AbstractCommandLineRunner.CommandLineConfig setModuleRoots(java.util.List<java.lang.String> jsModuleRoots)
Sets the module roots.
-
setWarningsAllowlistFile
public AbstractCommandLineRunner.CommandLineConfig setWarningsAllowlistFile(java.lang.String fileName)
Sets a allowlist file that suppresses warnings.
-
setHideWarningsFor
public AbstractCommandLineRunner.CommandLineConfig setHideWarningsFor(java.util.List<java.lang.String> hideWarningsFor)
Sets the paths for which warnings will be hidden.
-
setAngularPass
public AbstractCommandLineRunner.CommandLineConfig setAngularPass(boolean angularPass)
Sets whether to process AngularJS-specific annotations.
-
setJsonStreamMode
public AbstractCommandLineRunner.CommandLineConfig setJsonStreamMode(com.google.javascript.jscomp.CompilerOptions.JsonStreamMode mode)
-
setErrorFormat
public AbstractCommandLineRunner.CommandLineConfig setErrorFormat(AbstractCommandLineRunner.CommandLineConfig.ErrorFormatOption errorFormat)
-
setJsonWarningsFile
public AbstractCommandLineRunner.CommandLineConfig setJsonWarningsFile(java.lang.String jsonWarningsFile)
-
-