google / jsinterop-generator

Generates Java annotated with JsInterop from JavaScript extern sources
Apache License 2.0
75 stars 24 forks source link

Add a fail on error mode #28

Open realityforge opened 5 years ago

realityforge commented 5 years ago

Currently Elemental2 builds can produce warnings that do not halt the build. As a result it is possible for to introduce more problems in code generated from this tool without realizing it. For example a a recent commit introduced the error

Mar 26, 2019 8:03:44 PM com.google.javascript.jscomp.LoggerErrorManager println
WARNING: external/com_google_closure_compiler/externs/browser/url.js:162: WARNING - Bad type annotation. Unknown type MediaSource
 * @param {!File|!Blob|!MediaSource|!MediaStream} obj

A possible solution is to update the generator tool so that it will fail if warnings that are not part of a known problems list will cause the build to fail. A possibly simpler alternative is to just introduce a fail on warning flag and fix the problems in Elemental2.

jDramaix commented 5 years ago

I'll take a look, initially, jsinterop-generator failed when a type was unknown.