diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml new file mode 100644 index 0000000000..eb1e6dccda --- /dev/null +++ b/.github/workflows/gradle.yml @@ -0,0 +1,40 @@ +name: Java CI + +on: [push, pull_request] + +jobs: + build: + strategy: + matrix: + platform: [ubuntu-latest, macos-latest, windows-latest] + runs-on: ${{ matrix.platform }} + + steps: + - + name: Set up repository + uses: actions/checkout@master + + - + name: Set up repository + uses: actions/checkout@master + with: + ref: master + + - + name: Merge to master + run: git checkout --progress --force ${{ github.sha }} + + - + name: Validate Gradle Wrapper + uses: gradle/wrapper-validation-action@v1 + + - + name: Set up JDK 11 + uses: actions/setup-java@v1 + with: + java-version: '11' + java-package: jdk+fx + + - + name: Build and check with Gradle + run: ./gradlew check diff --git a/.gitignore b/.gitignore index 2873e189e1..bdd4f199d9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,17 +1,9 @@ -# IDEA files -/.idea/ -/out/ -/*.iml +# Gradle +.gradle/ +build/ -# Gradle build files -/.gradle/ -/build/ -src/main/resources/docs/ - -# MacOS custom attributes files created by Finder -.DS_Store -*.iml +# VSCode bin/ -/text-ui-test/ACTUAL.TXT -text-ui-test/EXPECTED-UNIX.TXT +# App +data/ diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000000..1073eab020 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,10 @@ +{ + "editor.insertSpaces": true, + "editor.detectIndentation": false, + "editor.tabSize": 4, + "java.checkstyle.configuration": "${workspaceFolder}\\config\\checkstyle\\checkstyle.xml", + "java.checkstyle.version": "10.2", + "java.checkstyle.properties": { + "config_loc": "${workspaceFolder}\\config\\checkstyle\\" + } +} diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md deleted file mode 100644 index 8e359a0145..0000000000 --- a/CONTRIBUTORS.md +++ /dev/null @@ -1,9 +0,0 @@ -# Contributors - -Display | Name | Github Profile | Homepage ----|:---:|:---:|:---: -![](https://avatars0.githubusercontent.com/u/22460123?s=100) | Jeffry Lum | [Github](https://github.com/j-lum/) | [Homepage](https://se.kasugano.moe) -![](https://avatars0.githubusercontent.com/u/1673303?s=100) | Damith C. Rajapakse | [Github](https://github.com/damithc/) | [Homepage](https://www.comp.nus.edu.sg/~damithch/) -# I would like to join this list. How can I help the project - -For more information, please refer to our [contributor's guide](https://oss-generic.github.io/process/). diff --git a/README.md b/README.md index 8715d4d915..256977e3a1 100644 --- a/README.md +++ b/README.md @@ -1,24 +1,7 @@ -# Duke project template +# The Cloud Chatbot -This is a project template for a greenfield Java project. It's named after the Java mascot _Duke_. Given below are instructions on how to use it. +This is a chatbot named **Cloud**. Its name has no relation to the actual cloud. -## Setting up in Intellij +Its user guide can be found [here](https://cloud7050.github.io/ip/) or [here](./docs/README.md). -Prerequisites: JDK 11, update Intellij to the most recent version. - -1. Open Intellij (if you are not in the welcome screen, click `File` > `Close Project` to close the existing project first) -1. Open the project into Intellij as follows: - 1. Click `Open`. - 1. Select the project directory, and click `OK`. - 1. If there are any further prompts, accept the defaults. -1. Configure the project to use **JDK 11** (not other versions) as explained in [here](https://www.jetbrains.com/help/idea/sdk.html#set-up-jdk).
- In the same dialog, set the **Project language level** field to the `SDK default` option. -3. After that, locate the `src/main/java/Duke.java` file, right-click it, and choose `Run Duke.main()` (if the code editor is showing compile errors, try restarting the IDE). If the setup is correct, you should see something like the below as the output: - ``` - Hello from - ____ _ - | _ \ _ _| | _____ - | | | | | | | |/ / _ \ - | |_| | |_| | < __/ - |____/ \__,_|_|\_\___| - ``` +![](./docs/Ui.png) diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000000..ad9ead73af --- /dev/null +++ b/build.gradle @@ -0,0 +1,68 @@ +plugins { + id "application" + id "checkstyle" + + id "com.github.johnrengelman.shadow" version "7.1.2" +} + +repositories { + mavenCentral() +} + +String versionJavaFx = "17.0.7"; +String versionJUnit = "5.10.0"; +dependencies { + implementation group: "org.openjfx", name: "javafx-base", version: versionJavaFx, classifier: "win" + implementation group: "org.openjfx", name: "javafx-base", version: versionJavaFx, classifier: "mac" + implementation group: "org.openjfx", name: "javafx-base", version: versionJavaFx, classifier: "linux" + implementation group: "org.openjfx", name: "javafx-controls", version: versionJavaFx, classifier: "win" + implementation group: "org.openjfx", name: "javafx-controls", version: versionJavaFx, classifier: "mac" + implementation group: "org.openjfx", name: "javafx-controls", version: versionJavaFx, classifier: "linux" + implementation group: "org.openjfx", name: "javafx-fxml", version: versionJavaFx, classifier: "win" + implementation group: "org.openjfx", name: "javafx-fxml", version: versionJavaFx, classifier: "mac" + implementation group: "org.openjfx", name: "javafx-fxml", version: versionJavaFx, classifier: "linux" + implementation group: "org.openjfx", name: "javafx-graphics", version: versionJavaFx, classifier: "win" + implementation group: "org.openjfx", name: "javafx-graphics", version: versionJavaFx, classifier: "mac" + implementation group: "org.openjfx", name: "javafx-graphics", version: versionJavaFx, classifier: "linux" + + implementation group: "org.json", name: "json", version: "20230618" + + testImplementation group: "org.junit.jupiter", name: "junit-jupiter-api", version: versionJUnit + testRuntimeOnly group: "org.junit.jupiter", name: "junit-jupiter-engine", version: versionJUnit +} + + + +defaultTasks "clean", "build" + +application { + mainClass = "com.cloud.chatbot.Cloud" +} + +run { + enableAssertions true +} + +test { + useJUnitPlatform() + + // https://docs.gradle.org/current/dsl/org.gradle.api.tasks.testing.logging.TestLogging.html + testLogging { + events "passed", "skipped", "failed" + + showExceptions true + showCauses true + showStackTraces true + exceptionFormat "full" + } +} + +checkstyle { + toolVersion = "10.2" +} + +shadowJar { + dependsOn "distZip", "distTar" + + archiveFileName = "cloud.jar" +} diff --git a/config/checkstyle/checkstyle.xml b/config/checkstyle/checkstyle.xml new file mode 100644 index 0000000000..fdca2d72cc --- /dev/null +++ b/config/checkstyle/checkstyle.xml @@ -0,0 +1,432 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/config/checkstyle/suppressions.xml b/config/checkstyle/suppressions.xml new file mode 100644 index 0000000000..6c03d52b96 --- /dev/null +++ b/config/checkstyle/suppressions.xml @@ -0,0 +1,10 @@ + + + + + + diff --git a/docs/README.md b/docs/README.md index 8077118ebe..5b41d5a419 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,29 +1,65 @@ # User Guide -## Features +**Cloud** is a chatbot that tracks work items. Here's a quick overview of how to use it. -### Feature-ABC +Interaction is done by sending text commands. After starting the app, click on the text box at the bottom of the window to type your commands there. You may press Enter or click the "Send" button to send each command to the bot. -Description of the feature. +--- -### Feature-XYZ +## Adding Items -Description of the feature. +There are 3 kinds of items you can create. The most basic is called a task, which just has a description. -## Usage +Syntax: `add ` -### `Keyword` - Describe action +Example: `add Complete task by creating more cool features.` -Describe the action and its outcome. +There are also deadlines and events, which can be created by specifying flags. A flag consists of a word with a `/` in front of it, followed by the flag's contents. -Example of usage: +A deadline has a `/by` flag, while an event has both a `/from` and `/to` flag. These flags all expect a timestamp as their contents. Timestamps are given in the form `