Skip to content

Getting Started Developing

Li Song edited this page Jan 28, 2023 · 10 revisions

First of all, thank you for considering contributing to LSML!

Install a JDK

Please install a compliant JDK for Java 17 and make sure you set the JAVA_HOME environment variable to point to where you installed java.

Getting the Source

It's your choice to use the GitHub application to manage your source code or use git directly from the command line.

Since you're contributing you will need to fork the main repo, do your work in the fork and create a pull-request. See GitHub: Contributing to Projects.

Always remember that you need to pull from upstream to your fork, and then pull from your fork to get upstream changes before starting to work on a new issue.

Make sure you can run from source

LSML uses Gradle and contains a hermetic wrapper for it. All that is needed to compile and run LSML from source is a correctly configured JDK and a terminal (Windows CMD will do, but Powershell is recommended, or any Linux/Mac shell).

  • Under Powershell/CMD: .\gradlew.bat run
  • Under Linux/Mac: ./gradlew run

Below I will use ./gradlew, please replace with .\gradlew.bat if running under Powershell/CMD.

If this doesn't work, then probably your Java environment isn't set up properly. Make sure that java is on your PATH and make sure that JAVA_HOME is set.

Installing the IDE

It's highly recommended that you use IntelliJ IDEA as your IDE. Although you can use any IDE you like, the intgrations of gradle plugins etc are only tested on IntelliJ IDEA which is considered the "blessed" editor. The rest of this document assumes you're using IntelliJ IDEA, if not it's up to you to adapt the instructions :)

Setting up the IDE

Import the LSML source code as a Gradle project into IntelliJ IDEA and then install and enable the google-java-format plugin for the LSML project.

Make sure that encoding is set to UTF-8 for all files and set the spellchecker to British English and add the custom dictionary from intellij-dictionary.dic to the project in IntelliJ to get rid of angry green squigglies under MWO terms.

Make sure that you can build and run LSML from the IDE. The class to launch is: org.lisoft.lsml.view_fx.LiSongMechLab

Congratulations! You're all done to start developing. Check out the Style Guide and hop on over to Contributing to create your first fix!

Other useful Software/Links

  • Scenebuilder WYSIWYG editor for FXML UI files. I really recommend this if you're going to fidget with the UI.
  • ScenicView Inspect the node structure and CSS classes of any running JavaFX application.
  • WixToolset Needed only if you plan on building installers.
  • modena.css the base CSS stylesheet that defines a lot of theming rules for CSS.
  • JavaFX CSS Reference Helpful when theming.