Skip to content

Commit

Permalink
Merge AB-4 'Migrate to JDK 11+'
Browse files Browse the repository at this point in the history
* commit '10586cb7fa6af793bf274fa58f5d667ab4d0caa8':
  Upgrade to JDK 11
  Workaround coveralls upload failure on Travis CI
  Workaround headless test failure on Windows OS
  build.gradle: add javafx runtime dependency for all platforms
  Change the entry point of addressbook
  build.gradle: add platform-specific javafx runtime dependencies
  build.gradle: fix checkstyle plugin failure
  • Loading branch information
pyokagan committed May 3, 2019
2 parents 259dc30 + 10586cb commit e27c81b
Show file tree
Hide file tree
Showing 10 changed files with 62 additions and 32 deletions.
7 changes: 1 addition & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
language: java
matrix:
include:
- jdk: oraclejdk8
- jdk: oraclejdk11

script: >-
./config/travis/run-checks.sh &&
Expand All @@ -14,11 +14,6 @@ deploy:
on:
branch: master

addons:
apt:
packages:
- oracle-java8-installer

before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
Expand Down
2 changes: 1 addition & 1 deletion README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,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/FasterXML/jackson[Jackson], https://junit.org/junit4/[JUnit4]
* Libraries used: https://openjfx.io/[JavaFX], https://github.com/FasterXML/jackson[Jackson], https://github.com/junit-team/junit5[JUnit5]

== Licence : link:LICENSE[MIT]
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ test_script:
- gradlew.bat --no-daemon test

environment:
JAVA_HOME: C:\Program Files\Java\jdk1.8.0 # Use 64-bit Java
JAVA_HOME: C:\Program Files\Java\jdk11 # Use 64-bit Java

# Files/folders to preserve between builds to speed them up
cache:
Expand Down
26 changes: 23 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ 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
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11

repositories {
mavenCentral()
Expand All @@ -43,6 +43,26 @@ test {

dependencies {
String jUnitVersion = '5.4.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
Original file line number Diff line number Diff line change
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
13 changes: 4 additions & 9 deletions docs/DeveloperGuide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,7 @@ By: `Team SE-EDU`      Since: `Jun 2016`      Licence: `MIT`

=== Prerequisites

. *JDK `8`* (revision `1.8.0_201` or later)
+
[NOTE]
Only JDK 8 is supported. +
This app will not work with later major JDK releases such as JDK 9, 10, 11, etc.
+
. *JDK `11`* or above
. *IntelliJ* IDE
+
[NOTE]
Expand All @@ -49,7 +44,7 @@ This will generate all resources required by the application and tests.

=== Verifying the setup

. Run the `seedu.address.MainApp` and try a few commands
. Run the `seedu.address.Main` and try a few commands
. <<Testing,Run the tests>> to ensure they all pass.

=== Configurations to do before writing code
Expand Down Expand Up @@ -111,7 +106,7 @@ The *_Architecture Diagram_* given above explains the high-level design of the A
[TIP]
The `.pptx` files used to create diagrams in this document can be found in the link:{repoURL}/docs/diagrams/[diagrams] folder. To update a diagram, modify the diagram in the pptx file, select the objects of the diagram, and choose `Save as picture`.

`Main` has only one class called link:{repoURL}/src/main/java/seedu/address/MainApp.java[`MainApp`]. It is responsible for,
`Main` has two classes called link:{repoURL}/src/main/java/seedu/address/Main.java[`Main`] and link:{repoURL}/src/main/java/seedu/address/MainApp.java[`MainApp`]. It is responsible for,

* At app launch: Initializes the components in the correct sequence, and connects them up with each other.
* At shut down: Shuts down the components and invokes cleanup method where necessary.
Expand Down Expand Up @@ -868,7 +863,7 @@ _{More to be added}_
[appendix]
== Non Functional Requirements

. Should work on any <<mainstream-os,mainstream OS>> as long as it has Java `8` (revision `1.8.0_201` or higher) installed.
. Should work on any <<mainstream-os,mainstream OS>> as long as it has Java `11` or above installed.
. Should be able to hold up to 1000 persons without a noticeable sluggishness in performance for typical usage.
. A user with above average typing speed for regular English text (i.e. not code, not system admin commands) should be able to accomplish most of the tasks faster using commands than using the mouse.

Expand Down
7 changes: 1 addition & 6 deletions docs/UserGuide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,7 @@ AddressBook Level 3.5 (AB3.5) is for those who *prefer to use a desktop app for

== Quick Start

. Ensure you have Java `8` (revision `1.8.0_201` or later) installed in your Computer.
+
[NOTE]
Only Java 8 is supported. +
This app will not work with later major Java releases such as Java 9, 10, 11, etc.
+
. Ensure you have Java `11` or above installed in your Computer.
. Download the latest `addressbook.jar` link:{repoURL}/releases[here].
. Copy the file to the folder you want to use as the home folder for your Address Book.
. Double-click the file to start the app. The GUI should appear in a few seconds.
Expand Down
4 changes: 4 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
org.gradle.parallel=false
org.gradle.jvmargs=-XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -Xmx1024m -Dfile.encoding=utf-8

# TODO: This is a workaround for a JDK11 bug which causes test coverage upload to fail.
# Remove it when https://bugs.openjdk.java.net/browse/JDK-8221253 is fixed.
systemProp.jdk.tls.client.protocols="TLSv1,TLSv1.1,TLSv1.2"
25 changes: 25 additions & 0 deletions src/main/java/seedu/address/Main.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
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.
*
* By having a separate main class (Main) that doesn't extend Application
* to be the entry point of the application, we avoid this issue.
*/
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
Original file line number Diff line number Diff line change
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 e27c81b

Please sign in to comment.