GWT compiler option to see generated files from custom generator with gwt maven plugin

前提是你 提交于 2019-12-24 13:02:21

问题


points out the -gen argument to compiler

As pointed out in the above post I added the gen flag by modifying my gwt maven plugin configuration like this

<gen>genSource</gen>

Funny thing it does write the generated classes but only the gwt core generator classes. none of my own custom generator classes output is written into it.

Any clues as to what could be wrong ?


回答1:


To do this, I am assuming you are using Eclipse with GWT plugin. right click on Gwt project Run As->Run Configuration,

  1. Select the "Java Application" on the left side. Right click on it,
    and select "New". This will create a new run configuration named "New Configuration"
  2. In the "New Configuration" ,you should be in the "Main" tab. Make sure that in the "Project" text box correct GWT project is selected. If not, you can select the right GWT project by clicking the "Browse" button next to it.

  3. Also in the main tab, click on the "Search" button next to "Main Class" text box. Write "Compiler" in the popup window and select "com.google.gwt.dev.Compiler".

  4. Go to the "Arguments" tab. Again you have two text boxes, program arguments (which are the GWT compiler arguments) and VM arguments. Put your GWT module name(eg.com.xyz.ModuleName) in the first line of your program argument box and in second line put -gen destinationPath(destinationPath is where you want to generate classes).
  5. finally click on apply button and run the configuration.after finishing compilation refresh the project and check destination folder path you will get generated classes.



回答2:


I found a solution -

the generated files incase of a maven based project are created in a hidden folder in target named .generated and contains all generated files. It was that simple. This solves the entire problem and now we are able to study and fix generator problems.

the gen tag in compiler configuration still doesn't work for my own custom generators and I haven't figured why.



来源:https://stackoverflow.com/questions/33892627/gwt-compiler-option-to-see-generated-files-from-custom-generator-with-gwt-maven

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!