-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit ddca2f9
Showing
17 changed files
with
338 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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,117 @@ | ||
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider | ||
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 | ||
|
||
# User-specific stuff | ||
.idea/**/workspace.xml | ||
.idea/**/tasks.xml | ||
.idea/**/usage.statistics.xml | ||
.idea/**/dictionaries | ||
.idea/**/shelf | ||
|
||
# AWS User-specific | ||
.idea/**/aws.xml | ||
|
||
# Generated files | ||
.idea/**/contentModel.xml | ||
|
||
# Sensitive or high-churn files | ||
.idea/**/dataSources/ | ||
.idea/**/dataSources.ids | ||
.idea/**/dataSources.local.xml | ||
.idea/**/sqlDataSources.xml | ||
.idea/**/dynamic.xml | ||
.idea/**/uiDesigner.xml | ||
.idea/**/dbnavigator.xml | ||
|
||
# Gradle | ||
.idea/**/gradle.xml | ||
.idea/**/libraries | ||
|
||
# Gradle and Maven with auto-import | ||
# When using Gradle or Maven with auto-import, you should exclude module files, | ||
# since they will be recreated, and may cause churn. Uncomment if using | ||
# auto-import. | ||
.idea/artifacts | ||
.idea/compiler.xml | ||
.idea/jarRepositories.xml | ||
.idea/modules.xml | ||
.idea/*.iml | ||
.idea/modules | ||
*.iml | ||
*.ipr | ||
|
||
# CMake | ||
cmake-build-*/ | ||
|
||
# Mongo Explorer plugin | ||
.idea/**/mongoSettings.xml | ||
|
||
# File-based project format | ||
*.iws | ||
|
||
# IntelliJ | ||
out/ | ||
|
||
# mpeltonen/sbt-idea plugin | ||
.idea_modules/ | ||
|
||
# JIRA plugin | ||
atlassian-ide-plugin.xml | ||
|
||
# Cursive Clojure plugin | ||
.idea/replstate.xml | ||
|
||
# SonarLint plugin | ||
.idea/sonarlint/ | ||
|
||
# Crashlytics plugin (for Android Studio and IntelliJ) | ||
com_crashlytics_export_strings.xml | ||
crashlytics.properties | ||
crashlytics-build.properties | ||
fabric.properties | ||
|
||
# Editor-based Rest Client | ||
.idea/httpRequests | ||
|
||
# Android studio 3.1+ serialized cache file | ||
.idea/caches/build_file_checksums.ser | ||
|
||
## Gradle-related | ||
.gradle | ||
**/build/ | ||
!src/**/build/ | ||
|
||
# Ignore Gradle GUI config | ||
gradle-app.setting | ||
|
||
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) | ||
!gradle-wrapper.jar | ||
|
||
# Avoid ignore Gradle wrappper properties | ||
!gradle-wrapper.properties | ||
|
||
# Cache of project | ||
.gradletasknamecache | ||
|
||
# Eclipse Gradle plugin generated files | ||
# Eclipse Core | ||
.project | ||
# JDT-specific (Eclipse Java Development Tools) | ||
.classpath | ||
|
||
# Standard Java gitignore | ||
# Compiled class file | ||
*.class | ||
|
||
# Log file | ||
*.log | ||
|
||
# BlueJ files | ||
*.ctxt | ||
|
||
# Mobile Tools for Java (J2ME) | ||
.mtj.tmp/ | ||
|
||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml | ||
hs_err_pid* | ||
replay_pid* |
This file contains 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,39 @@ | ||
# Project Template | ||
|
||
This is a template repository for CSC 207 projects. | ||
This repository contains starter code for a gradle project. | ||
It also contains workflow documents that give instructions on how to manage your Github repository and how to use Github Projects for efficient collaboration. | ||
|
||
## Checklist For Your Project | ||
- [ ] Verify the correct settings for your project repository | ||
- [ ] Set up Github Projects | ||
- [ ] Create the implementation plan using issues and Github Projects | ||
- [ ] Create deveopment branches for your features | ||
- [ ] Use pull requests to merge finished features into main branch | ||
- [ ] Conduct code reviews | ||
|
||
**If your team has trouble with any of these steps, please ask on Piazza. For example, with how GitHub Classroom works, your team *may* not have permissions to do some of the first few steps, in which case we'll post alternative instructions as needed.** | ||
|
||
## Workflow Documents | ||
|
||
* Github Workflow: Please refer to the workflow that was introduced in the first lab. You should follow this when working on your code. The following document provides additional details too. | ||
|
||
* [Project Planning and Development Guide](project_plan_dev.md): This document helps you to understand how to create and maintain a project plan for your class project. **This document helps you to complete the Implementation Plan Milestone.** | ||
|
||
## Gradle Project | ||
Import this project into your Intellij editor. It should automatically recognise this as a gradle repository. | ||
The starter code was built using SDK version 11.0.1. Ensure that you are using this version for this project. (You can, of course, change the SDK version as per your requirement if your team has all agreed to use a different version) | ||
|
||
You have been provided with two starter files for demonstration: HelloWorld and HelloWorldTest. | ||
|
||
You will find HelloWorld in `src/main/java/tutorial` directory. Right click on the HelloWorld file and click on `Run HelloWorld.main()`. | ||
This should run the program and print on your console. | ||
|
||
You will find HelloWorldTest in `src/test/java/tutorial` directory. Right click on the HelloWorldTest file and click on `Run HelloWorldTest`. | ||
All tests should pass. Your team can remove this sample of how testing works once you start adding your project code to the repo. | ||
|
||
Moving forward, we expect you to maintain this project structure. You *should* use Gradle as the build environment, but it is fine if your team prefers to use something else -- just remove the gradle files and push your preferred project setup. Assuming you stick with Gradle, your source code should go into `src/main/java` (you can keep creating more subdirectories as per your project requirement). Every source class can auto-generate a test file for you. For example, open HelloWorld.java file and click on the `HelloWorld` variable as shown in the image below. You should see an option `Generate` and on clicking this your should see an option `Test`. Clicking on this will generate a JUnit test file for `HelloWorld` class. This was used to generate the `HelloWorldTest`. | ||
|
||
![image](https://user-images.githubusercontent.com/5333020/196066655-d3c97bf4-fdbd-46b0-b6ae-aeb8dbcf351d.png) | ||
|
||
You can create another simple class and try generating a test for this class. |
This file contains 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,19 @@ | ||
plugins { | ||
id 'java' | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
implementation 'junit:junit:4.13.1' | ||
testImplementation('org.junit.jupiter:junit-jupiter:5.6.0') | ||
} | ||
|
||
test { | ||
useJUnitPlatform() | ||
testLogging { | ||
events "passed", "skipped", "failed" | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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,104 @@ | ||
# Project Planning and Development with Github | ||
|
||
In this course project, you are expected to use Github to manage your code. This document describes the workflow for using Github when you are developing the course project. Please read it carefully and follow the instructions. **Try to work through the steps with the help of your team first, but please ask for help if your team gets stuck on any of the steps or needs something clarified.** | ||
|
||
## Create a New Github Project | ||
[Github Projects](https://docs.github.com/en/issues/planning-and-tracking-with-projects/learning-about-projects/about-projects) (*Yes, the name of this product is called "Github Projects", do not confuse it with the course project*) is a lightweight project management tool that is integrated to Github. You can use it to track issues, pull requests, visualize tasks status, and track responsibilities. **TAs will mark you project implementation plan and track your progression using the Github project.** | ||
|
||
1. Navigate to **Projects** Page on [CSC207 organization page](https://github.com/orgs/CSC207-2022F-UofT/projects) | ||
|
||
2. Click **New project**, and click **Create** on the new page. | ||
![](images/create_project.png) | ||
|
||
3. Click the title bar to rename the project to your team/project's name, and press **Enter** to save the change. | ||
|
||
![](images/rename.png) | ||
|
||
4. Link the project to your repository. Navigate to your repository and select **Projects** tab, then click **Add Project** and select the project you just created. | ||
|
||
![](images/link_project.png) | ||
|
||
5. The project will show up in the the list below. | ||
|
||
## Define Your Features for the Implementation Plan | ||
As a part of the project planning, you are required to record all features formulated from your user stories, as **issues** in your Github repository. | ||
|
||
1. Navigate to your repository and select **Issues** tab, then click **New issue**. | ||
|
||
![](images/new_issue.png) | ||
|
||
1. Fill in the title as the name of the feature and provide a brief description of the feature. | ||
**Please use a consistent naming convention for your issues.** For example, you can use the following format: `[Feature x] <feature name>` | ||
|
||
2. On the side bar, select the **Assignee**, **Labels** (Enhancement for your Features), and **Projects**(the one you just created) for the issue. Then click **Submit new issue**. | ||
|
||
![](images/set_tags.png) | ||
|
||
3. On the project page, you can see an item is automatically created. :warning: :warning: **Make sure you verify that each feature issue is successfully created in the project.** :warning: :warning: | ||
|
||
|
||
## Feature Development | ||
When you work on a feature, you are always required to create a **branch** for the feature and **merge** the branch back to the main branch with **pull requests** when the feature is completed. Note: the below should remind you of the "workflow" we covered in the first lab this term. Please review the details of that document in addition to the below, which provides additional details about how the process works on GitHub. | ||
|
||
1. To create a new branch, navigate to the issue you are assigned to, and click **Create branch** on the right side bar. | ||
|
||
![](images/create_branch.png) | ||
|
||
2. Select a name and click **Create branch** on the pop-up window. Use the provided command to check out the branch you just created on your local machine. | ||
|
||
*Alternatively, you can create a branch manually, and link it to the issue.* | ||
|
||
3. Verify that the branch is successfully linked to the issue. | ||
|
||
|
||
![](images/link_branch.png) | ||
|
||
|
||
## Merge Feature Branch to Main Branch | ||
When you finish working on a feature, you are required to merge the feature branch back to the main branch with a **pull request**. | ||
|
||
1. After you make changes to the code and commit them to the feature branch, you will see a **Compare & pull request** button on the repository page. Click it to create a pull request. | ||
|
||
*Alternatively, you can create a pull request in the **Pull requests** tab.* | ||
|
||
![](images/create_pr.png) | ||
|
||
2. Give a meaningful title and description for the pull request, remember please make the name consistent. | ||
|
||
2.1 First make sure that you are merging from the feature branch to the main branch (see blue box). | ||
|
||
2.2 Make sure that you set the correct fields as issues (see red box). | ||
|
||
![](images/new_pr.png) | ||
|
||
3. Select reviewers for the pull request. You can select multiple reviewers. The reviewers will be notified and will review your code. You can also add comments to the pull request. | ||
|
||
4. After the reviewers approve the pull request, you can merge the pull request. :warning: :warning: **Pull requests | ||
must be reviewed and approved by other team members before merging.** :warning: :warning: **Reviewing and approving pull requests will be a part of the evaluation.** | ||
|
||
5. After the pull request is merged, the linked issue will be automatically closed. You can verify that the issue is closed by navigating to the issues page and project page. | ||
|
||
![](images/closed_issue.png) | ||
|
||
![](images/closed_project.png) | ||
|
||
6. (Optional) Delete the feature branch after the pull request is merged. You can delete the branch by navigating to the **View all branches** page. | ||
|
||
7. (Optional) If the feature is not completed or you want to continue working on the feature, you can reopen the issue and create new pull requests. Remember to change the status of the issue to **In Progress**. | ||
|
||
|
||
## More Project Management and Other Resoruces (Optional) | ||
|
||
- Use issues to keep track of bugs, tasks and other things that need to be done by selecting the appropriate labels. | ||
|
||
- Use milestones to group issues into a set of deliverables. To create milestones, navigate to the **Milestones** tab and click **New milestone**. | ||
|
||
- Use Projects to tracks issues and collaborate with your team. See the [sample project (Password Manager example)](https://github.com/orgs/CSC207-2022F-UofT/projects/2) for reference. | ||
|
||
- Github document for projects: https://docs.github.com/en/issues/planning-and-tracking-with-projects | ||
|
||
- Git operations: https://docs.github.com/en/get-started/using-git | ||
|
||
- Git cheat sheet: https://education.github.com/git-cheat-sheet-education.pdf | ||
|
||
- I MESSED UP GIT WHAT TO DO?!: https://dangitgit.com/ |
This file contains 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,23 @@ | ||
package tutorial; | ||
|
||
public class HelloWorld { | ||
|
||
public static void main(String[] args) { | ||
for (int i = 1; i <= 100; i++) { | ||
System.out.println(convert(i)); | ||
} | ||
} | ||
|
||
public static String convert(int decide) { | ||
if (decide % 15 == 0) { | ||
return "tutorial.HelloWorld"; | ||
} | ||
if (decide % 3 == 0) { | ||
return "Hello"; | ||
} | ||
if (decide % 5 == 0) { | ||
return "World"; | ||
} | ||
return String.valueOf(decide); | ||
} | ||
} |
This file contains 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,36 @@ | ||
package tutorial; | ||
|
||
import org.junit.jupiter.api.Assertions; | ||
import org.junit.jupiter.api.Test; | ||
|
||
class HelloWorldTest { | ||
|
||
@Test | ||
public void HelloWorldNormalNumbers() { | ||
|
||
HelloWorld hw = new HelloWorld(); | ||
Assertions.assertEquals("1", hw.convert(1)); | ||
Assertions.assertEquals("2", hw.convert(2)); | ||
} | ||
|
||
@Test | ||
public void HelloWorldThreeNumbers() { | ||
|
||
HelloWorld fb = new HelloWorld(); | ||
Assertions.assertEquals("Hello", fb.convert(3)); | ||
} | ||
|
||
@Test | ||
public void HelloWorldFiveNumbers() { | ||
|
||
HelloWorld hw = new HelloWorld(); | ||
Assertions.assertEquals("World", hw.convert(5)); | ||
} | ||
|
||
@Test | ||
public void HelloWorldThreeAndFiveNumbers() { | ||
|
||
HelloWorld hw = new HelloWorld(); | ||
Assertions.assertEquals("World", hw.convert(5)); | ||
} | ||
} |