-
Notifications
You must be signed in to change notification settings - Fork 452
[Isaac] iP #496
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Isaaclhy00
wants to merge
30
commits into
nus-cs2103-AY2223S1:master
Choose a base branch
from
Isaaclhy00:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
[Isaac] iP #496
Changes from 9 commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
556af3f
Add Gradle support
744308d
level 1-3 I’mplmented
Isaaclhy00 7448602
level 1-4 Implemented
Isaaclhy00 1d9771c
Level 1-6 implmented
Isaaclhy00 093478d
Implemented level 7
Isaaclhy00 6a5c41e
Implemented Level 8
Isaaclhy00 ce3cc3f
Merge branch 'add-gradle-support'
Isaaclhy00 18811a3
Implemented More OOP
Isaaclhy00 37a9a37
Implemented JUnit
Isaaclhy00 e132fec
Added JavaDocs
Isaaclhy00 cbba246
Implemented Find
Isaaclhy00 06b2bd6
Updated Duke.java
Isaaclhy00 102f67e
Implemented Checkstyle
Isaaclhy00 551d08c
Implement JavaFX for GUI
Isaaclhy00 b56f50e
Implemented Undo
Isaaclhy00 d967a77
Merge pull request #1 from Isaaclhy00/master
Isaaclhy00 040feab
Implemented C-Undo
Isaaclhy00 3e3b504
Merge branch 'branch-A-CodeQuality'
Isaaclhy00 b834a01
Improved GUI
Isaaclhy00 1308cd2
Update README.md
Isaaclhy00 1e8a719
Fix Jar file
Isaaclhy00 5f7ef7b
Update build.gradle
Isaaclhy00 c9f2b78
Revert "Update build.gradle"
Isaaclhy00 2c86ca2
Update build.gradle
Isaaclhy00 17cd7e5
Update build.gradle
Isaaclhy00 e1972c2
Updated duke.jar
Isaaclhy00 9f108f7
Update build.gradle
Isaaclhy00 9277669
Update build.gradle
Isaaclhy00 3d8bc33
Update build.gradle
Isaaclhy00 c198848
Final Version (Fixed jar)
Isaaclhy00 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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() { | ||
| 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(); | ||
| } | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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.