Skip to content

Developer Setup

Luca Beurer-Kellner edited this page Nov 30, 2017 · 4 revisions

Developer Setup

Author: lbeurerkellner.

lbeurerkellner: Just hit me up if there are any questions or anything's unclear.

If you are facing issues with the Developer Setup, check out the Developer Setup FAQ

Prerequisites

  1. Install JDK8 on your machine http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

  2. Setup Git on your machine. For instructions see here https://help.github.com/articles/set-up-git/

    It is crucial that we all use SSH authentication for the setup to work. So please make yourself familiar with ssh-keygen and the likes. See here https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/ for that. Make sure you add your public key to your github.

    You can test if your SSH authentication works by cloning the repository via this url: git@github.com:ConsistAnts/ConsistAnts.git. When using this URL you shouldn't be prompted for your GH username or password. Only your SSH passphrase will be necessary. If you are prompted for your GH credentials, something went wrong and you should review your steps.

  3. Configure Git on your machine. Most importantly, this means that you use the same email address in your author information when making git commits. See here for that https://help.github.com/articles/setting-your-email-in-git/

Developer Setup

  1. Download the Eclipse Installer from eclipse.org: http://www.eclipse.org/downloads/ (Press the big orange Download button)

  2. Run the downloaded Eclipse Installer and switch to Advanced Mode. (Press the hamburger-menu on the top right and select Advanced Mode)

    The installer might ask you if you want to move it to a permanent location. You can ignore this and select No.

  3. From the list of Eclipse.org products select Eclipse IDE for Committers.

  4. Make sure the Product Version is set to Oxygen (not Latest (Oxygen))

  5. Select Next

  6. In the now appearing list select the entry Github Projects and click the green plus symbol on the top right (You might have to collapse the Eclipse Projects item to see the Github Projects item.

  7. In the Resource URIs field enter https://raw.githubusercontent.com/ConsistAnts/ConsistAnts/master/releng/de.hu_berlin.cchecker.releng/ConsistencyCheckingFramework.setup and press OK

  8. A new entry Consistency Checking Framework should have appeared in the tree under Github Projects > <User>

  9. Double click this entry so that it appears in the bottom list of the dialog (Consistency Checking Framework should be the only item in the bottom list)

  10. Select Next

  11. The next page allows to change some basic parameters. Don't change these and continue by, once again, selecting Next.

  12. On the final page select Finish and wait for the installer to finish. (You might get some pop-ups regarding User Agreements and Licenses. Make sure to always accept these)

If everything went well, a new Eclipse IDE should have opened. (The installer will still be open in the background, but you can close it now)

Right after startup, the IDE will perform a setup task to create the development environment. It may ask you for your SSH passphrase, as it will clone the repository. You can see the progress of the setup by clicking on the symbol that appears on the bottom right of your IDE window.

After the setup has finished, you will see 3 main Eclipse Working Sets in the Package Explorer on the left. By expanding these Working Sets you can explore the repository content. (You'll have to close the Welcome view if it pops up)

Maven Build

To perform a maven build, just run

mvn clean verify

If your executing the maven build on macOS machine you have to add the parameter -Djvm.tests.args=-XstartOnFirstThread

in the root directory of the project. This will build everything and perform all tests.

If the build was run in a directory under version control, Git will recognise temporary build files (like target/ folders) as changes. Make sure to run mvn clean before committing any changes. We do not commit any temporary build files.

Sonar Lint

Author: Linus

Installing SonarLint

SonarLint is an Eclipse plug-in doing most of what Sonarqube, analyzing your code and pointing out its flaws. Ideally, you want all the classes you wrote to not show up in the SonarLint report.

  1. Open the Eclipse Marketplace in Eclipse directly (Help -> Eclipse Marketplace). Normally you can install new software directly via url, but this feature seems to be broken at the moment.
  2. Enter "SonarLint" into the search bar, then press Enter. You will get exactly one result.
  3. Press "Install" on the lower right-hand corner of the SonarLint 3.2.0 search result.
  4. Make sure to accept the license agreement, then SonarLint will be installed.
  5. When prompted, restart Eclipse and SonarLint is installed.

Using SonarLint

There are two ways to use SonarLint: A full report and on-the-fly. For on-the-fly analysis, you need to open the SonarLint On-The-Fly view. You can do this as follows:

  1. Open the View menu (Window -> Show View -> Other...).
  2. Open the SonarLint folder.
  3. Select SonarLint On-The-Fly, then open that View.
  4. A view should open either at the bottom or the sidebar of your current eclipse.
  5. This view will show you flaws in the code of the file you are currently looking at.

The other option is to create a full report on a project. You can do this as follows:

  1. Right-click a project in Eclipse.
  2. Under SonarLint, you can either analyze all the files or only changed ones.
  3. After the report has been created, a SonarLint Report View will open, containing all information about the analyzed project.