Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation errors on the generated code. #65

Closed
komasoftware opened this issue May 27, 2016 · 11 comments
Closed

Compilation errors on the generated code. #65

komasoftware opened this issue May 27, 2016 · 11 comments

Comments

@komasoftware
Copy link

I installed following Polymer components

"dependencies": {
"google-drive": "GoogleWebcomponents/google-drive#^1.0.1",
"google-apis": "GoogleWebcomponents/google-apis#^1.1.5",
"google-signin": "GoogleWebcomponents/google-signin#^1.3.3",
"vaadin-grid": "vaadin/vaadin-grid#1.0.0",
"vaadin-combo-box": "vaadin/vaadin-combo-box#1.0.0",
"paper-elements": "PolymerElements/paper-elements#^1.0.7",
"iron-elements": "PolymerElements/iron-elements#^1.0.10",
"neon-elements": "PolymerElements/neon-elements#^1.0.0",
"vaadin-icons": "vaadin/vaadin-icons#1.0.0"
}

gwt-api-generator --pom
mvn package

bunch of errors ...

[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] /home/koen/workspace/asics/gwt-api-generator/src/main/java/com/vaadin/polymer/paper/widget/event/TransitionendEventparamnodeObjectdetailContainstheanimatednode.EventHandler.java:[13,80] '{' expected
[ERROR] /home/koen/workspace/asics/gwt-api-generator/src/main/java/com/vaadin/polymer/paper/widget/event/TransitionendEventparamnodeObjectdetailContainstheanimatednode.EventHandler.java:[15,74] '(' expected
[ERROR] /home/koen/workspace/asics/gwt-api-generator/src/main/java/com/vaadin/polymer/paper/widget/event/TransitionendEventparamnodeObjectdetailContainstheanimatednode.EventHandler.java:[15,150] = expected
[ERROR] /home/koen/workspace/asics/gwt-api-generator/src/main/java/com/vaadin/polymer/paper/event/TransitionendEventparamnodeObjectdetailContainstheanimatednode.Event.java:[23,80] '{' expected
[ERROR] /home/koen/workspace/asics/gwt-api-generator/src/main/java/com/vaadin/polymer/paper/widget/PaperButton.java:[574,97] ';' expected
[ERROR] /home/koen/workspace/asics/gwt-api-generator/src/main/java/com/vaadin/polymer/paper/widget/PaperButton.java:[574,98] invalid method declaration; return type required
[ERROR] /home/koen/workspace/asics/gwt-api-generator/src/main/java/com/vaadin/polymer/paper/widget/event/TransitionendEventparamnodeObjectdetailContainstheanimatednode.Event.java:[19,76] '{' expected
[ERROR] /home/koen/workspace/asics/gwt-api-generator/src/main/java/com/vaadin/polymer/paper/widget/event/TransitionendEventparamnodeObjectdetailContainstheanimatednode.Event.java:[19,162] > expected
[ERROR] /home/koen/workspace/asics/gwt-api-generator/src/main/java/com/vaadin/polymer/paper/widget/event/TransitionendEventparamnodeObjectdetailContainstheanimatednode.Event.java:[19,175] '(' expected
[ERROR] /home/koen/workspace/asics/gwt-api-generator/src/main/java/com/vaadin/polymer/paper/widget/event/TransitionendEventparamnodeObjectdetailContainstheanimatednode.Event.java:[21,5] illegal start of expression
[ERROR] /home/koen/workspace/asics/gwt-api-generator/src/main/java/com/vaadin/polymer/paper/widget/event/TransitionendEventparamnodeObjectdetailContainstheanimatednode.Event.java:[21,12] illegal start of expression
[ERROR] /home/koen/workspace/asics/gwt-api-generator/src/main/java/com/vaadin/polymer/paper/widget/event/TransitionendEventparamnodeObjectdetailContainstheanimatednode.Event.java:[21,23] ';' expected
[ERROR] /home/koen/workspace/asics/gwt-api-generator/src/main/java/com/vaadin/polymer/paper/widget/event/TransitionendEventparamnodeObjectdetailContainstheanimatednode.Event.java:[21,101] illegal start of expression
[ERROR] /home/koen/workspace/asics/gwt-api-generator/src/main/java/com/vaadin/polymer/paper/widget/event/TransitionendEventparamnodeObjectdetailContainstheanimatednode.Event.java:[21,106] illegal start of expression
[ERROR] /home/koen/workspace/asics/gwt-api-generator/src/main/java/com/vaadin/polymer/paper/widget/event/TransitionendEventparamnodeObjectdetailContainstheanimatednode.Event.java:[21,107] ';' expected
[ERROR] /home/koen/workspace/asics/gwt-api-generator/src/main/java/com/vaadin/polymer/paper/widget/event/TransitionendEventparamnodeObjectdetailContainstheanimatednode.Event.java:[21,116] not a statement
[ERROR] /home/koen/workspace/asics/gwt-api-generator/src/main/java/com/vaadin/polymer/paper/widget/event/TransitionendEventparamnodeObjectdetailContainstheanimatednode.Event.java:[21,193] ';' expected
[ERROR] /home/koen/workspace/asics/gwt-api-generator/src/main/java/com/vaadin/polymer/paper/widget/event/TransitionendEventparamnodeObjectdetailContainstheanimatednode.Event.java:[22,107] not a statement
[ERROR] /home/koen/workspace/asics/gwt-api-generator/src/main/java/com/vaadin/polymer/paper/widget/event/TransitionendEventparamnodeObjectdetailContainstheanimatednode.Event.java:[22,112] ';' expected
[ERROR] /home/koen/workspace/asics/gwt-api-generator/src/main/java/com/vaadin/polymer/paper/widget/event/TransitionendEventparamnodeObjectdetailContainstheanimatednode.Event.java:[22,188] ';' expected
[ERROR] /home/koen/workspace/asics/gwt-api-generator/src/main/java/com/vaadin/polymer/paper/widget/event/TransitionendEventparamnodeObjectdetailContainstheanimatednode.Event.java:[25,5] illegal start of expression
[ERROR] /home/koen/workspace/asics/gwt-api-generator/src/main/java/com/vaadin/polymer/paper/widget/event/TransitionendEventparamnodeObjectdetailContainstheanimatednode.Event.java:[25,82] ';' expected
[ERROR] /home/koen/workspace/asics/gwt-api-generator/src/main/java/com/vaadin/polymer/paper/widget/event/TransitionendEventparamnodeObjectdetailContainstheanimatednode.Event.java:[28,5] illegal start of expression
[ERROR] /home/koen/workspace/asics/gwt-api-generator/src/main/java/com/vaadin/polymer/paper/widget/event/TransitionendEventparamnodeObjectdetailContainstheanimatednode.Event.java:[28,111] ';' expected
[ERROR] /home/koen/workspace/asics/gwt-api-generator/src/main/java/com/vaadin/polymer/paper/widget/event/TransitionendEventparamnodeObjectdetailContainstheanimatednode.Event.java:[32,5] illegal start of expression
[ERROR] /home/koen/workspace/asics/gwt-api-generator/src/main/java/com/vaadin/polymer/paper/widget/event/TransitionendEventparamnodeObjectdetailContainstheanimatednode.Event.java:[32,15] illegal start of expression
[ERROR] /home/koen/workspace/asics/gwt-api-generator/src/main/java/com/vaadin/polymer/paper/widget/event/TransitionendEventparamnodeObjectdetailContainstheanimatednode.Event.java:[32,28] ';' expected
[ERROR] /home/koen/workspace/asics/gwt-api-generator/src/main/java/com/vaadin/polymer/paper/widget/event/TransitionendEventparamnodeObjectdetailContainstheanimatednode.Event.java:[32,112] ';' expected
[ERROR] /home/koen/workspace/asics/gwt-api-generator/src/main/java/com/vaadin/polymer/paper/widget/event/TransitionendEventparamnodeObjectdetailContainstheanimatednode.Event.java:[33,82] <identifier> expected
[ERROR] /home/koen/workspace/asics/gwt-api-generator/src/main/java/com/vaadin/polymer/paper/widget/event/TransitionendEventparamnodeObjectdetailContainstheanimatednode.Event.java:[36,5] illegal start of expression
[ERROR] /home/koen/workspace/asics/gwt-api-generator/src/main/java/com/vaadin/polymer/paper/widget/event/TransitionendEventparamnodeObjectdetailContainstheanimatednode.Event.java:[36,127] ';' expected
[ERROR] /home/koen/workspace/asics/gwt-api-generator/src/main/java/com/vaadin/polymer/paper/widget/event/TransitionendEventparamnodeObjectdetailContainstheanimatednode.Event.java:[41,2] reached end of file while parsing
[INFO] 32 errors 

@tehapo
Copy link
Contributor

tehapo commented May 27, 2016

I can verify the same compilation errors. I did the following steps in an empty test directory.

bower install paper-elements
gwt-api-generator --pom
mvn package

Could you @manolo take a look at this?

@komasoftware
Copy link
Author

komasoftware commented May 27, 2016

Yes, the basic sample from the README does not work anymore :

$ gwt-api-generator --package=PolymerElements/paper-elements --pom
$ mvn package

returns the same errors. I'd love to help to get this fixed if @manolo could provide some pointers ?

@ghost
Copy link

ghost commented Jun 8, 2016

It's a Polymer comment change in paper-button.html (line 174) that causes this issue:

before:
@param {{node: Object}} detail Contains the animated node.

now:
Event param: {{node: Object}} detail Contains the animated node.

It seems that the missing @param annotation causes the extension of the TransitionendEventto TransitionendEventparamnodeObjectdetailContainstheanimatednode.Event

@komasoftware
Copy link
Author

Can we be a bit more forgiving for this kind of errors in the comments when generating ?
@muelbr can you past a link to the relevant part of the generator code ?

@ghost
Copy link

ghost commented Jun 8, 2016

I am not committer to this project.
But if you are going for the latest polymer version then download the components manually with bower, fix this line and generate the wrapper classes.

$ bower install --save PolymerElements/paper-elements
$ gwt-api-generator

@cpboyd
Copy link

cpboyd commented Jun 20, 2016

As a note, the Polymer team changed from @param to Event param due to compiler issues:
PolymerElements/paper-button@2f44db5

Basically, I think the "name" function (at least for events) needs to take newlines into account.

It doesn't make sense that an event name would span multiple lines.

@cpboyd
Copy link

cpboyd commented Jun 20, 2016

@komasoftware Using a split on newlines and taking the first line seems to fix the issue.
(Granted, the event's generated NAME string still has the long comment nonsense with only this change in camelCase, so probably making the same change with other functions)

In helpers.js line 61:

  camelCase: function(s) {
    return (s.split('\n')[0] || '').replace(/^Polymer\./, '').replace(/[^\-\w\.]/g,'').replace(/(\b|-|\.)\w/g, function (m) {
      return m.toUpperCase().replace(/[-\.]/g, '');
    });
  },

@komasoftware
Copy link
Author

Back here. The change did not really solve the issue.

Wondering if @manolo still plans to support this library. Otherwise I need to look into another solution and rewrite my code. I would really like to know !

@andrescirulo
Copy link

andrescirulo commented Aug 10, 2016

I used an awful solution.
The solution of helpers.js line 61 dind't work for me, so i changed it to

camelCase: function(s) {
    if (s.toLowerCase().startsWith('transitionend')){
        console.log('name--:' + s);
        return 'Transitionend';
    }   
    return (s || '').replace(/^Polymer\./, '').replace(/[^\-\w\.]/g,'').replace(/(\b|-|\.)\w/g, function (m) {
        return m.toUpperCase().replace(/[-\.]/g, '');
    });
}

It's horrible, but it compiles. Then i had to use the fix mentioned here.

The problem I have now is that in Chrome the PaperInput does not work. It is visible, but i can't get the focus.
Anyone with the same problem? Could it have to do with the change i made in the function camelCase?

For what i could see, the compilation now is showing a lot of errors/warnings (?) like this one but with many components
Behavior Polymer.Templatizer not found when mixing properties into vaadin-infinite-scroller!
Any idea why this could be? Could this be the problem?

@manolo
Copy link
Owner

manolo commented Aug 23, 2016

Fixed in ecb419c

@manolo manolo closed this as completed Aug 23, 2016
@komasoftware
Copy link
Author

komasoftware commented Aug 23, 2016

How can I "npm install -g vaadin/gwt-api-generator" a specific commit ecb419c ?
Or will a new release soon follow ?

Thx for all the work !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants