Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

README.md 6.1KB

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