You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

clientside-compiling.asciidoc 2.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. ---
  2. title: Compiling a Client-Side Module
  3. order: 4
  4. layout: page
  5. ---
  6. [[clientside.compiling]]
  7. = Compiling a Client-Side Module
  8. A client-side module, either a widget set or a pure client-side module, needs to
  9. be compiled to JavaScript using the Vaadin Client Compiler. During development,
  10. the Development Mode makes the compilation automatically when you reload the
  11. page, provided that the module has been initially compiled once with the
  12. compiler.
  13. As most Vaadin add-ons include widgets, widget set compilation is usually needed
  14. when using add-ons. In that case, the widget sets from different add-ons are
  15. compiled into a __project widget set__, as described in
  16. <<dummy/../../../framework/addons/addons-overview.asciidoc#addons.overview,"Using Vaadin Add-ons">>.
  17. ////
  18. TODO Provide a link to a proper add-on compilation section when one is
  19. available.
  20. ////
  21. [[clientside.compiling.overview]]
  22. == Vaadin Compiler Overview
  23. The Vaadin Client Compiler compiles Java to JavaScript. It is provided as the
  24. [filename]#vaadin-client-compiler# JAR, which you can execute with the
  25. [literal]#++-jar++# parameter for the Java runtime. It requires the
  26. [filename]#vaadin-client# JAR, which contains the Vaadin client-side framework.
  27. The compiler compiles a __client module__, which can be either a pure
  28. client-side module or a Vaadin widget set, that is, the Vaadin Client-Side
  29. Engine that includes the widgets used in the application. The client module is
  30. defined with a module descriptor, which was described in
  31. <<dummy/../../../framework/clientside/clientside-module#clientside.module,"Client-Side
  32. Module Descriptor">>.
  33. The compiler writes the compilation result to a target folder that will include
  34. the compiled JavaScript with any static resources included in the module.
  35. [[clientside.compiling.eclipse]]
  36. == Compiling in Eclipse
  37. When the Vaadin Plugin is installed in Eclipse, you can simply click the
  38. [guibutton]#Compile Vaadin widgets# button in the toolbar. It will compile the
  39. widget set it finds from the project. If the project has multiple widget sets,
  40. such as one for custom widgets and another one for the project, you need to
  41. select the module descriptor of the widget set to compile before clicking the
  42. button.
  43. The compilation with Vaadin Plugin for Eclipse currently requires that the
  44. module descriptor has suffix [filename]#Widgetset.gwt.xml#, although you can use
  45. it to compile also other client-side modules than widget sets. The result is
  46. written under [filename]#WebContent/VAADIN/widgetsets# folder.
  47. [[clientside.compiling.ant]]
  48. == Compiling with Ant
  49. You can find a script template for compiling widget sets with Ant and Ivy at the
  50. link:http://vaadin.com/download/[Vaadin download page]. You can copy the build
  51. script to your project and, once configured, run it with Ant.
  52. [[clientside.compiling.maven]]
  53. == Compiling with Maven
  54. You can compile the widget set with the [literal]#++vaadin:compile++# goal as
  55. follows:
  56. [subs="normal"]
  57. ----
  58. [prompt]#$# [command]#mvn# [parameter]#vaadin:compile#
  59. ----