Code Monkey home page Code Monkey logo

javafx-template's Introduction

JavaFX Opinionated Application Template

Build Status

  • Created for JDK 17+, with Java 9 modules support
  • Multi-module Maven project by default
  • Sass used instead of CSS
  • assertJ and jUnit 5 used for unit testing
  • TestFX used for integration testing
  • Example GitHub action that builds the project and runs integration tests in headless mode

How to run application

./mvnw javafx:run -pl gui

How to rebuild .css files from .scss

./mvnw nl.geodienstencentrum.maven:sass-maven-plugin:update-stylesheets -pl gui

How to watch for SCSS changes and regenerate them when they change

fswatch --exclude='.*' --include='.*[.]scss$' --print0 . | while read -d "" event; do
    ./mvnw nl.geodienstencentrum.maven:sass-maven-plugin:update-stylesheets -pl gui 
done

You need to install fswatch command for this to work.

How to generate jlink image

./mvnw javafx:jlink -pl gui 

You can now send ./gui/target/gui.zip to your friends ๐ŸŽ‰

How to run integration tests (TestFX)

./mvnw verify -Dskip.integration.tests=false -Dskip.unit.tests=true

How to run single integration test

./mvnw clean verify -Dskip.integration.tests=false -Dskip.unit.tests=true \
    -pl gui -Dit.test=MainWindowIT

How to run integration tests in the headless mode

_JAVA_OPTIONS="-Djava.awt.headless=true \
-Dtestfx.robot=glass \
-Dtestfx.headless=true \
-Dprism.order=sw \
-Dprism.verbose=true" ./mvnw verify -Dskip.integration.tests=false -pl gui 

On macOS you must allow IntelliJ or the terminal app that you are using, to "take over your computer": macOS settings needed for IT

javafx-template's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.