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.

README.md 5.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. Cloning the project repositories
  2. ======
  3. Vaadin 7 consists of three separate repositories
  4. * https://github.com/vaadin/vaadin.git
  5. * https://github.com/vaadin/gwt.git
  6. * https://github.com/vaadin/gwt-tools.git
  7. Start by cloning these repositories into the same folder:
  8. <pre><code>git clone https://github.com/vaadin/vaadin.git
  9. git clone https://github.com/vaadin/gwt.git
  10. git clone https://github.com/vaadin/gwt-tools.git</code></pre>
  11. The *vaadin* and *gwt* repositories contain project code. The *gwt-tools* project only contain dependency jars used by the other projects.
  12. Do not rename the repositories as the rest of this document relies on using the standard naming.
  13. Setting up Eclipse to Develop Vaadin 7
  14. =========
  15. Assuming you have cloned the repositories as described in “Cloning the project repositories” above, you can import the *vaadin* and *gwt* projects into Eclipse as follows:
  16. Start Eclipse
  17. -------------
  18. Start Eclipse and use the root checkout folder (the one containing the *vaadin*, *gwt* and *gwt-tools* folders) as the workspace folder
  19. Define Required Variables for the GWT Eclipse Projects
  20. --------
  21. To be able to find all files, the GWT project requires you to define a couple of variables:
  22. 1. Open *Window* -> *Preferences* (Windows) or *Eclipse* -> *Preferences* (Mac)
  23. 1. Go to *General* -> *Workspace* -> *Linked Resources*
  24. 1. Add a new Path Variable **GWT_ROOT** referring to the gwt folder containing the gwt project
  25. ![GWT_ROOT](http://f.cl.ly/items/430q0H0z3t362Z1A1n3L/LinkedResources.png "Defining GWT_ROOT")
  26. 1. Go to *Java* -> *Build Path* -> *Classpath Variables*
  27. 1. Add two new variables
  28. 1. GWT_TOOLS referring to the gwt-tools folder containing the dependency jars
  29. 1. JDK_HOME referring to your jdk installation directory
  30. ![GWT_TOOLS](http://f.cl.ly/items/1k2Z1n2v0p0y3l0X0D1G/ClasspathVars.png "Defining GWT_TOOLS")
  31. 1. Go to Java -> Compiler
  32. 1. Check that the compliance level has been set to 1.6 (or higher)
  33. Import the Projects into the Workspace
  34. ------------
  35. 1. Do *File* -> *Import* -> *General* -> *Existing Projects into Workspace*
  36. ![ImportProject](http://f.cl.ly/items/0G361519182v1z2T1o1O/Import.png "Import project")
  37. 1. Select the workspace folder as root directory
  38. 1. Click “deselect all” and select
  39. 1. gwt-dev
  40. 2. gwt-user
  41. 1. Click “finish” to complete the import of GWT
  42. 1. Then repeat by doing *File* -> *Import* -> *General* -> *Existing Projects into Workspace*
  43. 1. Select the workspace folder as root directory
  44. 1. Click “deselect all” and select
  45. 1. vaadin
  46. 1. Click “finish” to complete the import of Vaadin Framework
  47. ![FinishImportProject](http://cl.ly/image/2W3S0P2c2p1t/Import2.png "Finishing Project Import")
  48. You should now have three projects in your workspace. If the vaadin project does not compile without errors, choose *Ivy* -> *Resolve* from the vaadin project popup menu. Now all projects should compile without errors (there might be warnings).
  49. Note that the first compilation takes a while to finish as Ivy downloads dependencies used in the projects.
  50. Compiling the Default Widget Set and Themes
  51. --------
  52. Compile the default widget set by executing the default target in build/ide.xml in the vaadin project.
  53. In Eclipse this is done by opening build/ide.xml, right clicking on it and choosing *Run As* -> *Ant Build*.
  54. ![CompileWidgetSet](http://cl.ly/image/1R43162b282e/build.png "Compiling the Widget Set")
  55. Running a UI test
  56. ------
  57. The *vaadin* project includes an embedded Jetty which is used for running the UI tests.
  58. It is a standard Java application: *com.vaadin.launcher.DevelopmentServerLauncher*.
  59. Launch it in debug mode in Eclipse by right clicking on it and selecting *Debug As* -> *Java Application*.
  60. This launches a Jetty on port 8888 which allows you to run any UI class in the project by opening http://localhost:8888/run/&lt;UI class name&gt;?restartApplication in your browser, e.g. [http://localhost:8888/run/com.vaadin.tests.components.label.LabelModes?restartApplication](http://localhost:8888/run/com.vaadin.tests.components.label.LabelModes?restartApplication) (Add ?restartApplication to ensure).
  61. Running JUnit tests
  62. =====
  63. The JUnit tests for the projects can be run using
  64. <pre><code>ant test</code></pre>
  65. Running this in the *gwt* directory will run the GWT JUnit tests.
  66. Running it in the *vaadin* directory will run the Vaadin JUnit tests.
  67. Running the Vaadin TestBench tests currently requires access to a correctly configured TestBench 2 cluster, only available inside Vaadin.
  68. Building a package
  69. =====
  70. The distribution files can be built in a few steps. First build the *gwt* project by running
  71. <pre><code>ant</code></pre>
  72. in the *gwt* directory. The elemental package needs to be built separately:
  73. <pre><code>ant elemental</code></pre>
  74. Building the elemental package is not possible on Windows as it requires gcc.
  75. Move to the *vaadin* project directory and unpack the previously built gwt jars
  76. <pre><code>ant -f gwt-files.xml unpack.gwt</code></pre>
  77. Then build the *vaadin* project by running
  78. <pre><code>ant</code></pre>
  79. in the *vaadin* directory.