Skip to content

Latest commit

 

History

History
145 lines (102 loc) · 6.51 KB

DevInstructions.md

File metadata and controls

145 lines (102 loc) · 6.51 KB

Basic instructions for developers when using Eclipse

Instructions written for Luna/Mars, but should work similarly for Kepler. Earlier versions don't have Maven built-in, so you'll have to install that separately if you don't want to upgrade your Eclipse.

Clone repository

command line: git clone --recursive https://github.com/vaadin/charts.git

EGit:

  1. Open Git repository perspective - Window > Open Perspective > Other... > Git (Windows) - Eclipse > Open Perspective > Other... > Git (Mac)
  2. Click Clone a Git Repository and add the clone to this view
  3. Check 'clone submodules' on the third view of the wizard.

Import project

File > Import... > Maven > Existing Maven Projects

You'll need the main project if you want to be able to export the demo war. Vaadin 7 version of the add-on is named by default vaadin-charts (addon/pom.xml), Vaadin 6 isn't supported in newer Charts versions. Regression tests are located in vaadin-charts-integration-tests (vaadin-charts-integration-tests/pom.xml). In most cases you shouldn't need modules book-examples, vaadin-charts-demo, and vaadin-charts-directorypackage, although if you want to run any Maven goals on the parent pom.xml without them you'll need to comment them out from the module listing first. Whether you'll import the parent module or not is a matter of preference, it's not necessary for most use cases.

Maven

Sync the Eclipse project settings with the pom.xml:

  • right-click project > Maven > Update Project

If there are problems in the pom.xml, right-click the problematic place > quick fix > experimental

Running Maven goals

command line: mvn goal

Eclipse: right-click project > Run As > Maven build... > goal

Note: running all the tests might take quite a while on Windows laptops at least.

#skipping tests:

Eclipse: check the skip tests when you run any goal

command line: mvn goal -DskipTests

#download dependencies: goal: install

#compile widgetset: goal for Vaadin 7: vaadin:compile
goal for Vaadin 6: gwt:compile

#run in jetty goal: jetty:run

#superdevmode: goal: vaadin:run-codeserver

#clean: goal: clean

#run all tests: goal: test OR goal: verify

#run single test

  1. run goal jetty:run for project vaadin-charts-integration-tests
  2. find a test class within package com/vaadin/addon/charts/testbenchtests
  3. right-click -> run as JUnit

If you are within Vaadin network this will execute the test on a test hub. Running the tests through VPN access may require you to modify AbstractParallelTest.findAutoHostname() to return the IP address that was assigned for the VPN connection.

Note: To run the test locally add a @RunLocally annotation to the test class. Default browser is Firefox, but it can be overridden e.g. by using @RunLocally(Browser.PHANTOMJS) annotation instead.

#create demo war: goal: package (for main project, should appear to /demo/target - for subprojects creates jars)

#more about Maven and Vaadin: https://vaadin.com/wiki/-/wiki/Main/Creating+a+Maven+project

Goals can also be combined, e.g. clean package install

Note: if you run goal clean package install with the skip tests checked, you must run the vaadin:compile goal before you can run any tests again.

If you try to run some goal and get errors that are related to javadoc, check the stacktrace for what version of maven-javadoc-plugin you are using. If your version is 2.10, add <version>2.9.1</version> after <artifactId>maven-javadoc-plugin</artifactId> in pom.xml. The problem should also be fixed in the next version after 2.10 once it's released.

Running test UIs

  1. build widgetset, either by running goal clean install for the parent project or clean vaadin:compile install for project vaadin-charts-integration-tests
  2. run goal jetty:run for project vaadin-charts-integration-tests
  3. go to http://localhost:9998/ for a list of all tests (click opens the selected test to another tab) or directly to http://localhost:9998/other/AreaRange or http://localhost:9998/area/AreaSpline etc.
  4. if you want to use superdevmode, make sure your widgetset is up to date, run goal vaadin:run-codeserver for project vaadin-charts-integration-tests and then add ?superdevmode to the url
  5. you can restart regular server and superdevmode server independently of each other, but they both must be running at the same time for superdevmode to work

Contributing

https://vaadin.com/wiki/-/wiki/Main/Contributing+Code

Before making any changes

Ensure your Eclipse is set up according to http://dev.vaadin.com/wiki/CodingConventions (except Java6 for Vaadin 7 projects) and https://github.com/vaadin/vaadin#set-up-extra-workspace-preferences

Commiting changes

  1. make sure your project is up to date: - right-click project > Team > Pull
  2. create a new branch for your change: - right-click project > Team > Switch To > New Branch... - give the branch some suitable name and make sure it's set to checkout the new branch
  3. right-click project > Team > Commit...
  4. make sure you have Compute Change-Id For Gerrit Code Review selected - you may automate this by adding gerrit.createchangeid = true to your repository configurations
  5. make sure you included the ticket number to the end of the first line of comment (#<number>)
  6. make sure there is an empty line before the rest of the comment
  7. if you need to make further changes, click Amend Previous Commit instead of making a new commit

Pushing changes

  1. make sure you are in the new branch
  2. make sure Gerrit has your public key (Contributing Code link above)

command line:

  1. navigate to cloned repository
  2. git push ssh://yourusername@dev.vaadin.com:29418/charts.git head:refs/for/master

EGit:

  1. make sure eclipse has your private key: - Window > Preferences > search 'ssh' > SSH2 (Windows) - Eclipse > Preferences > search 'ssh' > SSH2 (Mac) - check the path and add the key to the list if necessary
  2. right-click project > Team > Remote > Configure Push To Upstream... - Push URIs: ssh://yourusername@dev.vaadin.com:29418/charts.git - Ref mappings: HEAD:refs/for/master
  3. right-click project > Team > Push to Upstream