Skip to content

Commit

Permalink
fixed gradle
Browse files Browse the repository at this point in the history
  • Loading branch information
ShengXue97 committed Mar 2, 2020
1 parent d98f270 commit 2a10e68
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 24 deletions.
54 changes: 32 additions & 22 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
plugins {
id 'java'
id 'application'
id 'org.openjfx.javafxplugin' version '0.0.7'
id 'checkstyle'
id 'com.github.johnrengelman.shadow' version '5.1.0'
id 'org.openjfx.javafxplugin' version '0.0.7'
}


group 'seedu.duke'
version '0.1.0'

repositories {
mavenCentral()
}

application {
// Change this to your main class.
mainClassName = "duke.Launcher"
Expand All @@ -22,27 +18,41 @@ run {
standardInput = System.in
}

dependencies {
testCompileOnly 'junit:junit:4.12'
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine:5.3.1'
}

test {
useJUnitPlatform()
testLogging {
events "failed"
exceptionFormat "short"
}
}

javafx {
version = "11.0.2"
modules = [ 'javafx.controls', 'javafx.fxml' ]
checkstyle {
toolVersion = '8.23'
}

shadowJar {
archiveBaseName = "duke"
archiveVersion = "0.1.3"
archiveClassifier = null
archiveAppendix = null
}

repositories {
mavenCentral()
}

dependencies {
String javaFxVersion = '11'

testImplementation 'org.junit.jupiter:junit-jupiter:5.5.0'

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'
}


test {
useJUnitPlatform()
}
2 changes: 1 addition & 1 deletion src/main/java/duke/Duke.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
/**
* A GUI for Duke using FXML.
*
*
*
*/
public class Duke extends Application {

Expand Down
3 changes: 2 additions & 1 deletion src/main/java/duke/MainWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ public void initialize() {
dialogContainer.prefWidthProperty().bind(scrollPane.widthProperty());
UI.UIString = "";
taskList = new TaskList();
storage = new Storage("tasks.txt", taskList);
String filePath = "./data/dukeStorage.txt";
storage = new Storage(filePath, taskList);
ui = new UI();

storage.readFromFile();
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/duke/tool/Storage.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,16 @@ public class Storage {
*/
public Storage(String filePath, TaskList taskList) {
this.filePath = filePath;
try {
File taskFile = new File("data/dukeStorage.txt");
if (!taskFile.exists()) {
taskFile.getParentFile().mkdirs();
taskFile.createNewFile();
}
} catch (Exception e) {
e.printStackTrace();
}

this.taskList = taskList;
}

Expand Down

0 comments on commit 2a10e68

Please sign in to comment.