manolo / gwt-api-generator

Generator for creating GWT JSInterop clients from Polymer Web Components
Apache License 2.0
50 stars 24 forks source link

Can't find symbol JsArray when trying to build google-chart #59

Closed cpboyd closed 8 years ago

cpboyd commented 8 years ago

I'm trying to use the generator to build google-chart: https://github.com/GoogleWebComponents/google-chart

The error:

[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /D:/vgpe/src/main/java/com/vaadin/polymer/google/widget/event/GoogleChartSelectEvent.java:[46,12] cannot find symbol
  symbol:   class JsArray
  location: class com.vaadin.polymer.google.widget.event.GoogleChartSelectEvent
[ERROR] /D:/vgpe/src/main/java/com/vaadin/polymer/google/event/GoogleChartSelectEvent.java:[37,21] cannot find symbol
  symbol:   class JsArray
  location: interface com.vaadin.polymer.google.event.GoogleChartSelectEvent.Detail
[INFO] 2 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 14.417 s
[INFO] Finished at: 2016-01-25T11:39:03-05:00
[INFO] Final Memory: 21M/244M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project vaadin-gwt-polymer-elements: Compilation failure: Compilation failure:
[ERROR] /D:/vgpe/src/main/java/com/vaadin/polymer/google/widget/event/GoogleChartSelectEvent.java:[46,12] cannot find symbol
[ERROR] symbol:   class JsArray
[ERROR] location: class com.vaadin.polymer.google.widget.event.GoogleChartSelectEvent
[ERROR] /D:/vgpe/src/main/java/com/vaadin/polymer/google/event/GoogleChartSelectEvent.java:[37,21] cannot find symbol
[ERROR] symbol:   class JsArray
[ERROR] location: interface com.vaadin.polymer.google.event.GoogleChartSelectEvent.Detail
[ERROR] -> [Help 1]
[ERROR]
NunoPinheiro commented 8 years ago

Hi, I've experienced the same issue when trying to compile the map component. It seems the generation is missing an import: import com.google.gwt.core.client.JsArray;

cpboyd commented 8 years ago

Notably, the JsArray import is included in other files.

The issue primarily seems to be if JsArray is only utilized as a RETURN value from a function and not used elsewhere.

cpboyd commented 8 years ago

I've found the issue in the templates used for generation. JsArray is imported in Widget.template: https://github.com/vaadin/gwt-api-generator/blob/master/template/Widget.template#l11

However, it's not imported in either ElementEvent.template or WidgetEvent.template