Skip to content
This repository has been archived by the owner on Oct 1, 2022. It is now read-only.

Developer's Guide

Andreas Eberle edited this page Jan 5, 2015 · 17 revisions

Set Up Eclipse

To ensure minimal merging problems and ease readability of the code, the following settings should be applied.

Eclipse Workspace Setup

In order to start development check out the repository into a clean folder. This folder will then also be used as your Eclipse workspace for this project (if you want to use an existing workspace, keep in mind to only apply the auto formatter settings to this project instead of the whole workspace).

In order to create the Eclipse workspace, just enter the folder's location when asked for the workspace. Eclipse will create the workspace automatically on the first startup. After Eclipse started, no projects will be displayed, yet. In order to import the existing project, right-click in the "Package Explorer" View and select "Import...". Choose "General" -> "Existing Projects into Workspace" -> "Next". Select the "root directory" as the workspace's location. Now you should see the "Compiler" project. After selecting it and clicking "Finish", you've successfully created the workspace.

Eclipse Auto Formatter

The team uses a common Eclipse auto formatter configuration. To configure Eclipse correctly, open the workspace containing the project and select "Window" -> "Preferences" in the top bar. In the search field of the dialog, type "save actions" and select the Java save actions as shown in the picture below.

configuring save actions

Adjust your settings to match the ones of the figure before clicking on "Formatter" and then "Import".

importing formatter

The formatter configuration can be found in the repository at "docs/eclipse-setup/formatterConfiguration.xml".

Further Plugins

  • FindBugs: Useful to detect potential problems

Starting Swing UI

Starting Android UI

Known Issues

  • The project "jsettlers.main.android" displays a classpath error (red exclamation mark on the project symbol)
  • Right click the project, select "Run As" -> "Android Application". This causes the missing dependency to be build. Please note, the first run may fail, with the message that there are errors in the project. After that, simply wait until Eclipse detects that the errors are no longer valid. Then you can run the project as Android Application and install it on your device.