当前位置: 首页>>代码示例>>Java>>正文


Java WarningLevel类代码示例

本文整理汇总了Java中com.google.javascript.jscomp.WarningLevel的典型用法代码示例。如果您正苦于以下问题:Java WarningLevel类的具体用法?Java WarningLevel怎么用?Java WarningLevel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


WarningLevel类属于com.google.javascript.jscomp包,在下文中一共展示了WarningLevel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initCompilationResources

import com.google.javascript.jscomp.WarningLevel; //导入依赖的package包/类
private CompilerOptions initCompilationResources() {
  CompilerOptions options = new CompilerOptions();
  CompilationLevel.SIMPLE_OPTIMIZATIONS.setOptionsForCompilationLevel( options );

  options.setSourceMapOutputPath( "." );

  WarningLevel.QUIET.setOptionsForWarningLevel( options );
  options.setWarningLevel( DiagnosticGroups.LINT_CHECKS, CheckLevel.OFF );

  options.setLanguageIn( CompilerOptions.LanguageMode.ECMASCRIPT5 );

  // make sure these are clear
  this.lastPrefix = null;
  this.lastLocationMapping = null;

  return options;
}
 
开发者ID:pentaho,项目名称:pentaho-osgi-bundles,代码行数:18,代码来源:WebjarsURLConnection.java

示例2: CompileTask

import com.google.javascript.jscomp.WarningLevel; //导入依赖的package包/类
public CompileTask() {
  this.languageIn = CompilerOptions.LanguageMode.ECMASCRIPT3;
  this.warningLevel = WarningLevel.DEFAULT;
  this.debugOptions = false;
  this.compilationLevel = CompilationLevel.SIMPLE_OPTIMIZATIONS;
  this.customExternsOnly = false;
  this.manageDependencies = false;
  this.prettyPrint = false;
  this.printInputDelimiter = false;
  this.generateExports = false;
  this.replaceProperties = false;
  this.forceRecompile = false;
  this.replacePropertiesPrefix = "closure.define.";
  this.defineParams = Lists.newLinkedList();
  this.externFileLists = Lists.newLinkedList();
  this.sourceFileLists = Lists.newLinkedList();
  this.sourcePaths = Lists.newLinkedList();
  this.warnings = Lists.newLinkedList();
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:20,代码来源:CompileTask.java

示例3: CompileTask

import com.google.javascript.jscomp.WarningLevel; //导入依赖的package包/类
public CompileTask() {
  this.languageIn = CompilerOptions.LanguageMode.ECMASCRIPT_2015;
  this.languageOut = CompilerOptions.LanguageMode.ECMASCRIPT3;
  this.warningLevel = WarningLevel.DEFAULT;
  this.debugOptions = false;
  this.compilationLevel = CompilationLevel.SIMPLE_OPTIMIZATIONS;
  this.environment = CompilerOptions.Environment.BROWSER;
  this.manageDependencies = false;
  this.prettyPrint = false;
  this.printInputDelimiter = false;
  this.preferSingleQuotes = false;
  this.generateExports = false;
  this.replaceProperties = false;
  this.forceRecompile = false;
  this.angularPass = false;
  this.replacePropertiesPrefix = "closure.define.";
  this.defineParams = new ArrayList<>();
  this.entryPointParams = new ArrayList<>();
  this.externFileLists = new ArrayList<>();
  this.sourceFileLists = new ArrayList<>();
  this.sourcePaths = new ArrayList<>();
  this.warnings = new ArrayList<>();
}
 
开发者ID:google,项目名称:closure-compiler,代码行数:24,代码来源:CompileTask.java

示例4: CompileTask

import com.google.javascript.jscomp.WarningLevel; //导入依赖的package包/类
public CompileTask() {
  this.languageIn = CompilerOptions.LanguageMode.ECMASCRIPT3;
  this.warningLevel = WarningLevel.DEFAULT;
  this.debugOptions = false;
  this.compilationLevel = CompilationLevel.SIMPLE_OPTIMIZATIONS;
  this.customExternsOnly = false;
  this.manageDependencies = false;
  this.prettyPrint = false;
  this.printInputDelimiter = false;
  this.generateExports = false;
  this.replaceProperties = false;
  this.forceRecompile = false;
  this.replacePropertiesPrefix = "closure.define.";
  this.defineParams = Lists.newLinkedList();
  this.entryPointParams = Lists.newLinkedList();
  this.externFileLists = Lists.newLinkedList();
  this.sourceFileLists = Lists.newLinkedList();
  this.sourcePaths = Lists.newLinkedList();
  this.warnings = Lists.newLinkedList();
}
 
开发者ID:nicks,项目名称:closure-compiler-old,代码行数:21,代码来源:CompileTask.java

示例5: CompileTask

import com.google.javascript.jscomp.WarningLevel; //导入依赖的package包/类
public CompileTask() {
  this.warningLevel = WarningLevel.DEFAULT;
  this.debugOptions = false;
  this.compilationLevel = CompilationLevel.SIMPLE_OPTIMIZATIONS;
  this.customExternsOnly = false;
  this.externFileLists = Lists.newLinkedList();
  this.sourceFileLists = Lists.newLinkedList();
}
 
开发者ID:andyjko,项目名称:feedlack,代码行数:9,代码来源:CompileTask.java

示例6: setWarning

import com.google.javascript.jscomp.WarningLevel; //导入依赖的package包/类
/**
 * Set the warning level.
 * @param value The warning level by string name. (default, quiet, verbose).
 */
public void setWarning(String value) {
  if ("default".equalsIgnoreCase(value)) {
    this.warningLevel = WarningLevel.DEFAULT;
  } else if ("quiet".equalsIgnoreCase(value)) {
    this.warningLevel = WarningLevel.QUIET;
  } else if ("verbose".equalsIgnoreCase(value)) {
    this.warningLevel = WarningLevel.VERBOSE;
  } else {
    throw new BuildException(
        "Unrecognized 'warning' option value (" + value + ")");
  }
}
 
开发者ID:andyjko,项目名称:feedlack,代码行数:17,代码来源:CompileTask.java

示例7: testWarningLevel

import com.google.javascript.jscomp.WarningLevel; //导入依赖的package包/类
@Test
public static void testWarningLevel() throws Exception {
  JsOptions opts = new JsOptions();
  opts.warningLevel = sampleValueFor(
      "warningLevel", WarningLevel.class);

  sanityCheckArgv(opts);
}
 
开发者ID:mikesamuel,项目名称:closure-maven-plugin,代码行数:9,代码来源:JsOptionsTest.java

示例8: overrideOptions

import com.google.javascript.jscomp.WarningLevel; //导入依赖的package包/类
@Override
protected void overrideOptions(final CompilerOptions options) {
    super.overrideOptions(options);
    WarningLevel.QUIET.setOptionsForWarningLevel(options);
    //http://stackoverflow.com/questions/13261325/how-can-i-set-the-language-in-option-for-the-closure-compiler
    options.setLanguageIn(LanguageMode.ECMASCRIPT5);
}
 
开发者ID:subes,项目名称:invesdwin-nowicket,代码行数:8,代码来源:ConfiguredGoogleClosureJavaScriptCompressor.java

示例9: CompileTask

import com.google.javascript.jscomp.WarningLevel; //导入依赖的package包/类
public CompileTask() {
  this.warningLevel = WarningLevel.DEFAULT;
  this.debugOptions = false;
  this.compilationLevel = CompilationLevel.SIMPLE_OPTIMIZATIONS;
  this.customExternsOnly = false;
  this.manageDependencies = false;
  this.externFileLists = Lists.newLinkedList();
  this.sourceFileLists = Lists.newLinkedList();
}
 
开发者ID:ehsan,项目名称:js-symbolic-executor,代码行数:10,代码来源:CompileTask.java

示例10: build

import com.google.javascript.jscomp.WarningLevel; //导入依赖的package包/类
public static String build(Task task, List<File> inputs) {
  List<SourceFile> externs;
  try {
    externs = CommandLineRunner.getDefaultExterns();
  } catch (IOException e) {
    throw new BuildException(e);
  }

  List<SourceFile> jsInputs = new ArrayList<SourceFile>();
  for (File f : inputs) {
    jsInputs.add(SourceFile.fromFile(f));
  }

  CompilerOptions options = new CompilerOptions();
  CompilationLevel.ADVANCED_OPTIMIZATIONS
      .setOptionsForCompilationLevel(options);
  WarningLevel.VERBOSE.setOptionsForWarningLevel(options);
  for (DiagnosticGroup dg : diagnosticGroups) {
    options.setWarningLevel(dg, CheckLevel.ERROR);
  }

  options.setCodingConvention(new GoogleCodingConvention());

  Compiler compiler = new Compiler();
  MessageFormatter formatter =
      options.errorFormat.toFormatter(compiler, false);
  AntErrorManager errorManager = new AntErrorManager(formatter, task);
  compiler.setErrorManager(errorManager);

  Result r = compiler.compile(externs, jsInputs, options);
  if (!r.success) {
    return null;
  }

  String wrapped = "(function(){" + compiler.toSource() + "})();\n";
  return wrapped;
}
 
开发者ID:google,项目名称:caja,代码行数:38,代码来源:ClosureCompiler.java

示例11: getWarningLevel

import com.google.javascript.jscomp.WarningLevel; //导入依赖的package包/类
private WarningLevel getWarningLevel(final String warningLevel) throws MojoExecutionException {
    try {
        return WarningLevel.valueOf(warningLevel);
    } catch (Exception e) {
        final String errMsg = "Warning level '" + warningLevel + "' is wrong. Valid constants are: 'QUIET', " +
                "'DEFAULT', 'VERBOSE'";
        throw new MojoExecutionException(errMsg);
    }
}
 
开发者ID:primeui-extensions,项目名称:angular-directives-maven-plugin,代码行数:10,代码来源:AngularDirectiveMojo.java

示例12: processJsFiles

import com.google.javascript.jscomp.WarningLevel; //导入依赖的package包/类
private void processJsFiles(final File inputDir, final Set<File> jsFiles,
                            final CompilationLevel compilationLevel, final WarningLevel warningLevel,
                            final Aggregation aggr, final String suffix) throws MojoExecutionException {

    ResourcesSetAdapter rsa = new ResourcesSetJsAdapter(inputDir, jsFiles, compilationLevel, warningLevel, aggr,
            encoding, true, suffix);

    ClosureCompilerOptimizer closureOptimizer = new ClosureCompilerOptimizer();
    closureOptimizer.optimize(rsa, getLog());

}
 
开发者ID:primeui-extensions,项目名称:angular-directives-maven-plugin,代码行数:12,代码来源:AngularDirectiveMojo.java

示例13: testPropsValidator

import com.google.javascript.jscomp.WarningLevel; //导入依赖的package包/类
@Test public void testPropsValidator() {
  Compiler compiler = new Compiler(
      new PrintStream(ByteStreams.nullOutputStream())); // Silence logging
  CompilerOptions options = new CompilerOptions();
  CompilationLevel.ADVANCED_OPTIMIZATIONS
      .setOptionsForCompilationLevel(options);
  WarningLevel.VERBOSE.setOptionsForWarningLevel(options);
  options.setLanguageIn(CompilerOptions.LanguageMode.ECMASCRIPT5);
  options.setWarningLevel(
      DiagnosticGroups.MISSING_PROPERTIES, CheckLevel.ERROR);
  // Report warnings as errors to make tests simpler
  options.addWarningsGuard(new StrictWarningsGuard());
  ReactCompilerPass.Options passOptions = new ReactCompilerPass.Options();
  passOptions.propTypesTypeChecking = true;
  ReactCompilerPass compilerPass = new ReactCompilerPass(
      compiler, passOptions);
  options.addCustomPass(CustomPassExecutionTime.BEFORE_CHECKS, compilerPass);
  options.addWarningsGuard(new ReactWarningsGuard(compiler, compilerPass));
  String inputJs = "var Comp = React.createClass({" +
      "propTypes: {" +
        "strProp: React.PropTypes.string" +
      "}," +
      "render: function() {return null;}" +
    "});\n" +
    "React.createElement(Comp, {strProp: 1});";
  List<SourceFile> inputs = ImmutableList.of(
      SourceFile.fromCode("/src/react.js", "/** @providesModule React */"),
      SourceFile.fromCode("/src/test.js", inputJs));
  List<SourceFile> externs = ImmutableList.of(
      SourceFile.fromCode(
        "externs",
        "/** @constructor */ function Element() {};\n" +
        "/** @constructor */ function Event() {};"));
  Result result = compiler.compile(externs, inputs, options);
  assertFalse(result.success);
  assertEquals(1, result.errors.length);
  JSError error = result.errors[0];
  assertFalse(
      error.description,
      error.description.contains("Comp$$PropsValidator"));
  assertTrue(
      error.description,
      error.description.contains("\"strProp\" was expected to be of type"));
  assertEquals(
      PropTypesExtractor.PROP_TYPES_VALIDATION_MISMATCH, error.getType());
}
 
开发者ID:mihaip,项目名称:react-closure-compiler,代码行数:47,代码来源:ReactWarningsGuardTest.java

示例14: applyDefaultOptions

import com.google.javascript.jscomp.WarningLevel; //导入依赖的package包/类
private static void applyDefaultOptions(CompilerOptions options) {
  CompilationLevel.SIMPLE_OPTIMIZATIONS.setOptionsForCompilationLevel(options);
  WarningLevel.DEFAULT.setOptionsForWarningLevel(options);
  options.setLanguageIn(LanguageMode.ECMASCRIPT_2017);
  options.setLanguageOut(LanguageMode.ECMASCRIPT5);
}
 
开发者ID:google,项目名称:closure-compiler,代码行数:7,代码来源:GwtRunner.java

示例15: getWarningLevel

import com.google.javascript.jscomp.WarningLevel; //导入依赖的package包/类
/**
 * Returns <code>WarningLevel</code> used by the Closure compiler
 *  
 * @return <code>WarningLevel</code> used by the Closure compiler
 */
public WarningLevel getWarningLevel() {
	return warningLevel;
}
 
开发者ID:ad3n,项目名称:htmlcompressor,代码行数:9,代码来源:ClosureJavaScriptCompressor.java


注:本文中的com.google.javascript.jscomp.WarningLevel类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。