To discover how DomUI works, to fix issues or to add new DomUI code you will need to check out the repository and be able to edit/compile/run DomUI.
There are multiple branches of DomUI, and which one you need depends on what you want to do. The most important branches are as follows:
For hacking DomUI we want master, so let's get that:
$ git clone -b master https://github.com/fjalvingh/domui mydomuibranch
This makes a clone of the git repository in a new directory "mydomuibranch".
The above checkout does an anonymous checkout, meaning that pushing back is hard. If you already have a github account you can of course also use the usual ssh url to access the repository, i.e. email@example.com:fjalvingh/domui.
DomUI uses Maven as its build tool. To compile you need a maven version >= 3.5 which you can find here. Linux users should download a version because the version present in your distribution may be old.
To compile do the following:
$ cd mydomuibranch $ mvn clean install -Dmaven.test.skip=true -Dmaven.javadoc.skip=true
This should end quickly with something like:
You might wonder why the above command line disables JUnit tests and Javadoc generation. Javadoc generation is not usually interesting when building and it takes a lot of time, so this speeds up the build.
The tests are disabled because for successful testing you need to have some software installed locally: the integration tests use Selenium Webdriver and the default configuration uses headless Chrome to run the tests. To run this you need to install the correct version of chromedriver for your platform/Chrome version. This can be downloaded from here, and should be installed according to your platform (somewhere along your PATH= for windows, and usually in /usr/bin for Linuxes).
To run the demo application after the build change to the demo application's directoty (to.etc.domui.demo) and run the following:
$ cd to.etc.domui.demo $ mvn jetty:run
This will start a web server on port 8088; you can reach the demo application at: http://localhost:8088/demo/.
To stop the web server again press CTRL+C on the terminal running maven.
IntelliJ Idea has great support for Maven out of the box, and makes it very easy to work on DomUI. To work with IntelliJ on the branch we just checked out do the following:
IntelliJ sometimes recognizes the Maven pom's automatically, but if it does not look in the bottom right for the "event log" icon and click it:
This will open the log which should show:
Click "Add as Maven project" and wait for IntelliJ to complete its work. When you open the project pane it should look something like this:
We are almost there, but we need to fix a few things:
If you built DomUI before using Maven then you should now be able to compile DomUI from IntelliJ (press CTRL+F9, Build → Rebuild Project). But if you did not you might get compile errors in something called vaadin-sass-compiler. These are caused by the fact that Maven has not run: maven generates some source files but IntelliJ's maven support does not know how to do that.
To fix, click on "Maven Projects" in the sidebar at the right of the screen, then click the "Maven" icon:
In the box that follows type "compile" to force Maven to generate the sources, then try IntelliJ's build again.
Once the build works you can start the "demo" application by using the provided webapp run profile. Look in the top right of the screen:
Run the webapp by either using the run or debug buttons.
If you do not see the run configuration you probably lack Tomcat, or IntelliJ cannot read the config. In that case please follow IntelliJ's own excellent guides to add the webapp generated under to.etc.domui.demo.