Skip to content

Development Setup

Dr. Martin Brumm edited this page Mar 31, 2021 · 11 revisions

Development Environment Requirements

You will need:

  • An installed JDK (11+ is supported, 14+ is required to build platform executables)
  • IDE of your choice for development (ie Eclipse, IntelliJ, etc)
  • git (you may be able to avoid this depending on IDE choice)

Optional:

  • gradle (a gradle wrapper is included in the repo but you may also use your own installed version)
  • Slack (see section below)

IDE Support

Eclipse

If you decide to use eclipse for the git repository checkout you'll require the additional installation of egit. In addition you'll need the plugin Maven SCM Handler for Egit if you want to import a maven project directly via git, which makes step one of the following tutorial unnecessary. This tutorial explains how to import the maven project inside the cloned git repository into eclipse.

Step-by-Step setup:

  1. Clone the Rails git repository to your local filesystem
    • This can either be done via eclipse, git directly, or using tools like SourceTree on Windows.
    • The git command is git clone https://github.com/Rails-18xx/Rails.git <local-directory-path>
  2. Create a new clean workspace (File -> Switch Workspace)
  3. Select File -> Import
  4. In the newly opened window select Maven -> Existing Maven Projects and press Next
  5. Now select the folder which you've cloned in step 1 as the Root Directory and press Finish
  6. To test if you can start Rails: Open package net.sf.rails.util in Package Explorer, select class RunGame. Then right click for context menu and choose RunAs => Java Application.

IntelliJ

IntelliJ IDEA has a built-in support of git: Checkout repository under Version Control => Checkout from Version Control => Git.

You can also use the New -> Project within IntelliJ and simply point it at an existing clone of the repo. IntelliJ will automatically pick up the gradle configuration and set the IntelliJ project up correctly.

Command Line

While you will likely use an IDE such as Eclipse or IntelliJ for the actual development, code building can also be performed from the command line by using the built-in Gradle Wrapper or using a locally installed version of Gradle:

For Linux, Mac:

  • ./gradlew build

For Windows:

  • gradle.bat build

Gradle

We use Gradle to perform builds. You may use the Gradle Wrapper included in the repo (ie gradlew or gradlew.bat) or you may install it yourself.

Some of the commonly used tasks:

  • assemble -- compiles the code and creates the jar file (found in build/lib/)
  • build -- compiles, creates jar and runs tests
  • buildDmgPackage -- creates a DMG package/app for a Mac (should only be executed on a Mac)
  • buildExePackage -- creates a standalone EXE for Windows
  • buildRpmPackage -- creates an RPM for Linux
  • buildDebPackage -- creates a Debian package for Debian

Collaboration

We use Slack as communication channel. If you want to discuss things around Rails-18xx development feel free to join us at: https://join.slack.com/t/rails-18xx/shared_invite/zt-ctmyh87p-0FSPRE61UnTie23~ybB6Dg