Skip to content
This repository has been archived by the owner on Mar 5, 2023. It is now read-only.

Commit

Permalink
Merge cfa1a0f into db84a6c
Browse files Browse the repository at this point in the history
  • Loading branch information
fzdy1914 committed Apr 11, 2019
2 parents db84a6c + cfa1a0f commit 7f4e47e
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.adoc
Expand Up @@ -35,6 +35,6 @@ endif::[]

* Some parts of this sample application were inspired by the excellent http://code.makery.ch/library/javafx-8-tutorial/[Java FX tutorial] by
_Marco Jakob_.
* Libraries used: https://github.com/TestFX/TestFX[TestFX], https://github.com/FasterXML/jackson[Jackson], https://github.com/junit-team/junit5[JUnit5]
* Libraries used: https://github.com/javafxports/openjdk-jfx[JavaFX], https://github.com/TestFX/TestFX[TestFX], https://github.com/FasterXML/jackson[Jackson], https://github.com/junit-team/junit5[JUnit5]

== Licence : link:LICENSE[MIT]
22 changes: 21 additions & 1 deletion build.gradle
Expand Up @@ -15,7 +15,7 @@ plugins {
}

// Specifies the entry point of the application
mainClassName = 'seedu.address.MainApp'
mainClassName = 'seedu.address.Main'

sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
Expand Down Expand Up @@ -44,6 +44,26 @@ test {
dependencies {
String testFxVersion = '4.0.15-alpha'
String jUnitVersion = '5.1.0'
String javafxVersion = '11'

implementation group: 'org.openjfx', name: 'javafx-base', version: javafxVersion, classifier: 'win'
implementation group: 'org.openjfx', name: 'javafx-base', version: javafxVersion, classifier: 'mac'
implementation group: 'org.openjfx', name: 'javafx-base', version: javafxVersion, classifier: 'linux'
implementation group: 'org.openjfx', name: 'javafx-controls', version: javafxVersion, classifier: 'win'
implementation group: 'org.openjfx', name: 'javafx-controls', version: javafxVersion, classifier: 'mac'
implementation group: 'org.openjfx', name: 'javafx-controls', version: javafxVersion, classifier: 'linux'
implementation group: 'org.openjfx', name: 'javafx-fxml', version: javafxVersion, classifier: 'win'
implementation group: 'org.openjfx', name: 'javafx-fxml', version: javafxVersion, classifier: 'mac'
implementation group: 'org.openjfx', name: 'javafx-fxml', version: javafxVersion, classifier: 'linux'
implementation group: 'org.openjfx', name: 'javafx-graphics', version: javafxVersion, classifier: 'win'
implementation group: 'org.openjfx', name: 'javafx-graphics', version: javafxVersion, classifier: 'mac'
implementation group: 'org.openjfx', name: 'javafx-graphics', version: javafxVersion, classifier: 'linux'
implementation group: 'org.openjfx', name: 'javafx-media', version: javafxVersion, classifier: 'win'
implementation group: 'org.openjfx', name: 'javafx-media', version: javafxVersion, classifier: 'mac'
implementation group: 'org.openjfx', name: 'javafx-media', version: javafxVersion, classifier: 'linux'
implementation group: 'org.openjfx', name: 'javafx-web', version: javafxVersion, classifier: 'win'
implementation group: 'org.openjfx', name: 'javafx-web', version: javafxVersion, classifier: 'mac'
implementation group: 'org.openjfx', name: 'javafx-web', version: javafxVersion, classifier: 'linux'

implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.7.0'
implementation group: 'com.fasterxml.jackson.datatype', name: 'jackson-datatype-jsr310', version: '2.7.4'
Expand Down
2 changes: 1 addition & 1 deletion config/checkstyle/checkstyle.xml
Expand Up @@ -26,7 +26,7 @@
</module>

<module name="SuppressionFilter">
<property name="file" value="config/checkstyle/suppressions.xml"/>
<property name="file" value="${config_loc}/suppressions.xml"/>
</module>


Expand Down
26 changes: 26 additions & 0 deletions src/main/java/seedu/address/Main.java
@@ -0,0 +1,26 @@
package seedu.address;

import javafx.application.Application;

/**
* The main entry point to the application.
*
* This is a workaround for the following error when MainApp is made the
* entry point of the application:
* Error: JavaFX runtime components are missing, and are required to run this application
*
* The reason is that MainApp extends Application. In that case, the
* LauncherHelper will check for the javafx.graphics module to be present
* as a named module. We don't use JavaFX via the module system so it can't
* find the javafx.graphics module, and so the launch is aborted. Hence,
* adding the javafx runtime dependency is not enough in this case.
*
* This is more like a JDK 11 problem which cannot be solved elegantly.
* Workaround this by having a separate main class (Main) that doesn't
* extend Application to be the new entry point of addressbook.
*/
public class Main {
public static void main(String[] args) {
Application.launch(MainApp.class, args);
}
}
6 changes: 1 addition & 5 deletions src/main/java/seedu/address/MainApp.java
Expand Up @@ -32,7 +32,7 @@
import seedu.address.ui.UiManager;

/**
* The main entry point to the application.
* Runs the application.
*/
public class MainApp extends Application {

Expand Down Expand Up @@ -180,8 +180,4 @@ public void stop() {
logger.severe("Failed to save preferences " + StringUtil.getDetails(e));
}
}

public static void main(String[] args) {
launch(args);
}
}

0 comments on commit 7f4e47e

Please sign in to comment.