Skip to content
Open
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
556af3f
Add Gradle support
May 24, 2020
744308d
level 1-3 I’mplmented
Isaaclhy00 Aug 18, 2022
7448602
level 1-4 Implemented
Isaaclhy00 Aug 21, 2022
1d9771c
Level 1-6 implmented
Isaaclhy00 Aug 21, 2022
093478d
Implemented level 7
Isaaclhy00 Aug 28, 2022
6a5c41e
Implemented Level 8
Isaaclhy00 Aug 28, 2022
ce3cc3f
Merge branch 'add-gradle-support'
Isaaclhy00 Aug 28, 2022
18811a3
Implemented More OOP
Isaaclhy00 Aug 29, 2022
37a9a37
Implemented JUnit
Isaaclhy00 Aug 29, 2022
e132fec
Added JavaDocs
Isaaclhy00 Aug 30, 2022
cbba246
Implemented Find
Isaaclhy00 Aug 30, 2022
06b2bd6
Updated Duke.java
Isaaclhy00 Aug 30, 2022
102f67e
Implemented Checkstyle
Isaaclhy00 Sep 1, 2022
551d08c
Implement JavaFX for GUI
Isaaclhy00 Sep 5, 2022
b56f50e
Implemented Undo
Isaaclhy00 Sep 6, 2022
d967a77
Merge pull request #1 from Isaaclhy00/master
Isaaclhy00 Sep 7, 2022
040feab
Implemented C-Undo
Isaaclhy00 Sep 8, 2022
3e3b504
Merge branch 'branch-A-CodeQuality'
Isaaclhy00 Sep 8, 2022
b834a01
Improved GUI
Isaaclhy00 Sep 14, 2022
1308cd2
Update README.md
Isaaclhy00 Sep 19, 2022
1e8a719
Fix Jar file
Isaaclhy00 Sep 21, 2022
5f7ef7b
Update build.gradle
Isaaclhy00 Sep 21, 2022
c9f2b78
Revert "Update build.gradle"
Isaaclhy00 Sep 21, 2022
2c86ca2
Update build.gradle
Isaaclhy00 Sep 22, 2022
17cd7e5
Update build.gradle
Isaaclhy00 Sep 22, 2022
e1972c2
Updated duke.jar
Isaaclhy00 Sep 22, 2022
9f108f7
Update build.gradle
Isaaclhy00 Sep 22, 2022
9277669
Update build.gradle
Isaaclhy00 Sep 23, 2022
3d8bc33
Update build.gradle
Isaaclhy00 Sep 25, 2022
c198848
Final Version (Fixed jar)
Isaaclhy00 Sep 28, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
plugins {
id 'java'
id 'application'
id 'com.github.johnrengelman.shadow' version '5.1.0'
}

repositories {
mavenCentral()
}

dependencies {
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.5.0'
testRuntimeOnly group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.5.0'
}

test {
useJUnitPlatform()

testLogging {
events "passed", "skipped", "failed"

showExceptions true
exceptionFormat "full"
showCauses true
showStackTraces true
showStandardStreams = false
}
}

application {
mainClassName = "seedu.duke.Duke"
}

shadowJar {
archiveBaseName = "duke"
archiveClassifier = null
}

run{
standardInput = System.in
}
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
5 changes: 5 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
183 changes: 183 additions & 0 deletions gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

103 changes: 103 additions & 0 deletions gradlew.bat

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Empty file added src/main/data/tasks.txt
Empty file.
51 changes: 45 additions & 6 deletions src/main/java/Duke.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,49 @@
import Duke.commands.Command;
import Duke.exceptions.DukeException;
import Duke.parser.Parser;
import Duke.storage.Storage;
import Duke.tasks.TaskList;
import Duke.ui.UI;

import java.time.LocalDate;

public class Duke {

private final Storage storage;
private TaskList tasks;
private final UI ui;

public Duke(String filePath) {
ui = new UI();
storage = new Storage(filePath);
try {
tasks = new TaskList(storage.load());
} catch (DukeException e) {
ui.showLoadingError();
tasks = new TaskList();
}
}

public void run() {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really like how all the detailed functionalities of Duke.run() are abstracted further into classes.

ui.welcomeMessage();
boolean isExit = false;
while (!isExit) {
try {
String fullCommand = ui.readCommand();
ui.showLineBreak();
Command c = Parser.parse(fullCommand);
c.execute(tasks, ui, storage);
isExit = c.isExit();
} catch (DukeException e) {
ui.showError(e.getMessage());
}
finally {
ui.showLineBreak();
}
}
}

public static void main(String[] args) {
String logo = " ____ _ \n"
+ "| _ \\ _ _| | _____ \n"
+ "| | | | | | | |/ / _ \\\n"
+ "| |_| | |_| | < __/\n"
+ "|____/ \\__,_|_|\\_\\___|\n";
System.out.println("Hello from\n" + logo);
new Duke("data/tasks.txt").run();
}
}
Loading