Skip to content

Commit 3415668

Browse files
authored
Merge pull request #131 from leowyh/master
fixed bug where txt file could not be found in jar
2 parents 7b98143 + bf708d0 commit 3415668

13 files changed

+565
-80
lines changed

build.gradle

+9-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ checkstyle {
1111
}
1212

1313
shadowJar {
14-
archiveBaseName = "AlphaNUS"
14+
archiveBaseName = "alphanus"
1515
archiveVersion = "0.1.3"
1616
archiveClassifier = null
1717
archiveAppendix = null
@@ -45,4 +45,12 @@ test {
4545
javafx {
4646
version = "11.0.2"
4747
modules = [ 'javafx.controls', 'javafx.fxml' ]
48+
}
49+
50+
sourceSets {
51+
main {
52+
resources {
53+
srcDirs = ['src/main/java/']
54+
}
55+
}
4856
}

data/duke.txt

+99
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
2+
delete payee p/payee | 24-10-2019 22:51:48
3+
add project pr/RAG | 25-10-2019 10:11:29
4+
goto project pr/RAG | 25-10-2019 10:11:52
5+
delete project pr/RAG | 25-10-2019 10:12:09
6+
add project pr/RAG | 25-10-2019 10:20:32
7+
add project pr/FLAG | 25-10-2019 10:20:57
8+
goto project pr/RAG | 25-10-2019 10:21:13
9+
add project pr/RAG | 25-10-2019 10:23:11
10+
add project pr/flag | 25-10-2019 10:23:26
11+
add project pr/rag | 25-10-2019 10:25:05
12+
add project pr/flag | 25-10-2019 10:25:13
13+
add payee p/payeename e/email m/matricnum ph/999 | 25-10-2019 10:28:51
14+
add payment p/payeename i/itemname c/9.99 v/invoice d/deadline | 25-10-2019 10:29:34
15+
add project pr/rag | 27-10-2019 21:35:12
16+
add project pr/flag | 27-10-2019 21:35:18
17+
add project pr/rag | 27-10-2019 21:48:37
18+
add project pr/flag | 27-10-2019 21:49:40
19+
delete project pr/rag | 27-10-2019 21:49:56
20+
add project pr/rag | 27-10-2019 21:50:04
21+
add project pr/rag | 27-10-2019 21:57:10
22+
add project flag | 27-10-2019 21:57:14
23+
add project pr/rag | 27-10-2019 21:57:35
24+
add project pr/flag | 27-10-2019 21:57:39
25+
delete project pr/rag | 27-10-2019 21:58:01
26+
set fund am/200 | 28-10-2019 16:55:00
27+
set fund am/200 | 28-10-2019 16:56:13
28+
set fund am/200 | 28-10-2019 16:57:40
29+
add fund add/400 | 28-10-2019 16:57:47
30+
add project pr/ | 28-10-2019 00:28:47
31+
add project | 28-10-2019 00:41:24
32+
add project pr/ | 28-10-2019 00:41:43
33+
delete project | 28-10-2019 00:44:48
34+
add project pr/ | 28-10-2019 00:48:01
35+
add project pr/ | 28-10-2019 00:49:33
36+
add project pr/ rqew | 28-10-2019 00:49:43
37+
add project pr/rag | 28-10-2019 00:57:56
38+
add project pr/rag | 28-10-2019 00:58:01
39+
add project pr/rag | 28-10-2019 01:13:17
40+
add project pr/rag | 28-10-2019 01:13:21
41+
add project pr/RAG | 28-10-2019 01:13:29
42+
add project pr/ | 28-10-2019 01:13:43
43+
add project pr/asd | 28-10-2019 01:13:53
44+
delete project pr/ | 28-10-2019 01:14:04
45+
delete project pr/ flag | 28-10-2019 01:14:18
46+
delete project pr/ rag | 28-10-2019 01:14:28
47+
goto project pr/rag | 28-10-2019 01:18:50
48+
add project pr/rag | 28-10-2019 01:23:04
49+
add project pr/flag | 28-10-2019 01:23:11
50+
goto project pr/rag | 28-10-2019 01:23:19
51+
goto project pr/flag | 28-10-2019 01:27:26
52+
goto project pr/ | 28-10-2019 01:27:51
53+
goto project pr/ flag | 28-10-2019 01:27:59
54+
goto project pr/ flag | 28-10-2019 01:30:07
55+
add project pr/ rag | 28-10-2019 01:31:43
56+
goto project pr/ | 28-10-2019 01:31:48
57+
goto project pr/ rg | 28-10-2019 01:31:58
58+
add project pr/rag | 29-10-2019 17:21:21
59+
add project pr/flag | 29-10-2019 17:21:26
60+
goto project pr/rag | 29-10-2019 17:21:44
61+
goto project pr/flag | 29-10-2019 17:21:49
62+
delete project pr/rag | 29-10-2019 17:22:10
63+
add project pr/rag | 29-10-2019 17:46:53
64+
add project pr/flag | 29-10-2019 17:46:56
65+
goto project pr/rag | 29-10-2019 17:47:10
66+
add payment p/yh i/toy c/10000.00 v/a102312 | 29-10-2019 17:47:20
67+
add payee p/yh e/e013021@qweqcc m/A123012 ph/1929929 | 29-10-2019 17:48:04
68+
add payment p/yh i/toy c/10000.00 v/a102312 | 29-10-2019 17:48:12
69+
goto project pr/flag | 29-10-2019 17:48:34
70+
goto project pr/rag | 29-10-2019 17:48:41
71+
add project pr/trial | 29-10-2019 01:25:07
72+
set fund am/200 | 29-10-2019 01:25:37
73+
add fund add/200 | 29-10-2019 01:26:07
74+
assign fund p/trial am/300 | 29-10-2019 01:26:27
75+
76+
77+
add project pr/PROJECT_NAME ~ 31-10-2019 15:35:44
78+
add project pr/ag ~ 31-10-2019 15:35:49
79+
goto project pr/PROJECT_NAME ~ 31-10-2019 15:36:01
80+
assign fund p/trial am/300 | 29-10-2019 01:26:27 ~ 31-10-2019 16:05:10
81+
assign fund p/trial am/300 ~ 31-10-2019 16:05:21
82+
add project pr/Rag ~ 31-10-2019 16:06:34
83+
assign fund p/Rag am/300 ~ 31-10-2019 16:06:58
84+
add project pr/rag ~ 31-10-2019 16:29:35
85+
add payee p/yh e/lqwe@asda m/a100203 ph/0999123 ~ 31-10-2019 16:30:08
86+
add payee p/yh e/lqwe@asda m/a100203 ph/0999123 ~ 31-10-2019 16:30:29
87+
goto project pr/rag ~ 31-10-2019 16:31:02
88+
add payee p/yh e/lqwe@asda m/a100203 ph/0999123 ~ 31-10-2019 16:31:09
89+
list ~ 31-10-2019 16:31:28
90+
add payment p/yh i/toy c/10000.00 v/a102312 ~ 31-10-2019 16:34:13
91+
add payee p/yh e/e013021@qweqcc m/A123012 ph/1929929 ~ 31-10-2019 16:34:19
92+
add project pr/rag ~ 31-10-2019 16:36:17
93+
add payee p/yh e/e013021@qweqcc m/A123012 ph/1929929 ~ 31-10-2019 16:36:24
94+
add payment p/yh i/toy c/10000.00 v/a102312 ~ 31-10-2019 16:36:29
95+
96+
97+
assign fund p/Rag am/300 ~ 31-10-2019 16:40:14
98+
add project pr/PROJECT_NAME ~ 31-10-2019 16:40:32
99+
assign fund p/PROJECT_NAME am/300 ~ 31-10-2019 16:40:48

docs/DeveloperGuide.adoc

+18-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ ifdef::env-github[]
1212
:note-caption: :information_source:
1313
:warning-caption: :warning:
1414
endif::[]
15-
:repoURL: https://github.com/se-edu/addressbook-level3/tree/master
15+
:repoURL: https://github.com/AY1920S1-CS2113T-F10-3/main/blob/master
1616

1717
By: `AY1920S1-CS2113T-F10-3` Since: `Aug 2019` Licence: `NUS`
1818

@@ -298,7 +298,23 @@ Step 4: The user exit AlphaNUS through `bye` command. When he relaunch the appli
298298

299299
== Dev Ops
300300

301-
{To be added}
301+
=== Build Automation
302+
303+
See <<UsingGradle#, UsingGradle.adoc>> to learn how to use Gradle for build automation.
304+
305+
=== Continuous Integration
306+
307+
We use https://travis-ci.org/[Travis CI] to perform _Continuous Integration_ on our projects. See <<UsingTravis#, UsingTravis.adoc>> for more details.
308+
309+
=== Making a Release
310+
311+
Here are the steps to create a new release.
312+
313+
. Update the version number in link:{repoURL}/build.gradle[`build.gradle`].
314+
. Generate a JAR file <<UsingGradle#creating-the-jar-file, using Gradle>>.
315+
. Tag the repo with the version number. e.g. `v0.1`
316+
. https://help.github.com/articles/creating-releases/[Create a new release using GitHub] and upload the JAR file you created.
317+
302318

303319
[appendix]
304320
== Product Scope

docs/UserGuide.adoc

+38-8
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ may find it a chore to keep up to date with their finances.
3232

3333
. Some example commands you can try:
3434

35-
* *`list`* : lists all submission deadlines
36-
* **`delete`**`3` : deletes the 3rd task shown in the current list
37-
* *`bye`* : exits the app
35+
* `add project pr/rag` : Adds a project called `rag` to the record.
36+
* `list projects`: Lists all projects in the record.
37+
* `bye` : exits the app
3838

3939
. Refer to <<Features>> for details of each command.
4040

@@ -52,6 +52,14 @@ may find it a chore to keep up to date with their finances.
5252
5353
====
5454

55+
=== Command Help: `help`
56+
Lists all available commands of AlphaNUS. +
57+
Format: `help`
58+
59+
Examples:
60+
61+
* `help`
62+
5563
=== Adding a project: `add project`
5664
Adds a project called `PROJECT_NAME` to the record. +
5765
Format: `add project pr/PROJECT_NAME`
@@ -149,8 +157,8 @@ You may not add a new `PAYEE` if a payee named `PAYEE` already exists.
149157

150158
Examples:
151159

152-
* GOOD: `payments p/John Doe i/Welcome Tea c/12.00 v/INV-001`
153-
* BAD: `payments p/John Doe i/Welcome Tea c/*$*12.00 v/INV-001`
160+
* GOOD: `add payee p/John Doe e/johndoe@u.nus.edu m/A0112301A ph/999`
161+
* BAD: `add payee pR/John Doe e/johndoe@u.nus.edu m/A0112301A ph/999`
154162

155163
=== Adding a new payment: `add payment`
156164

@@ -164,8 +172,8 @@ You may use more than one word for all fields except `COST`.
164172

165173
Examples:
166174

167-
* GOOD: `payments p/John Doe i/Welcome Tea c/12.00 v/INV-001`
168-
* BAD: `payments p/John Doe i/Welcome Tea c/*$*12.00 v/INV-001`
175+
* GOOD: `add payment p/John Doe i/Welcome Tea c/12.00 v/INV-001`
176+
* BAD: `add payment p/John Doe i/Welcome Tea c/*$*12.00 v/INV-001`
169177

170178

171179
=== Edit the payment details: `edit`
@@ -340,4 +348,26 @@ There is no need to save manually.
340348

341349
== Command Summary
342350

343-
// this part will be done later when all features are finalized
351+
352+
* *Command Help*: `help`
353+
* *Add Project*: `add project pr/PROJECT_NAME`
354+
* *Delete Project*: `delete project pr/PROJECT_NAME`
355+
* *Go to Project*: `goto project pr/PROJECT_NAME`
356+
* *List Projects*: `list projects`
357+
* *Add Payee*: `add payee p/PAYEE e/EMAIL m/MATRICNUM ph/PHONENUM`
358+
* *Add Payment*: `add payment p/PAYEE i/ITEM c/COST v/INVOICE`
359+
* *list*: `list`
360+
* *deadline*: `deadline d/DESCRIPTION`
361+
* *invoice*: `invoice ID i/INVOICE_number`
362+
* *reminder*: `reminder`
363+
* *edit* : `edit ID d/NEW_DESCRIPTION`
364+
* *snooze*: `snooze ID`
365+
* *payments* : `payments d/DESCRIPTION [p/PAYMENT_DETAIL]...`
366+
* *redetail*: `redetail ID [d/PAYMENT_DETAIL]...`
367+
* *find* : `find d/DESCRIPTION`
368+
* *view* : `view t/DATE`
369+
* *delete* : `delete ID`
370+
* *approve*: `approve ID [m/MESSAGE]`
371+
* *exit*: `bye`
372+
373+

docs/UsingGradle.adoc

+99
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
= Using Gradle
2+
:site-section: DeveloperGuide
3+
:imagesDir: images
4+
:stylesDir: stylesheets
5+
:experimental:
6+
ifdef::env-github[]
7+
:tip-caption: :bulb:
8+
:note-caption: :information_source:
9+
endif::[]
10+
11+
https://gradle.org/[Gradle] is a build automation tool. It can automate build-related tasks such as
12+
13+
* Running tests
14+
* Managing library dependencies
15+
* Analyzing code for style compliance
16+
17+
The gradle configuration for this project is defined in the _build script_ link:../build.gradle[`build.gradle`].
18+
19+
[NOTE]
20+
To learn more about gradle build scripts, refer https://docs.gradle.org/current/userguide/tutorial_using_tasks.html[Build Scripts Basics].
21+
22+
== Running Gradle Commands
23+
24+
To run a Gradle command, open a command window on the project folder and enter the Gradle command. Gradle commands look like this:
25+
26+
* On Windows: `gradlew <task1> <task2> ...` e.g. `gradlew clean test`
27+
* On Mac/Linux: `./gradlew <task1> <task2>...` e.g.
28+
`./gradlew clean test`
29+
30+
[NOTE]
31+
If you do not specify any tasks, Gradlew will run the default tasks `clean` `test` `coverage`
32+
33+
== Cleaning the Project
34+
35+
* *`clean`* +
36+
Deletes the files created during the previous build tasks (e.g. files in the `build` folder). e.g. `./gradlew clean`
37+
38+
[TIP]
39+
*`clean` to force Gradle to execute a task*: +
40+
When running a Gradle task, Gradle will try to figure out if the task needs running at all. If Gradle determines that the output of the task will be same as the previous time, it will not run the task. For example, it will not build the JAR file again if the relevant source files have not changed since the last time the JAR file was built. If we want to force Gradle to run a task, we can combine that task with `clean`. Once the build files have been `clean` ed, Gradle has no way to determine if the output will be same as before, so it will be forced to execute the task.
41+
42+
== Creating the JAR file
43+
44+
* *`shadowJar`* +
45+
Creates the `addressbook.jar` file in the `build/jar` folder, _if the current file is outdated_. +
46+
e.g. `./gradlew shadowJar`
47+
48+
****
49+
To force Gradle to create the JAR file even if the current one is up-to-date, you can '`clean`' first. +
50+
e.g. `./gradlew clean shadowJar`
51+
****
52+
53+
[NOTE]
54+
*Why do we create a fat JAR?* If we package only our own class files into the JAR file, it will not work properly unless the user has all the other JAR files (i.e. third party libraries) our classes depend on, which is rather inconvenient. Therefore, we package all dependencies into a single JAR files, creating what is also known as a _fat_ JAR file. To create a fat JAR file, we use the Gradle plugin https://github.com/johnrengelman/shadow[shadow jar].
55+
56+
== Rendering AsciiDoc files
57+
58+
* **`asciidoctor`** +
59+
Converts AsciiDoc files in `docs` to HTML format. Generated HTML files can be found in `build/docs`.
60+
* **`deployOfflineDocs`** +
61+
Updates the offline user guide, and its associated files, used by the Help window in the application. Deployed HTML files and images can be found in `src/main/resources/docs`.
62+
63+
== Running the application
64+
65+
* *`run`* +
66+
Builds and runs the application.
67+
* *`runShadow`* +
68+
Builds the application as a fat JAR, and then runs it.
69+
70+
== Running code style checks
71+
72+
* **`checkstyleMain`** +
73+
Runs the code style check for the main code base
74+
* **`checkstyleTest`** +
75+
Runs the code style check for the test code base
76+
77+
The set of code style rules implemented can be found in `config/checkstyle/checkstyle.xml`. To enable _exceptions_ to code styles, add in the comment `//CODESTYLE.OFF: RuleName` at the start of the section and `//CODESTYLE.ON: RuleName` at the end of the section.
78+
79+
== Running Tests
80+
81+
* **`test`** +
82+
Runs all tests.
83+
84+
Here are some examples:
85+
86+
* `./gradlew test` -- Runs all tests
87+
* `./gradlew clean test` -- Cleans the project and runs tests
88+
89+
== Updating Dependencies
90+
91+
There is no need to run these Gradle tasks manually as they are called automatically by other relevant Gradle tasks.
92+
93+
* **`compileJava`** +
94+
Checks whether the project has the required dependencies to compile and run the main program, and download any missing dependencies before compiling the classes. +
95+
See `build.gradle` ->
96+
`allprojects` -> `dependencies` -> `compile` for the list of dependencies required.
97+
* **`compileTestJava`** +
98+
Checks whether the project has the required dependencies to perform testing, and download any missing dependencies before compiling the test classes. +
99+
See `build.gradle` -> `allprojects` -> `dependencies` -> `testCompile` for the list of dependencies required.

0 commit comments

Comments
 (0)