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.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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. Set up the Workspace and define required variables for projects
  20. --------
  21. 1. Open *Window* -> *Preferences* (Windows) or *Eclipse* -> *Preferences* (Mac)
  22. 1. Go to *General* -> *Workspace*
  23. 1. Set *Text file encoding* to *UTF-8*
  24. 1. Set *New text file line delimiter* to *Unix*
  25. 1. Go to *General* -> *Workspace* -> *Linked Resources*
  26. 1. Add a new Path Variable **GWT_ROOT** referring to the gwt folder containing the gwt project
  27. ![GWT_ROOT](http://f.cl.ly/items/430q0H0z3t362Z1A1n3L/LinkedResources.png "Defining GWT_ROOT")
  28. 1. Go to *Java* -> *Build Path* -> *Classpath Variables*
  29. 1. Add two new variables
  30. 1. GWT_TOOLS referring to the gwt-tools folder containing the dependency jars
  31. 1. JDK_HOME referring to your jdk installation directory
  32. ![GWT_TOOLS](http://f.cl.ly/items/1k2Z1n2v0p0y3l0X0D1G/ClasspathVars.png "Defining GWT_TOOLS")
  33. 1. Go to Java -> Compiler
  34. 1. Check that the compliance level has been set to 1.6 (or higher)
  35. 1. Go to XML -> XML Files -> Editor
  36. 1. Ensure the settings are follows:
  37. <pre><code>Line width: 72
  38. Format comments: true
  39. Join lines: true
  40. Insert whitespace before closing empty end-tags: true
  41. Indent-using spaces: true
  42. Indentation size: 4
  43. </code></pre>
  44. Import the Projects into the Workspace
  45. ------------
  46. 1. Do *File* -> *Import* -> *General* -> *Existing Projects into Workspace*
  47. ![ImportProject](http://f.cl.ly/items/0G361519182v1z2T1o1O/Import.png "Import project")
  48. 1. Select the workspace folder as root directory
  49. 1. Click “deselect all” and select
  50. 1. gwt-dev
  51. 2. gwt-user
  52. 1. Click “finish” to complete the import of GWT
  53. 1. Then repeat by doing *File* -> *Import* -> *General* -> *Existing Projects into Workspace*
  54. 1. Select the workspace folder as root directory
  55. 1. Click “deselect all” and select
  56. 1. vaadin
  57. 1. Click “finish” to complete the import of Vaadin Framework
  58. ![FinishImportProject](http://cl.ly/image/2W3S0P2c2p1t/Import2.png "Finishing Project Import")
  59. 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).
  60. Note that the first compilation takes a while to finish as Ivy downloads dependencies used in the projects.
  61. Compiling the Default Widget Set and Themes
  62. --------
  63. Compile the default widget set by executing the default target in build/ide.xml in the vaadin project.
  64. In Eclipse this is done by opening build/ide.xml, right clicking on it and choosing *Run As* -> *Ant Build*.
  65. ![CompileWidgetSet](http://cl.ly/image/1R43162b282e/build.png "Compiling the Widget Set")
  66. Running a UI test
  67. ------
  68. The *vaadin* project includes an embedded Jetty which is used for running the UI tests.
  69. It is a standard Java application: *com.vaadin.launcher.DevelopmentServerLauncher*.
  70. Launch it in debug mode in Eclipse by right clicking on it and selecting *Debug As* -> *Java Application*.
  71. 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).
  72. Running JUnit tests
  73. =====
  74. The JUnit tests for the projects can be run using
  75. <pre><code>ant test</code></pre>
  76. Running this in the *gwt* directory will run the GWT JUnit tests.
  77. Running it in the *vaadin* directory will run the Vaadin JUnit tests.
  78. Running the Vaadin TestBench tests currently requires access to a correctly configured TestBench 2 cluster, only available inside Vaadin.
  79. Building a package
  80. =====
  81. The distribution files can be built in a few steps. First build the *gwt* project by running
  82. <pre><code>ant</code></pre>
  83. in the *gwt* directory. The elemental package needs to be built separately:
  84. <pre><code>ant elemental</code></pre>
  85. Building the elemental package is not possible on Windows as it requires gcc.
  86. Move to the *vaadin* project directory and unpack the previously built gwt jars
  87. <pre><code>ant -f gwt-files.xml unpack.gwt</code></pre>
  88. Then build the *vaadin* project by running
  89. <pre><code>ant</code></pre>
  90. in the *vaadin* directory.