-
Notifications
You must be signed in to change notification settings - Fork 22
Development Setup
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)
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:
- 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>
- Create a new clean workspace (
File -> Switch Workspace
) - Select
File -> Import
- In the newly opened window select
Maven -> Existing Maven Projects
and pressNext
- Now select the folder which you've cloned in step 1 as the
Root Directory
and pressFinish
- To test if you can start Rails: Open package
net.sf.rails.util
in Package Explorer, select classRunGame
. Then right click for context menu and choose RunAs => Java Application.
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.
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
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
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