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.
command line: git clone --recursive https://github.com/vaadin/charts.git
EGit:
- Open Git repository perspective - Window > Open Perspective > Other... > Git (Windows) - Eclipse > Open Perspective > Other... > Git (Mac)
- Click Clone a Git Repository and add the clone to this view
- Check 'clone submodules' on the third view of the wizard.
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.
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
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
- run goal
jetty:run
for project vaadin-charts-integration-tests - find a test class within package com/vaadin/addon/charts/testbenchtests
- 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.
- build widgetset, either by running goal
clean install
for the parent project orclean vaadin:compile install
for project vaadin-charts-integration-tests - run goal
jetty:run
for project vaadin-charts-integration-tests - 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.
- 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 - 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
https://vaadin.com/wiki/-/wiki/Main/Contributing+Code
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
- make sure your project is up to date: - right-click project > Team > Pull
- 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
- right-click project > Team > Commit...
- 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 - make sure you included the ticket number to the end of the first line of comment
(#<number>)
- make sure there is an empty line before the rest of the comment
- if you need to make further changes, click Amend Previous Commit instead of making a new commit
- make sure you are in the new branch
- make sure Gerrit has your public key (Contributing Code link above)
command line:
- navigate to cloned repository
git push ssh://yourusername@dev.vaadin.com:29418/charts.git head:refs/for/master
EGit:
- 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
- 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
- right-click project > Team > Push to Upstream