- Add Increments as parallel branches:
Level-6
,Level-7
- Add Increment:
A-Jar
1 Add Increments as parallel branches: Level-6
, Level-7
- Practice using parallel git branches, as explained below:
- First, do Level-6 in a branch named
branch-Level-6
, but do not merge it. - Then, go back to the
master
branch and implement Level-7 in a separate branch namedbranch-Level-7
. - Now, go back to the
master
branch and merge the two branches one after the other.
If there are merge conflicts, you'll have to resolve them first. - As before, tag the commit (in the
master
branch, after merging) that achieves the respective deliverable, and push to your fork.
- First, do Level-6 in a branch named
- As before,
Merge without a fast-forward so that git creates a separate commit for the merge.
Remember to push the branches to your fork so that the bot can detect them.
Advanced git users: do not delete the branch after merging.
Level-6
: Delete
Level 6. Delete
Add support for deleting tasks from the list.
Example:
list
____________________________________________________________
Here are the tasks in your list:
1.[T][✓] read book
2.[D][✓] return book (by: June 6th)
3.[E][✗] project meeting (at: Aug 6th 2-4pm)
4.[T][✓] join sports club
5.[T][✗] borrow book
____________________________________________________________
delete 3
____________________________________________________________
Noted. I've removed this task:
[E][✗] project meeting (at: Aug 6th 2-4pm)
Now you have 4 tasks in the list.
____________________________________________________________
Level-7
: Save
Level 7. Save
Save the tasks in the hard disk automatically whenever the task list changes. Load the data from the hard disk when Duke starts up. You may hard-code the file name and location e.g., [project_root]/data/duke.txt
The format of the file is up to you. Example:
T | 1 | read book
D | 0 | return book | June 6th
E | 0 | project meeting | Aug 6th 2-4pm
T | 1 | join sports club
If you use file paths in your code,
- remember to use relative paths rather than absolute paths such as
C:\data
. If not, your app can cause unpredictable results when used in another computer. - remember to specify file paths in an OS-independent way. If not, your app might not work when used on a different OS.
Your code must handle the case where the file doesn't exist at the start. Reason: when someone else takes your Duke and runs it for the first time, the required file might not exist in their computer. Similarly, if you expect the data file to be in as specific folder (e.g., ./data/
), you must also handle the 'folder does not exist yet' case.
2 Add Increment: A-Jar
- In case this increment does not require any code changes, you may tag the commit at which this was achieved as
A-Jar
(even if that commit has another tag already). - Upload the jar file to your fork as explained in the panel below. You can ignore the point about using Gradle.
A-Jar
: Create a JAR File Package the app as an executable JAR file so that it can be distributed easily.
You can assume the user will run the jar file in the following way only:
- Copy the jar file into an empty folder
- Open a command window in that folder
- Run the command
java -jar {filename}.jar
e.g.,java -jar Duke.jar
(i.e., run the command in the same folder as the jar file)
Do not commit the JAR file created. Instead, you can make the JAR file available in the following manner.
- Go to your fork on GitHub and create a new release.
- In the page where you fill the details of th release,
- give an appropriate version number e.g.,
v0.1
- attach the JAR file where it says
Attach binaries by dropping them ...
.
- give an appropriate version number e.g.,
If you are using Gradle for your project, refer to the Gradle tutorial at the Duke repo (i.e., the repo you forked from) to find how to create a jar file using Gradle.
Extension A-Gradle
Use Gradle to automate some of the build tasks of the project. Refer to the Gradle tutorial at the Duke repo (i.e., the repo you forked from) to find how to set up Gradle for your project.
- Minimal: Set up gradle so that you can build and run Duke using gradle.
- Recommended: Set up gradle to run unit tests.
- Stretch Goal: Use gradle to automate more things in your project.