本文整理汇总了Java中com.google.javascript.jscomp.CompilerOptions.setGenerateExports方法的典型用法代码示例。如果您正苦于以下问题:Java CompilerOptions.setGenerateExports方法的具体用法?Java CompilerOptions.setGenerateExports怎么用?Java CompilerOptions.setGenerateExports使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.javascript.jscomp.CompilerOptions
的用法示例。
在下文中一共展示了CompilerOptions.setGenerateExports方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initCompilerOptions
import com.google.javascript.jscomp.CompilerOptions; //导入方法依赖的package包/类
protected CompilerOptions initCompilerOptions() {
CompilerOptions opts = new CompilerOptions();
opts.setSummaryDetailLevel(1);
opts.prettyPrint = true;
// MIT-LL's integrated demo script requires this setting since
// it uses trailing commas in object literals.
opts.setLanguageIn(LanguageMode.ECMASCRIPT5);
opts.setGenerateExports(false);
opts.setPreferLineBreakAtEndOfFile(false);
opts.setTrustedStrings(true);
/*
DependencyOptions dopts = new DependencyOptions();
dopts.setDependencyPruning(true);
dopts.setMoocherDropping(true);
opts.setDependencyOptions(dopts);
*/
return opts;
}
示例2: getCompilerOptions
import com.google.javascript.jscomp.CompilerOptions; //导入方法依赖的package包/类
@VisibleForTesting
public static CompilerOptions getCompilerOptions() {
CompilerOptions options = new CompilerOptions();
options.setLanguageIn(LanguageMode.ECMASCRIPT_NEXT);
options.setLanguageOut(LanguageMode.ECMASCRIPT5);
options.setSummaryDetailLevel(0);
DependencyOptions deps = new DependencyOptions();
deps.setDependencySorting(true);
options.setDependencyOptions(deps);
options.setChecksOnly(true);
options.setContinueAfterErrors(true);
options.setParseJsDocDocumentation(Config.JsDocParsing.INCLUDE_DESCRIPTIONS_NO_WHITESPACE);
options.setCheckSuspiciousCode(true);
options.setCheckSymbols(true);
options.setCheckTypes(true);
options.setBrokenClosureRequiresLevel(CheckLevel.OFF);
// TODO(bangert): Remove this -- we want to rewrite code before closure syntax is removed.
// Unfortunately, setClosurePass is required, or code doesn't type check.
options.setClosurePass(true);
options.setGenerateExports(true);
options.setPreserveClosurePrimitives(true);
options.setWarningLevel(DiagnosticGroups.STRICT_MISSING_REQUIRE, CheckLevel.WARNING);
options.setWarningLevel(DiagnosticGroups.EXTRA_REQUIRE, CheckLevel.WARNING);
options.setWarningLevel(DiagnosticGroups.LINT_CHECKS, CheckLevel.WARNING);
return options;
}
示例3: createCompilerOptions
import com.google.javascript.jscomp.CompilerOptions; //导入方法依赖的package包/类
private CompilerOptions createCompilerOptions() {
CompilerOptions options = new CompilerOptions();
this.compilationLevel.setOptionsForCompilationLevel(options);
if (this.debugOptions) {
this.compilationLevel.setDebugOptionsForCompilationLevel(options);
}
options.setEnvironment(this.environment);
options.setPrettyPrint(this.prettyPrint);
options.setPrintInputDelimiter(this.printInputDelimiter);
options.setPreferSingleQuotes(this.preferSingleQuotes);
options.setGenerateExports(this.generateExports);
options.setLanguageIn(this.languageIn);
options.setLanguageOut(this.languageOut);
options.setOutputCharset(this.outputEncoding);
this.warningLevel.setOptionsForWarningLevel(options);
options.setManageClosureDependencies(manageDependencies);
convertEntryPointParameters(options);
options.setTrustedStrings(true);
options.setAngularPass(angularPass);
if (replaceProperties) {
convertPropertiesMap(options);
}
convertDefineParameters(options);
for (Warning warning : warnings) {
CheckLevel level = warning.getLevel();
String groupName = warning.getGroup();
DiagnosticGroup group = new DiagnosticGroups().forName(groupName);
if (group == null) {
throw new BuildException(
"Unrecognized 'warning' option value (" + groupName + ")");
}
options.setWarningLevel(group, level);
}
if (!Strings.isNullOrEmpty(sourceMapFormat)) {
options.setSourceMapFormat(Format.valueOf(sourceMapFormat));
}
if (!Strings.isNullOrEmpty(sourceMapLocationMapping)) {
String[] tokens = sourceMapLocationMapping.split("\\|", -1);
LocationMapping lm = new LocationMapping(tokens[0], tokens[1]);
options.setSourceMapLocationMappings(Arrays.asList(lm));
}
options.setApplyInputSourceMaps(applyInputSourceMaps);
if (sourceMapOutputFile != null) {
File parentFile = sourceMapOutputFile.getParentFile();
if (parentFile.mkdirs()) {
log("Created missing parent directory " + parentFile, Project.MSG_DEBUG);
}
options.setSourceMapOutputPath(parentFile.getAbsolutePath());
}
return options;
}