Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hide Google Library's warnings

I'm using Google Closure and Google Library with my projects and I'm meeting troubles with warnings.

My project is made of ~50 files with somme small warnings (JSDoc mistakes). The problem is Google Library, when I'm compiling my project, a huge list of warnings come from the google's library, like this :

../Libs/Closure/closure/goog/uri/utils.js:255: WARNING - inconsistent return type
found   : (null|string|undefined)
required: (null|string)
  return uri && decodeURIComponent(uri);
         ^

../Libs/Closure/closure/goog/uri/utils.js:634: WARNING - inconsistent return type
found   : (Array.<(string|undefined)>|undefined)
required: Array.<(string|undefined)>
  return buffer;
         ^

../Libs/Closure/closure/goog/uri/utils.js:671: WARNING - inconsistent return type
found   : (Array.<(string|undefined)>|undefined)
required: Array.<(string|undefined)>
  return buffer;
         ^

../Libs/Closure/third_party/closure/goog/mochikit/async/deferred.js:623: WARNING - assignment to property deferred of goog.async.Deferred.AlreadyCalledError
found   : (goog.async.Deferred|undefined)
required: (goog.async.Deferred|null)
  this.deferred = deferred;
  ^

../Libs/Closure/third_party/closure/goog/mochikit/async/deferred.js:651: WARNING - assignment to property deferred of goog.async.Deferred.CancelledError
found   : (goog.async.Deferred|undefined)
required: (goog.async.Deferred|null)
  this.deferred = deferred;
  ^

I've got more than 300 warnings from Google Library and ~50 from my project. So, how can I hide google's library warnings and show my project warnings ?

I've tried to build my project with the stable Google Library and with the last from the SVN repository but I've always all this warning.

My compilation configuration :

../Libs/Closure/closure/bin/build/closurebuilder.py \
--root=../Libs/Closure/ \
--root=../Projects/myProject/ \
--namespace="Project" \
--output_mode=compiled \
--compiler_jar=../Libs/Closure/compiler.jar \
--compiler_flags="--third_party=../Libs/Raphael/raphaeljs_extern.js" \
--compiler_flags="--compilation_level=SIMPLE_OPTIMIZATIONS" \
--compiler_flags="--warning_level=VERBOSE" \
> ../../Projects/js/project_release.js

Thanks for your time!

like image 817
Louis Avatar asked Nov 04 '22 12:11

Louis


1 Answers

To suppress all warning messages you should use:

--compiler_flags="--warning_level=QUIET"

instead of the verbose setting you currently have.

You may also want to check the grunt-closure-tools plugin for grunt that automates using closure's tools like the builder, compiler and depswritter.

like image 165
thanpolas Avatar answered Nov 09 '22 08:11

thanpolas