From 5897d45c82f2ceba3ec54c52956a6e0f8903eb49 Mon Sep 17 00:00:00 2001 From: damithc Date: Thu, 26 Sep 2024 17:41:49 +0800 Subject: [PATCH] Site Update. [skip ci] --- README.html | 2 +- README.page-vue-render.js | 2 +- about.html | 2 +- about.page-vue-render.js | 2 +- common/common-fragments.html | 2 +- common/common-fragments.page-vue-render.js | 2 +- conventions/csharp.html | 2 +- conventions/csharp.page-vue-render.js | 2 +- conventions/css.html | 2 +- conventions/css.page-vue-render.js | 2 +- conventions/files.html | 2 +- conventions/files.page-vue-render.js | 2 +- conventions/git.html | 2 +- conventions/git.page-vue-render.js | 2 +- conventions/github.html | 2 +- conventions/github.page-vue-render.js | 2 +- conventions/html.html | 2 +- conventions/html.page-vue-render.js | 2 +- conventions/java/basic.html | 2 +- conventions/java/basic.page-vue-render.js | 2 +- conventions/java/index.html | 2 +- conventions/java/index.page-vue-render.js | 2 +- conventions/java/intermediate.html | 2 +- conventions/java/intermediate.page-vue-render.js | 2 +- conventions/java/logging.html | 2 +- conventions/java/logging.page-vue-render.js | 2 +- conventions/javascript.html | 2 +- conventions/javascript.page-vue-render.js | 2 +- conventions/markdown.html | 2 +- conventions/markdown.page-vue-render.js | 2 +- guidelines/PRs-reviewing.html | 2 +- guidelines/PRs-reviewing.page-vue-render.js | 2 +- guidelines/PRs.html | 2 +- guidelines/PRs.page-vue-render.js | 2 +- guidelines/codeOfConduct.html | 2 +- guidelines/codeOfConduct.page-vue-render.js | 2 +- guidelines/commits.html | 2 +- guidelines/commits.page-vue-render.js | 2 +- guidelines/labels.html | 2 +- guidelines/labels.page-vue-render.js | 2 +- index.html | 2 +- index.page-vue-render.js | 2 +- tutorials/ab3.html | 2 +- tutorials/ab3.page-vue-render.js | 2 +- tutorials/ab3AddRemark.html | 2 +- tutorials/ab3AddRemark.page-vue-render.js | 2 +- tutorials/ab3RemovingFields.html | 2 +- tutorials/ab3RemovingFields.page-vue-render.js | 2 +- tutorials/ab3TracingCode.html | 9 ++++++--- tutorials/ab3TracingCode.page-vue-render.js | 6 +++--- tutorials/checkstyle.html | 2 +- tutorials/checkstyle.page-vue-render.js | 2 +- tutorials/codecov.html | 2 +- tutorials/codecov.page-vue-render.js | 2 +- tutorials/githubActions.html | 2 +- tutorials/githubActions.page-vue-render.js | 2 +- tutorials/gradle.html | 7 +++---- tutorials/gradle.page-vue-render.js | 4 ++-- tutorials/intellijCodeStyle.html | 2 +- tutorials/intellijCodeStyle.page-vue-render.js | 2 +- tutorials/intellijDebugger.html | 2 +- tutorials/intellijDebugger.page-vue-render.js | 2 +- tutorials/intellijImportGradleProject.html | 5 ++--- .../intellijImportGradleProject.page-vue-render.js | 9 ++++++--- tutorials/intellijJdk.html | 5 +++-- tutorials/intellijJdk.page-vue-render.js | 12 +++++++++--- tutorials/intellijUsefulSettings.html | 2 +- tutorials/intellijUsefulSettings.page-vue-render.js | 2 +- tutorials/jar.html | 2 +- tutorials/jar.page-vue-render.js | 2 +- tutorials/javaFx.html | 2 +- tutorials/javaFx.page-vue-render.js | 2 +- tutorials/javaFxPart1.html | 2 +- tutorials/javaFxPart1.page-vue-render.js | 2 +- tutorials/javaFxPart2.html | 2 +- tutorials/javaFxPart2.page-vue-render.js | 2 +- tutorials/javaFxPart3.html | 2 +- tutorials/javaFxPart3.page-vue-render.js | 2 +- tutorials/javaFxPart4.html | 2 +- tutorials/javaFxPart4.page-vue-render.js | 2 +- tutorials/javaFxPart5.html | 2 +- tutorials/javaFxPart5.page-vue-render.js | 2 +- tutorials/javaInstallationMac.html | 2 +- tutorials/javaInstallationMac.page-vue-render.js | 2 +- tutorials/javaInstallationWindows.html | 2 +- tutorials/javaInstallationWindows.page-vue-render.js | 2 +- tutorials/jekyll.html | 2 +- tutorials/jekyll.page-vue-render.js | 2 +- tutorials/junit.html | 2 +- tutorials/junit.page-vue-render.js | 2 +- tutorials/markbind-forked-sites.html | 2 +- tutorials/markbind-forked-sites.page-vue-render.js | 2 +- tutorials/markbind.html | 2 +- tutorials/markbind.page-vue-render.js | 2 +- tutorials/netlify.html | 2 +- tutorials/netlify.page-vue-render.js | 2 +- tutorials/plantUml.html | 2 +- tutorials/plantUml.page-vue-render.js | 2 +- tutorials/savingPdf.html | 2 +- tutorials/savingPdf.page-vue-render.js | 2 +- tutorials/sourcetree.html | 2 +- tutorials/sourcetree.page-vue-render.js | 2 +- tutorials/textUiTesting.html | 2 +- tutorials/textUiTesting.page-vue-render.js | 2 +- tutorials/vscode.html | 2 +- tutorials/vscode.page-vue-render.js | 2 +- 106 files changed, 132 insertions(+), 121 deletions(-) diff --git a/README.html b/README.html index b04976bd..cf1f01b0 100644 --- a/README.html +++ b/README.html @@ -14,7 +14,7 @@

Guides for SE student projects »

Go to the main website [http://se-education.org/guides]

+

Guides for SE student projects »

Go to the main website [http://se-education.org/guides]

diff --git a/README.page-vue-render.js b/README.page-vue-render.js index 6550ace6..d7e1f26c 100644 --- a/README.page-vue-render.js +++ b/README.page-vue-render.js @@ -8,6 +8,6 @@ with(this){return _c('div',{attrs:{"id":"app"}},[_c('header',{attrs:{"sticky":"" with(this){return _c('div',{staticClass:"fixed-header-padding",attrs:{"id":"content-wrapper"}},[_c('h1',{attrs:{"id":"guides-for-se-student-projects"}},[_c('span',{staticClass:"text-dark"},[_c('strong',[_c('strong',[_v("Guides for SE student projects »")])])]),_c('a',{staticClass:"fa fa-anchor",attrs:{"href":"#guides-for-se-student-projects","onclick":"event.stopPropagation()"}})]),_v(" "),_c('p'),_c('p',[_v("Go to the main website ["),_c('a',{attrs:{"href":"http://se-education.org/guides"}},[_v("http://se-education.org/guides")]),_v("]")]),_c('p')])} },function anonymous( ) { -with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Tue, 24 Sept 2024, 23:18:52 GMT+8]")])])])} +with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Thu, 26 Sept 2024, 17:41:12 GMT+8]")])])])} }]; \ No newline at end of file diff --git a/about.html b/about.html index 5b0654f2..d28b67c1 100644 --- a/about.html +++ b/about.html @@ -16,7 +16,7 @@ Search this site

Guides for SE student projects »

About Us

This is a sub-project of the se-education.org.

Contact

Suggestions, questions, and bug reports can be posted in our issue tracker.

Alternatively, contact project mentor Damith C. Rajapakse. -

License

This work is released under the MIT OSS license.

Contributing

PRs to improve/add content are welcome.

This website uses MarkBind documentation tool. This document has some guidance on how to use it when updating contents.

Follow the Markdown style guide in your PR.

Acknowledgements

The favicon.ico is based on an icon made by Dave Gandy from www.flaticon.com

+

License

This work is released under the MIT OSS license.

Contributing

PRs to improve/add content are welcome.

This website uses MarkBind documentation tool. This document has some guidance on how to use it when updating contents.

Follow the Markdown style guide in your PR.

Acknowledgements

The favicon.ico is based on an icon made by Dave Gandy from www.flaticon.com

diff --git a/about.page-vue-render.js b/about.page-vue-render.js index 8424b9cc..a3ba4ea3 100644 --- a/about.page-vue-render.js +++ b/about.page-vue-render.js @@ -8,6 +8,6 @@ with(this){return _c('div',{attrs:{"id":"app"}},[_c('header',{attrs:{"sticky":"" with(this){return _c('div',{staticClass:"fixed-header-padding",attrs:{"id":"content-wrapper"}},[_c('h1',{attrs:{"id":"guides-for-se-student-projects"}},[_c('span',{staticClass:"text-dark"},[_c('strong',[_c('strong',[_v("Guides for SE student projects »")])])]),_c('a',{staticClass:"fa fa-anchor",attrs:{"href":"#guides-for-se-student-projects","onclick":"event.stopPropagation()"}})]),_v(" "),_c('p'),_c('h1',{attrs:{"id":"about-us"}},[_v("About Us"),_c('a',{staticClass:"fa fa-anchor",attrs:{"href":"#about-us","onclick":"event.stopPropagation()"}})]),_v(" "),_c('p',[_v("This is a sub-project of the "),_c('a',{attrs:{"href":"https://se-education.org"}},[_v("se-education.org")]),_v(".\n"),_c('span',{attrs:{"id":"contact-info"}})]),_v(" "),_c('h2',{attrs:{"id":"contact"}},[_v("Contact"),_c('a',{staticClass:"fa fa-anchor",attrs:{"href":"#contact","onclick":"event.stopPropagation()"}})]),_v(" "),_c('p',[_v("Suggestions, questions, and bug reports can be posted in "),_c('a',{attrs:{"href":"https://github.com/se-edu/guides/issues"}},[_v("our issue tracker")]),_v(".")]),_v(" "),_c('p',[_v("Alternatively, contact project mentor "),_c('a',{attrs:{"href":"https://www.comp.nus.edu.sg/~damithch"}},[_v("Damith C. Rajapakse")]),_v(".\n")]),_v(" "),_c('h2',{attrs:{"id":"license"}},[_v("License"),_c('a',{staticClass:"fa fa-anchor",attrs:{"href":"#license","onclick":"event.stopPropagation()"}})]),_v(" "),_c('p',[_v("This work is released under the "),_c('a',{attrs:{"href":"https://opensource.org/licenses/MIT"}},[_v("MIT OSS license")]),_v(".")]),_v(" "),_c('h2',{attrs:{"id":"contributing"}},[_v("Contributing"),_c('a',{staticClass:"fa fa-anchor",attrs:{"href":"#contributing","onclick":"event.stopPropagation()"}})]),_v(" "),_c('p',[_v("PRs to improve/add content are welcome.")]),_v(" "),_c('p',[_v("This website uses MarkBind documentation tool. "),_c('a',{attrs:{"href":"/guides/tutorials/markbind.html"}},[_v("This document")]),_v(" has some guidance on how to use it when updating contents.")]),_v(" "),_c('p',[_v("Follow the "),_c('a',{attrs:{"href":"/guides/conventions/markdown.html"}},[_v("Markdown style guide")]),_v(" in your PR.")]),_v(" "),_c('h2',{attrs:{"id":"acknowledgements"}},[_v("Acknowledgements"),_c('a',{staticClass:"fa fa-anchor",attrs:{"href":"#acknowledgements","onclick":"event.stopPropagation()"}})]),_v(" "),_c('p',[_v("The "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("favicon.ico")]),_v(" is based on an icon made by "),_c('a',{attrs:{"href":"https://www.flaticon.com/authors/dave-gandy"}},[_v("Dave Gandy")]),_v(" from www.flaticon.com")]),_c('p')])} },function anonymous( ) { -with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Tue, 24 Sept 2024, 23:18:52 GMT+8]")])])])} +with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Thu, 26 Sept 2024, 17:41:12 GMT+8]")])])])} }]; \ No newline at end of file diff --git a/common/common-fragments.html b/common/common-fragments.html index 529535b9..ca569477 100644 --- a/common/common-fragments.html +++ b/common/common-fragments.html @@ -14,7 +14,7 @@

Guides for SE student projects »

Noticed any bugs/issues or unclear areas while following this tutorial? Help us improve it by reporting it at our issue tracker.

+

Guides for SE student projects »

Noticed any bugs/issues or unclear areas while following this tutorial? Help us improve it by reporting it at our issue tracker.

diff --git a/common/common-fragments.page-vue-render.js b/common/common-fragments.page-vue-render.js index 7ec1639f..3c0333ef 100644 --- a/common/common-fragments.page-vue-render.js +++ b/common/common-fragments.page-vue-render.js @@ -8,6 +8,6 @@ with(this){return _c('div',{attrs:{"id":"app"}},[_c('header',{attrs:{"sticky":"" with(this){return _c('h1',{attrs:{"id":"guides-for-se-student-projects"}},[_c('span',{staticClass:"text-dark"},[_c('strong',[_c('strong',[_v("Guides for SE student projects »")])])]),_c('a',{staticClass:"fa fa-anchor",attrs:{"href":"#guides-for-se-student-projects","onclick":"event.stopPropagation()"}})])} },function anonymous( ) { -with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Tue, 24 Sept 2024, 23:18:52 GMT+8]")])])])} +with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Thu, 26 Sept 2024, 17:41:12 GMT+8]")])])])} }]; \ No newline at end of file diff --git a/conventions/csharp.html b/conventions/csharp.html index cc7aa3d0..237e3960 100644 --- a/conventions/csharp.html +++ b/conventions/csharp.html @@ -471,7 +471,7 @@ -

References

+

References

diff --git a/conventions/csharp.page-vue-render.js b/conventions/csharp.page-vue-render.js index 9119d03d..9a61a7c9 100644 --- a/conventions/csharp.page-vue-render.js +++ b/conventions/csharp.page-vue-render.js @@ -269,6 +269,6 @@ with(this){return _c('h2',{attrs:{"id":"references"}},[_v("References"),_c('a',{ with(this){return _c('ul',[_c('li',[_c('a',{attrs:{"href":"https://msdn.microsoft.com/en-us/library/ff926074.aspx"}},[_v("C# Coding Conventions (C# Programming Guide)")]),_v(" -- From Microsoft")]),_v(" "),_c('li',[_c('a',{attrs:{"href":"http://www.icsharpcode.net/TechNotes/SharpDevelopCodingStyle03.pdf"}},[_v("C# Coding Style Guide")]),_v(" -- By Mike Krüger")]),_v(" "),_c('li',[_c('a',{attrs:{"href":"https://github.com/dennisdoomen/CSharpGuidelines"}},[_v("CSharpGuidelines")]),_v(" -- From Aviva Solutions")])])} },function anonymous( ) { -with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Tue, 24 Sept 2024, 23:18:52 GMT+8]")])])])} +with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Thu, 26 Sept 2024, 17:41:12 GMT+8]")])])])} }]; \ No newline at end of file diff --git a/conventions/css.html b/conventions/css.html index c9b3ca0c..bf5c6897 100644 --- a/conventions/css.html +++ b/conventions/css.html @@ -217,7 +217,7 @@ -

Attribute Formatting

General Details

Resources

+

Attribute Formatting

General Details

Resources

diff --git a/conventions/css.page-vue-render.js b/conventions/css.page-vue-render.js index c27aeb2b..9365ba76 100644 --- a/conventions/css.page-vue-render.js +++ b/conventions/css.page-vue-render.js @@ -146,6 +146,6 @@ with(this){return _c('h2',{attrs:{"id":"resources"}},[_v("Resources"),_c('a',{st with(this){return _c('ul',[_c('li',[_c('p',[_v("Highly Recommended")]),_v(" "),_c('ul',[_c('li',[_c('a',{attrs:{"href":"https://google.github.io/styleguide/htmlcssguide.xml"}},[_v("Google CSS Style Guide")])]),_v(" "),_c('li',[_c('a',{attrs:{"href":"http://learn.shayhowe.com/html-css/writing-your-best-code/#css-coding-practices"}},[_v("Writing Your Best Code - CSS Coding Practices")])])])]),_v(" "),_c('li',[_c('p',[_v("Other Readings")]),_v(" "),_c('ul',[_c('li',[_c('a',{attrs:{"href":"https://code.tutsplus.com/tutorials/30-css-best-practices-for-beginners--net-6741"}},[_v("30 CSS Best Practices For Beginners")])]),_v(" "),_c('li',[_c('a',{attrs:{"href":"https://css-tricks.com/css-style-guides"}},[_v("A list of CSS style guides")])]),_v(" "),_c('li',[_c('a',{attrs:{"href":"http://isobar-idev.github.io/code-standards/"}},[_v("Isobar coding standards")])])])])])} },function anonymous( ) { -with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Tue, 24 Sept 2024, 23:18:52 GMT+8]")])])])} +with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Thu, 26 Sept 2024, 17:41:12 GMT+8]")])])])} }]; \ No newline at end of file diff --git a/conventions/files.html b/conventions/files.html index 2a318d4b..f78b6f9c 100644 --- a/conventions/files.html +++ b/conventions/files.html @@ -16,7 +16,7 @@ Search this site

Guides for SE student projects »

Conventions for file/folder naming

Files/Folders

  • General rule: aim for local consistency i.e., follow the conventions/patterns followed by other files/folders in the neighborhood.
    • If the project uses a framework that has a specific file naming convention, follow that instead.

  • If there is no existing pattern to follow: -
    • Use camelCase whenever possible. e.g. formatsAndConventions.md
    • If the name has multiple phrases, use - to separate phrases. e.g. codingStyle-javaBasic.html

  • Try to user common prefixes so that similar files appear together when sorted by name.
    Good codingStyle-java.html, codingStyle-html.html
    Bad: javaCodingStyle.html, htmlCodingStyle.html

  • Prefer plurals if the file/folder contains multiple items of same type e.g. docs instead of doc

+

diff --git a/conventions/files.page-vue-render.js b/conventions/files.page-vue-render.js index dfa71bae..0e70955d 100644 --- a/conventions/files.page-vue-render.js +++ b/conventions/files.page-vue-render.js @@ -8,6 +8,6 @@ with(this){return _c('div',{attrs:{"id":"app"}},[_c('header',{attrs:{"sticky":"" with(this){return _c('div',{staticClass:"fixed-header-padding",attrs:{"id":"content-wrapper"}},[_c('h1',{attrs:{"id":"guides-for-se-student-projects"}},[_c('span',{staticClass:"text-dark"},[_c('strong',[_c('strong',[_v("Guides for SE student projects »")])])]),_c('a',{staticClass:"fa fa-anchor",attrs:{"href":"#guides-for-se-student-projects","onclick":"event.stopPropagation()"}})]),_v(" "),_c('p'),_c('h1',{attrs:{"id":"conventions-for-file-folder-naming"}},[_v("Conventions for file/folder naming"),_c('a',{staticClass:"fa fa-anchor",attrs:{"href":"#conventions-for-file-folder-naming","onclick":"event.stopPropagation()"}})]),_v(" "),_c('h2',{attrs:{"id":"files-folders"}},[_v("Files/Folders"),_c('a',{staticClass:"fa fa-anchor",attrs:{"href":"#files-folders","onclick":"event.stopPropagation()"}})]),_v(" "),_c('ul',[_c('li',[_c('strong',[_v("General rule: aim for "),_c('em',[_v("local consistency")])]),_v(" i.e., follow the conventions/patterns followed by other files/folders in the neighborhood.\n"),_c('ul',[_c('li',[_v("If the project uses a framework that has a specific file naming convention, follow that instead.")])])])]),_v(" "),_c('p'),_v(" "),_c('ul',[_c('li',[_v("If there is no existing pattern to follow:\n"),_c('ul',[_c('li',[_v("Use camelCase whenever possible. e.g. "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("formatsAndConventions.md")])]),_v(" "),_c('li',[_v("If the name has multiple phrases, use - to separate phrases. e.g. "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("codingStyle-javaBasic.html")])])])])]),_v(" "),_c('p'),_v(" "),_c('ul',[_c('li',[_c('p',[_v("Try to user common prefixes so that similar files appear together when sorted by name."),_c('br'),_v(" "),_c('span',{staticStyle:{"color":"green"}},[_c('span',[_c('strong',[_c('span',{staticClass:"fas fa-thumbs-up",attrs:{"aria-hidden":"true"}}),_v(" Good")])])]),_v(" "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("codingStyle-java.html")]),_v(", "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("codingStyle-html.html")]),_c('br'),_v(" "),_c('span',{staticStyle:{"color":"red"}},[_c('span',[_c('strong',[_c('span',{staticClass:"fas fa-thumbs-down",attrs:{"aria-hidden":"true"}}),_v(" Bad")])])]),_v(": "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("javaCodingStyle.html")]),_v(", "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("htmlCodingStyle.html")])])]),_v(" "),_c('li',[_c('p',[_v("Prefer plurals if the file/folder contains multiple items of same type e.g. "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("docs")]),_v(" instead of "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("doc")])])])]),_c('p')])} },function anonymous( ) { -with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Tue, 24 Sept 2024, 23:18:52 GMT+8]")])])])} +with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Thu, 26 Sept 2024, 17:41:12 GMT+8]")])])])} }]; \ No newline at end of file diff --git a/conventions/git.html b/conventions/git.html index c4c9a917..92e793d2 100644 --- a/conventions/git.html +++ b/conventions/git.html @@ -128,7 +128,7 @@ -

Refer to the article How to Write a Git Commit Message for more advice on writing good commit messages.

Branch names

Follow these rules to improve consistency:

+

Refer to the article How to Write a Git Commit Message for more advice on writing good commit messages.

Branch names

Follow these rules to improve consistency:

diff --git a/conventions/git.page-vue-render.js b/conventions/git.page-vue-render.js index d17a3747..7b7fe092 100644 --- a/conventions/git.page-vue-render.js +++ b/conventions/git.page-vue-render.js @@ -83,6 +83,6 @@ with(this){return _c('h2',{attrs:{"id":"branch-names"}},[_v("Branch names"),_c(' with(this){return _c('div',{attrs:{"id":"branch-names-format"}},[_c('p',[_v("Follow these rules to improve consistency:")]),_v(" "),_c('ul',[_c('li',[_v("Use a meaningful name consisting of some relevant keywords, in the "),_c('em',[_v("kebab case")]),_v(" format e.g., "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("refactor-ui-tests")]),_v(".")]),_v(" "),_c('li',[_v("If the branch is related to an issue, use the format "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("issueNumber-some-keywords-from-issue-title")]),_v(" e.g., "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("1234-ui-freeze-error")])])])])} },function anonymous( ) { -with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Tue, 24 Sept 2024, 23:18:52 GMT+8]")])])])} +with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Thu, 26 Sept 2024, 17:41:12 GMT+8]")])])])} }]; \ No newline at end of file diff --git a/conventions/github.html b/conventions/github.html index 2e253253..6dc5a68b 100644 --- a/conventions/github.html +++ b/conventions/github.html @@ -45,7 +45,7 @@

PR merge commit

When merging a PR branch to the main branch, use one of these formats for the subject line of the merge commit.

Pick one option and use it consistently in the entire code base.

Rationale: This format allows easy traceability among a merge commit, the issue it fixes, and the PR that fixed it. Having the issue name tells us what the commit is about without having to look it up in GitHub issue tracker.

Issues

+e.g. Error alert email has very long subject (#6580)

Pick one option and use it consistently in the entire code base.

Rationale: This format allows easy traceability among a merge commit, the issue it fixes, and the PR that fixed it. Having the issue name tells us what the commit is about without having to look it up in GitHub issue tracker.

Issues

diff --git a/conventions/github.page-vue-render.js b/conventions/github.page-vue-render.js index 4ef7fe80..3904be7d 100644 --- a/conventions/github.page-vue-render.js +++ b/conventions/github.page-vue-render.js @@ -71,6 +71,6 @@ with(this){return _c('h2',{attrs:{"id":"issues"}},[_v("Issues"),_c('a',{staticCl with(this){return _c('li',[_c('p',[_c('strong',[_v("Issue title should be concise yet descriptive.")]),_v(" For example, instead of "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Newbie question, please help")]),_v(", use "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("How do I set up git to ignore test files?")])])])} },function anonymous( ) { -with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Tue, 24 Sept 2024, 23:18:52 GMT+8]")])])])} +with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Thu, 26 Sept 2024, 17:41:12 GMT+8]")])])])} }]; \ No newline at end of file diff --git a/conventions/html.html b/conventions/html.html index e32c378e..4c4d5e78 100644 --- a/conventions/html.html +++ b/conventions/html.html @@ -376,7 +376,7 @@ -

+

diff --git a/conventions/html.page-vue-render.js b/conventions/html.page-vue-render.js index 14ba998d..5fdfce51 100644 --- a/conventions/html.page-vue-render.js +++ b/conventions/html.page-vue-render.js @@ -191,6 +191,6 @@ with(this){return _c('div',{staticClass:"col-sm-auto"},[_c('span',{staticStyle:{ with(this){return _c('code',{pre:true,attrs:{"class":"no-line-numbers hljs html"}},[_c('span',[_c('span',{pre:true,attrs:{"class":"hljs-tag"}},[_v("<"),_c('span',{pre:true,attrs:{"class":"hljs-name"}},[_v("a")]),_v(" "),_c('span',{pre:true,attrs:{"class":"hljs-attr"}},[_v("target")]),_v("="),_c('span',{pre:true,attrs:{"class":"hljs-string"}},[_v("\"_blank\"")]),_v(" "),_c('span',{pre:true,attrs:{"class":"hljs-attr"}},[_v("href")]),_v("="),_c('span',{pre:true,attrs:{"class":"hljs-string"}},[_v("\"https://example.com\"")]),_v(">")]),_v("Example.com"),_c('span',{pre:true,attrs:{"class":"hljs-tag"}},[_v("")]),_v("\n")])])} },function anonymous( ) { -with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Tue, 24 Sept 2024, 23:18:52 GMT+8]")])])])} +with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Thu, 26 Sept 2024, 17:41:12 GMT+8]")])])])} }]; \ No newline at end of file diff --git a/conventions/java/basic.html b/conventions/java/basic.html index a1cf7a3b..dfff3c7e 100644 --- a/conventions/java/basic.html +++ b/conventions/java/basic.html @@ -800,7 +800,7 @@ -

References

  1. Oracle's Java Style Guide https://www.oracle.com/docs/tech/java/codeconventions.pdf
  2. Google's Java Style Guide https://google.github.io/styleguide/javaguide.html

Contributors

+

References

  1. Oracle's Java Style Guide https://www.oracle.com/docs/tech/java/codeconventions.pdf
  2. Google's Java Style Guide https://google.github.io/styleguide/javaguide.html

Contributors

diff --git a/conventions/java/basic.page-vue-render.js b/conventions/java/basic.page-vue-render.js index b88a83f4..47047347 100644 --- a/conventions/java/basic.page-vue-render.js +++ b/conventions/java/basic.page-vue-render.js @@ -374,6 +374,6 @@ with(this){return _c('h2',{attrs:{"id":"contributors"}},[_v("Contributors"),_c(' with(this){return _c('ul',[_c('li',[_v("Nimantha Baranasuriya - Initial draft")]),_v(" "),_c('li',[_v("Dai Thanh - Further tweaks")]),_v(" "),_c('li',[_v("Tong Chun Kit - Further tweaks")]),_v(" "),_c('li',[_v("Barnabas Tan - Converted from Google Docs to Markdown Document")])])} },function anonymous( ) { -with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Tue, 24 Sept 2024, 23:18:52 GMT+8]")])])])} +with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Thu, 26 Sept 2024, 17:41:12 GMT+8]")])])])} }]; \ No newline at end of file diff --git a/conventions/java/index.html b/conventions/java/index.html index 5fcda59b..1fd316c7 100644 --- a/conventions/java/index.html +++ b/conventions/java/index.html @@ -1201,7 +1201,7 @@ -

References

  1. Oracle's Java Style Guide https://www.oracle.com/docs/tech/java/codeconventions.pdf
  2. Google's Java Style Guide https://google.github.io/styleguide/javaguide.html

Contributors

+

References

  1. Oracle's Java Style Guide https://www.oracle.com/docs/tech/java/codeconventions.pdf
  2. Google's Java Style Guide https://google.github.io/styleguide/javaguide.html

Contributors

diff --git a/conventions/java/index.page-vue-render.js b/conventions/java/index.page-vue-render.js index 896bcdab..eda4d99b 100644 --- a/conventions/java/index.page-vue-render.js +++ b/conventions/java/index.page-vue-render.js @@ -569,6 +569,6 @@ with(this){return _c('h2',{attrs:{"id":"contributors"}},[_v("Contributors"),_c(' with(this){return _c('ul',[_c('li',[_v("Nimantha Baranasuriya - Initial draft")]),_v(" "),_c('li',[_v("Dai Thanh - Further tweaks")]),_v(" "),_c('li',[_v("Tong Chun Kit - Further tweaks")]),_v(" "),_c('li',[_v("Barnabas Tan - Converted from Google Docs to Markdown Document")])])} },function anonymous( ) { -with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Tue, 24 Sept 2024, 23:18:52 GMT+8]")])])])} +with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Thu, 26 Sept 2024, 17:41:12 GMT+8]")])])])} }]; \ No newline at end of file diff --git a/conventions/java/intermediate.html b/conventions/java/intermediate.html index 6f296c80..e3ce0174 100644 --- a/conventions/java/intermediate.html +++ b/conventions/java/intermediate.html @@ -1106,7 +1106,7 @@ -

References

  1. Oracle's Java Style Guide https://www.oracle.com/docs/tech/java/codeconventions.pdf
  2. Google's Java Style Guide https://google.github.io/styleguide/javaguide.html

Contributors

+

References

  1. Oracle's Java Style Guide https://www.oracle.com/docs/tech/java/codeconventions.pdf
  2. Google's Java Style Guide https://google.github.io/styleguide/javaguide.html

Contributors

diff --git a/conventions/java/intermediate.page-vue-render.js b/conventions/java/intermediate.page-vue-render.js index 8f9e1e51..29217253 100644 --- a/conventions/java/intermediate.page-vue-render.js +++ b/conventions/java/intermediate.page-vue-render.js @@ -506,6 +506,6 @@ with(this){return _c('h2',{attrs:{"id":"contributors"}},[_v("Contributors"),_c(' with(this){return _c('ul',[_c('li',[_v("Nimantha Baranasuriya - Initial draft")]),_v(" "),_c('li',[_v("Dai Thanh - Further tweaks")]),_v(" "),_c('li',[_v("Tong Chun Kit - Further tweaks")]),_v(" "),_c('li',[_v("Barnabas Tan - Converted from Google Docs to Markdown Document")])])} },function anonymous( ) { -with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Tue, 24 Sept 2024, 23:18:52 GMT+8]")])])])} +with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Thu, 26 Sept 2024, 17:41:12 GMT+8]")])])])} }]; \ No newline at end of file diff --git a/conventions/java/logging.html b/conventions/java/logging.html index 40bd7d49..aabc78d4 100644 --- a/conventions/java/logging.html +++ b/conventions/java/logging.html @@ -14,7 +14,7 @@

Guides for SE student projects »

Java logging conventions

We recommend using java.util.logging package for logging.

Logging Levels

  • SEVERE: A critical problem detected which may cause the termination of the application.
  • WARNING: Can continue, but with caution.
  • INFO: Information showing the noteworthy actions by the App.
  • FINE: Details that is not usually noteworthy but may be useful in debugging e.g. print the actual list instead of just its size.

+

Guides for SE student projects »

Java logging conventions

We recommend using java.util.logging package for logging.

Logging Levels

  • SEVERE: A critical problem detected which may cause the termination of the application.
  • WARNING: Can continue, but with caution.
  • INFO: Information showing the noteworthy actions by the App.
  • FINE: Details that is not usually noteworthy but may be useful in debugging e.g. print the actual list instead of just its size.

diff --git a/conventions/java/logging.page-vue-render.js b/conventions/java/logging.page-vue-render.js index a324c13d..619a4f56 100644 --- a/conventions/java/logging.page-vue-render.js +++ b/conventions/java/logging.page-vue-render.js @@ -8,6 +8,6 @@ with(this){return _c('div',{attrs:{"id":"app"}},[_c('header',{attrs:{"sticky":"" with(this){return _c('div',{staticClass:"fixed-header-padding",attrs:{"id":"content-wrapper"}},[_c('h1',{attrs:{"id":"guides-for-se-student-projects"}},[_c('span',{staticClass:"text-dark"},[_c('strong',[_c('strong',[_v("Guides for SE student projects »")])])]),_c('a',{staticClass:"fa fa-anchor",attrs:{"href":"#guides-for-se-student-projects","onclick":"event.stopPropagation()"}})]),_v(" "),_c('p'),_c('h1',{attrs:{"id":"java-logging-conventions"}},[_v("Java logging conventions"),_c('a',{staticClass:"fa fa-anchor",attrs:{"href":"#java-logging-conventions","onclick":"event.stopPropagation()"}})]),_v(" "),_c('p',[_v("We recommend using "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("java.util.logging")]),_v(" package for logging.")]),_v(" "),_c('p',[_c('strong',[_v("Logging Levels")])]),_v(" "),_c('ul',[_c('li',[_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("SEVERE")]),_v(": A critical problem detected which may cause the termination of the application.")]),_v(" "),_c('li',[_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("WARNING")]),_v(": Can continue, but with caution.")]),_v(" "),_c('li',[_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("INFO")]),_v(": Information showing the noteworthy actions by the App.")]),_v(" "),_c('li',[_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("FINE")]),_v(": Details that is not usually noteworthy but may be useful in debugging e.g. print the actual list instead of just its size.")])]),_c('p')])} },function anonymous( ) { -with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Tue, 24 Sept 2024, 23:18:52 GMT+8]")])])])} +with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Thu, 26 Sept 2024, 17:41:12 GMT+8]")])])])} }]; \ No newline at end of file diff --git a/conventions/javascript.html b/conventions/javascript.html index e178be5c..532fdb23 100644 --- a/conventions/javascript.html +++ b/conventions/javascript.html @@ -14,7 +14,7 @@

Guides for SE student projects »

JavaScript coding standard

  • Indentation: Use 2 spaces (not tabs, not 4 spaces)
  • Maximum line length: soft limit = 110, hard limit = 120
  • For everything else, follow the Airbnb coding standard.

+

Guides for SE student projects »

JavaScript coding standard

  • Indentation: Use 2 spaces (not tabs, not 4 spaces)
  • Maximum line length: soft limit = 110, hard limit = 120
  • For everything else, follow the Airbnb coding standard.

diff --git a/conventions/javascript.page-vue-render.js b/conventions/javascript.page-vue-render.js index 4c0b56d6..32ba57a0 100644 --- a/conventions/javascript.page-vue-render.js +++ b/conventions/javascript.page-vue-render.js @@ -8,6 +8,6 @@ with(this){return _c('div',{attrs:{"id":"app"}},[_c('header',{attrs:{"sticky":"" with(this){return _c('div',{staticClass:"fixed-header-padding",attrs:{"id":"content-wrapper"}},[_c('h1',{attrs:{"id":"guides-for-se-student-projects"}},[_c('span',{staticClass:"text-dark"},[_c('strong',[_c('strong',[_v("Guides for SE student projects »")])])]),_c('a',{staticClass:"fa fa-anchor",attrs:{"href":"#guides-for-se-student-projects","onclick":"event.stopPropagation()"}})]),_v(" "),_c('p'),_c('h1',{attrs:{"id":"javascript-coding-standard"}},[_v("JavaScript coding standard"),_c('a',{staticClass:"fa fa-anchor",attrs:{"href":"#javascript-coding-standard","onclick":"event.stopPropagation()"}})]),_v(" "),_c('ul',[_c('li',[_c('strong',[_v("Indentation")]),_v(": Use "),_c('mark',[_v("2 spaces")]),_v(" (not tabs, not 4 spaces)")]),_v(" "),_c('li',[_c('strong',[_v("Maximum line length")]),_v(": soft limit = 110, "),_c('mark',[_v("hard limit = 120")])]),_v(" "),_c('li',[_v("For everything else, follow the "),_c('a',{attrs:{"href":"https://github.com/airbnb/javascript/blob/master/README.md"}},[_c('strong',[_v("Airbnb coding standard")])]),_v(".")])]),_c('p')])} },function anonymous( ) { -with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Tue, 24 Sept 2024, 23:18:52 GMT+8]")])])])} +with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Thu, 26 Sept 2024, 17:41:12 GMT+8]")])])])} }]; \ No newline at end of file diff --git a/conventions/markdown.html b/conventions/markdown.html index f3589c78..41b88657 100644 --- a/conventions/markdown.html +++ b/conventions/markdown.html @@ -277,7 +277,7 @@ -

+

diff --git a/conventions/markdown.page-vue-render.js b/conventions/markdown.page-vue-render.js index f8778c65..8c088006 100644 --- a/conventions/markdown.page-vue-render.js +++ b/conventions/markdown.page-vue-render.js @@ -125,6 +125,6 @@ with(this){return _c('div',{staticClass:"col-sm-auto"},[_c('span',{staticStyle:{ with(this){return _c('code',{pre:true,attrs:{"class":"hljs markdown"}},[_c('span',[_v("He "),_c('span',{pre:true,attrs:{"class":"hljs-emphasis"}},[_v("*really*")]),_v(" meant it.\n")])])} },function anonymous( ) { -with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Tue, 24 Sept 2024, 23:18:52 GMT+8]")])])])} +with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Thu, 26 Sept 2024, 17:41:12 GMT+8]")])])])} }]; \ No newline at end of file diff --git a/guidelines/PRs-reviewing.html b/guidelines/PRs-reviewing.html index 24de8717..15913977 100644 --- a/guidelines/PRs-reviewing.html +++ b/guidelines/PRs-reviewing.html @@ -21,7 +21,7 @@ Option 1: This separation of X from Y is good (or correct or wrong or bad)
Option 2: I like how you separated X from Y (or didn't like or Not sure I like)
The second one is less judgemental and less likely to cause the author to become defensive.
  • Feel free to ask for more info from the author, to help you understand the code/design. For example, you can ask why the author chose to write the code in a specific way.
  • You can also suggest alternatives for the author to consider.
    -Combining this with the previous point, you can ask Any reason why you did it this way instead of that way?
  • Feel free to compliment the author when appropriate instead of focusing on negative things only.
    e.g., hey, I like how clean this bit of code is 👍
  • Say please, but don't say please. Beware of overusing 'please' as it can be interpreted as a condescending tone. For example, someone can interpret Please use better variable names as Please for the love of God can you use better variable names?. Instead, you can say Perhaps a more intuitive variable name here? which doesn't run any risk of misinterpretation.
  • No need to repeat the same comment many times. It's not the job of the reviewer to clean up after a sloppy author. If you notice the same problem in multiple places, after commenting an a few of them, you can simply say ... I noticed the same issue in several other places too.
  • Remember the other readers. PR comments can be read by people other than the reviewer and the author e.g., future programmers. Use regular English and avoid slang, colloquialisms, cultural references etc.
  • Further readings:

    Best practices for authors

    +Combining this with the previous point, you can ask Any reason why you did it this way instead of that way?
  • Feel free to compliment the author when appropriate instead of focusing on negative things only.
    e.g., hey, I like how clean this bit of code is 👍
  • Say please, but don't say please. Beware of overusing 'please' as it can be interpreted as a condescending tone. For example, someone can interpret Please use better variable names as Please for the love of God can you use better variable names?. Instead, you can say Perhaps a more intuitive variable name here? which doesn't run any risk of misinterpretation.
  • No need to repeat the same comment many times. It's not the job of the reviewer to clean up after a sloppy author. If you notice the same problem in multiple places, after commenting an a few of them, you can simply say ... I noticed the same issue in several other places too.
  • Remember the other readers. PR comments can be read by people other than the reviewer and the author e.g., future programmers. Use regular English and avoid slang, colloquialisms, cultural references etc.
  • Further readings:

    Best practices for authors

    diff --git a/guidelines/PRs-reviewing.page-vue-render.js b/guidelines/PRs-reviewing.page-vue-render.js index 60090d7a..b211870d 100644 --- a/guidelines/PRs-reviewing.page-vue-render.js +++ b/guidelines/PRs-reviewing.page-vue-render.js @@ -8,6 +8,6 @@ with(this){return _c('div',{attrs:{"id":"app"}},[_c('header',{attrs:{"sticky":"" with(this){return _c('div',{staticClass:"fixed-header-padding",attrs:{"id":"content-wrapper"}},[_c('h1',{attrs:{"id":"guides-for-se-student-projects"}},[_c('span',{staticClass:"text-dark"},[_c('strong',[_c('strong',[_v("Guides for SE student projects »")])])]),_c('a',{staticClass:"fa fa-anchor",attrs:{"href":"#guides-for-se-student-projects","onclick":"event.stopPropagation()"}})]),_v(" "),_c('p'),_c('h1',{attrs:{"id":"best-practices-for-reviewing-prs"}},[_v("Best practices for reviewing PRs"),_c('a',{staticClass:"fa fa-anchor",attrs:{"href":"#best-practices-for-reviewing-prs","onclick":"event.stopPropagation()"}})]),_v(" "),_c('div',{staticClass:"lead"},[_c('p',[_v("Reviewing PRs is not just about the code or the tools, "),_c('strong',[_v("the way you phrase your comments matters too")]),_v(", especially if you are a peer reviewer.")])]),_v(" "),_c('h2',{attrs:{"id":"best-practices-for-reviewers"}},[_v("Best practices for reviewers"),_c('a',{staticClass:"fa fa-anchor",attrs:{"href":"#best-practices-for-reviewers","onclick":"event.stopPropagation()"}})]),_v(" "),_c('ul',[_c('li',[_c('strong',[_v("Add specific comments at relevant places of the code")]),_v(", rather than give one overall comment for the entire PR.\n"),_c('ul',[_c('li',[_v("It is typical for the comment to be added right below the code line it refers to."),_c('br'),_v("\nIt is possible to "),_c('a',{attrs:{"href":"https://twitter.com/natfriedman/status/1179097330097643521"}},[_v("mark multiple lines")]),_v(" as linked to the comment too.")]),_v(" "),_c('li',[_v("You can use Markdown (specifically, "),_c('a',{attrs:{"href":"https://guides.github.com/features/mastering-markdown/"}},[_v("GitHub-Flavored Markdown")]),_v(") in your comments.")])])]),_v(" "),_c('li',[_c('mark',[_c('strong',[_v("It's best to phrase comments as questions")])]),_v(", especially if you are a peer reviewer."),_c('br'),_v("\ne.g., "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Should this be extracted out?")]),_v(" rather than "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Extract this out")]),_v(" or "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("This should be extracted out")]),_v(".")]),_v(" "),_c('li',[_c('strong',[_v("Say 'I like', not 'good/bad'")]),_v(". Consider these two alternatives:"),_c('br'),_v("\nOption 1: "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("This separation of X from Y is good")]),_v(" (or "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("correct")]),_v(" or "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("wrong")]),_v(" or "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("bad")]),_v(")"),_c('br'),_v("\nOption 2: "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("I like how you separated X from Y")]),_v(" (or "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("didn't like")]),_v(" or "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Not sure I like")]),_v(")"),_c('br'),_v("\nThe second one is less judgemental and less likely to cause the author to become defensive.")]),_v(" "),_c('li',[_c('strong',[_v("Feel free to ask for more info from the author")]),_v(", to help you understand the code/design. For example, you can ask why the author chose to write the code in a specific way.")]),_v(" "),_c('li',[_c('strong',[_v("You can also suggest alternatives for the author to consider.")]),_c('br'),_v("\nCombining this with the previous point, you can ask "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Any reason why you did it this way instead of that way?")])]),_v(" "),_c('li',[_c('strong',[_v("Feel free to compliment the author when appropriate")]),_v(" instead of focusing on negative things only."),_c('br'),_v(" "),_c('span',{staticClass:"dimmed"},[_v("e.g., "),_c('em',[_v("hey, I like how clean this bit of code is")]),_v(" 👍")])]),_v(" "),_c('li',[_c('strong',[_v("Say please, but don't say "),_c('em',[_v("please")])]),_v(". Beware of overusing 'please' as it can be interpreted as a condescending tone. For example, someone can interpret "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Please use better variable names")]),_v(" as "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Please for the love of God can you use better variable names?")]),_v(". Instead, you can say "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Perhaps a more intuitive variable name here?")]),_v(" which doesn't run any risk of misinterpretation.")]),_v(" "),_c('li',[_c('strong',[_v("No need to repeat the same comment "),_c('em',[_v("many")]),_v(" times")]),_v(". It's not the job of the reviewer to clean up after a sloppy author. If you notice the same problem in multiple places, after commenting an a few of them, you can simply say "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("... I noticed the same issue in several other places too")]),_v(".")]),_v(" "),_c('li',[_c('strong',[_v("Remember the "),_c('em',[_v("other")]),_v(" readers")]),_v(". PR comments can be read by people other than the reviewer and the author e.g., future programmers. Use regular English and avoid slang, colloquialisms, cultural references etc.")])]),_v(" "),_c('p',[_c('strong',[_c('strong',[_v("Further readings")])]),_v(":")]),_v(" "),_c('ul',[_c('li',[_v("Read the blog post "),_c('a',{attrs:{"href":"https://developers.redhat.com/blog/2019/07/08/10-tips-for-reviewing-code-you-dont-like/"}},[_c('strong',[_v("10 tips for reviewing code you don’t like")])]),_v(" - by David Lloyd (a Red Hat developer).")])]),_v(" "),_c('h2',{attrs:{"id":"best-practices-for-authors"}},[_v("Best practices for authors"),_c('a',{staticClass:"fa fa-anchor",attrs:{"href":"#best-practices-for-authors","onclick":"event.stopPropagation()"}})]),_v(" "),_c('ul',[_c('li',[_c('strong',[_v("Don't get into arguments with reviewers.")]),_v(" If you disagree with the reviewer, you can explain your own view in a non-confrontational way without trying to prove your way is better.")]),_v(" "),_c('li',[_v("Thank reviewers for their inputs.")])]),_c('p')])} },function anonymous( ) { -with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Tue, 24 Sept 2024, 23:18:52 GMT+8]")])])])} +with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Thu, 26 Sept 2024, 17:41:12 GMT+8]")])])])} }]; \ No newline at end of file diff --git a/guidelines/PRs.html b/guidelines/PRs.html index 1cb8da35..5cac53ac 100644 --- a/guidelines/PRs.html +++ b/guidelines/PRs.html @@ -17,7 +17,7 @@

    Guides for SE student projects »

    Guidelines for working with PRs

    Selecting what to work on

    • If submitting a PR for an existing issue,
      • It's best for first time contributors to start by fixing an issue specifically labelled for first timers e.g., d.FirstTimers, good first issue.
      • It's best to post in the issue to ask if it is OK for you to submit a PR for that issue and wait for approval.
      • Check the issue discussion thread to see if there are PRs for that issue. You can offer to PR for an issue that has stalled PRs i.e., there is a PRs submitted for that issue but the PR author seems to have stopped working on it.
    • If the issue list does not contain what you want to work on, post an issue first and wait for it to be acknowledged. Otherwise you could end up fixing something that does not need fixing.

    Scoping a PR

    General rule: try to keep PRs as small as possible because smaller PRs get merged faster.

    A PR should contain a single, standalone, and complete change to the code base, unless in exceptional cases where the PR is part of a bigger change.

    • Single means a PR should not try to fix more than one fix, unless there are multiple things that must be done together or not at all.

      Refrain from in the neighboring code unless the line in concern is already touched by the PR (i.e., the housekeeping does not increase the line count of the PR).

      Rationale: Imagine we decide to revert the PR for some reason. If a PR contains, unrelated changes or multiple independent changes, we will not be able to revert the offending change without losing the other changes as well.

      If you notice a need for housekeeping in the neighboring code as you do your PR, create an issue for it in the issue tracker.

    • Standalone means the PR should contain a meaningful change that moves the code base from one working state to another.

    • Complete means the PR should contain everything related to the change, including the following:

      • functional code
      • code comments
      • test cases
      • user docs and developer docs

    "This PR is just the code fix. I'll update tests and documentation in a separate PR" is not acceptable!

    However, it is fine to push the functional code first to get early feedback, as long as the rest is added to the same PR later.

    Submitting a PR

    When submitting PRs, follow the forking workflow. A summary of the steps is given below.

    Step 0 Do these steps if you haven't done them already:

    0.1 Fork the upstream repo.

    0.2 Clone the fork to your computer.

    0.3 Set up the dev environment as described in the project docs. Confirm the set up is correct.

    Step 1 Create a branch from the master branch, following the naming convention given.

    Step 2 Add your code to the branch while ensuring you follow these:

    • relevant coding standards (the full list is given here)
    • Commit message format

    • guidelines for commit organization

    • PR scoping guidelines given above

    Step 3 Sync your branch with the upstream master, if the master branch advances while you work on your code (i.e., pull upstream master, merge to your branch).

    Step 4 Create a PR when the code is ready, as follows:

    1. Run code style checks (if any) to ensure the code complies with the project standards.
    2. Push the branch to your fork.
    3. Create a draft PR from your fork to the upstream repo.
    4. Check the draft PR on GitHub to confirm the following:
      • it follows the PR format conventions
      • it does not contain any unintended changes.
      • it passes checks, if any.
    5. Remove the 'draft' status of the PR. Post a ready for review comment for good measure.

    Step 5 Revise as per reviews until the PR is merged.

    • Feel free to post a reminder comment if you don't get a review within 2-3 days.
    • When you receive a review,
      1. Revise the code as per the review.
      2. Push the new code to the branch in your fork.
      3. Post a comment to indicate the PR is ready for a new review.

    Reviewing a PR

    • Check for basic PR hygiene, and remind the PR author to rectify if necessary. -
      • contains a single, stand-alone, complete fix
      • relevant comments, dev/user docs, tests have been updated
      • PR title/description format is expected
      • doesn't contain unrelated changes

    • Before approving a PR, confirm that all your previous comments have been addressed.

    Merging PRs

    Follow the convention for Git branch merging, as given in the panel below.

    +

    Merging PRs

    Follow the convention for Git branch merging, as given in the panel below.

    diff --git a/guidelines/PRs.page-vue-render.js b/guidelines/PRs.page-vue-render.js index df4f2f7b..bacae0b7 100644 --- a/guidelines/PRs.page-vue-render.js +++ b/guidelines/PRs.page-vue-render.js @@ -101,6 +101,6 @@ with(this){return _c('ul',[_c('li',[_c('strong',[_v("Before approving a PR, "),_ with(this){return _c('h2',{attrs:{"id":"merging-prs"}},[_v("Merging PRs"),_c('a',{staticClass:"fa fa-anchor",attrs:{"href":"#merging-prs","onclick":"event.stopPropagation()"}})])} },function anonymous( ) { -with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Tue, 24 Sept 2024, 23:18:52 GMT+8]")])])])} +with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Thu, 26 Sept 2024, 17:41:12 GMT+8]")])])])} }]; \ No newline at end of file diff --git a/guidelines/codeOfConduct.html b/guidelines/codeOfConduct.html index c2e8779e..978c05e6 100644 --- a/guidelines/codeOfConduct.html +++ b/guidelines/codeOfConduct.html @@ -41,7 +41,7 @@ obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.

    Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other -members of the project's leadership.

    +members of the project's leadership.

    diff --git a/guidelines/codeOfConduct.page-vue-render.js b/guidelines/codeOfConduct.page-vue-render.js index 7304e81c..de1184a9 100644 --- a/guidelines/codeOfConduct.page-vue-render.js +++ b/guidelines/codeOfConduct.page-vue-render.js @@ -35,6 +35,6 @@ with(this){return _c('h2',{attrs:{"id":"enforcement"}},[_v("Enforcement"),_c('a' with(this){return _c('p',[_v("Instances of abusive, harassing, or otherwise unacceptable behavior may be\nreported by contacting the project team at "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("seer[at]comp.nus.edu.sg")]),_v(". All\ncomplaints will be reviewed and investigated and will result in a response that\nis deemed necessary and appropriate to the circumstances. The project team is\nobligated to maintain confidentiality with regard to the reporter of an incident.\nFurther details of specific enforcement policies may be posted separately.")])} },function anonymous( ) { -with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Tue, 24 Sept 2024, 23:18:52 GMT+8]")])])])} +with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Thu, 26 Sept 2024, 17:41:12 GMT+8]")])])])} }]; \ No newline at end of file diff --git a/guidelines/commits.html b/guidelines/commits.html index 6105b770..cac6af5f 100644 --- a/guidelines/commits.html +++ b/guidelines/commits.html @@ -17,7 +17,7 @@

    Guides for SE student projects »

    Working with Git

    Organizing commits

    Commits in a branch or a PR is said to be well-organized if they have the following qualities:

    • Each commit contains a single logical change, and this change must stand on its own. i.e. each commit has a single responsibility, and that responsibility must be fully carried out.
      For example, if the commit message says Move delete() from Person class to Address class, the commit cannot contain the addition of delete() to Address class only; it should also contain the deletion of delete() from the Person class for it to be a complete implementation what is stated in the commit message.

    • Each commit has a well-written commit message i.e., it follows these guidelines.

    • Commits are ordered in a bottom-up fashion, each commit building on top of the previous one towards the end goal of the PR.

      Rationale: Reviewers should be able to review one commit at a time.

    • Ideally, a commit does not modify more than 100 lines of code.

      Rationale: Bigger commits are harder to review.

      "Ask a programmer to review 10 lines of code, he'll find 10 issues. Ask him to do 500 lines and he'll say it looks good." --[source]

      Commits containing mechanical changes (e.g. automated refactorings, cut-paste type code movements, file renames, etc.),

      • should include only one mechanical change per commit e.g., rename a single variable across the code base.
      • should not contain other non-mechanical changes, unless unavoidable.
      • can exceed 100 LoC.
      • should have the description of the change in the commit message (so that the results can be reproduced).
    • Every commit pass CI. when you merge a series of commits (without squashing), every commit in your push (not just the last commit) should pass CI.

      Rationale: Build-breaking commits in the version history hinder the ability to use git bisect for locating bugs.

    Here is an example PR of commits that are organized as described above.

    Refactor commits before pushing. It is unlikely that you can produce a series of commits that meet all the above criteria in the first try. In such cases, refactor commits until they meet the criteria. This S/O post describes how to refactor commits (even easier to do with visual tools such as SourceTree -- see this video).

    Merging branches

    When merging branch, the aim is to keep the version history neat so that it is easy to do things such as the following:

    • Find which commit introduced a bug using git bisect.
    • Undo a specific change by reverting a commit in the history without breaking anything else.
    • The default strategy is to do a squash-merge. This is suitable when the branch tackles one task but multiple commits that are not well-organized (as per the definition of 'well-organized' in the panel below).

    • Use a merge commit if the commits are well-organized, and the branch tackles only one task. In this case the commit message of the merge commit should explain the full task.

    • Use a rebase-merge if the commits are well-organized and each commit is an independent task (as opposed to steps or a bigger tasks).

    • In other cases, consider reorganizing/splitting the branch to match one of the above. -

    +

    diff --git a/guidelines/commits.page-vue-render.js b/guidelines/commits.page-vue-render.js index b94217d0..fde70b21 100644 --- a/guidelines/commits.page-vue-render.js +++ b/guidelines/commits.page-vue-render.js @@ -50,6 +50,6 @@ with(this){return _c('ul',[_c('li',[_c('strong',[_v("The default strategy is to with(this){return _c('ul',[_c('li',[_c('p',[_c('strong',[_v("Use a "),_c('em',[_v("merge commit")])]),_v(" if the commits are well-organized, and the branch tackles only one task. In this case the commit message of the merge commit should explain the full task.")])]),_v(" "),_c('li',[_c('p',[_c('strong',[_v("Use a "),_c('em',[_v("rebase-merge")])]),_v(" if the commits are well-organized and each commit is an independent task (as opposed to steps or a bigger tasks).")])]),_v(" "),_c('li',[_c('p',[_c('strong',[_v("In other cases")]),_v(", consider reorganizing/splitting the branch to match one of the above.\n")])])])} },function anonymous( ) { -with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Tue, 24 Sept 2024, 23:18:52 GMT+8]")])])])} +with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Thu, 26 Sept 2024, 17:41:12 GMT+8]")])])])} }]; \ No newline at end of file diff --git a/guidelines/labels.html b/guidelines/labels.html index 138e1fc8..309098bf 100644 --- a/guidelines/labels.html +++ b/guidelines/labels.html @@ -24,7 +24,7 @@ e.g. a request for help on setting up dev environment.

    Difficulty (d.)

    Effort (e.)

    This label can be used to indicate how much effort is expected for (or was spent on) an issue.

    e.1 is roughly equal to an hour of work, e.2 is two hours of work, and so on. Recommended values: 1,2,4,8,16,32

    Effort labels can be applied to PRs indicate effort for reviewing (by the main reviewer). Those applied for issues can indicate the effort for fixing the issue.

    Aspect (a-)

    Classifies the issues based on the non-functional aspect it tackles. Some examples:

    Label Description
    a-AccessControl Controlling access to user groups, authentication, privacy, anonymity
    a-CodeQuality Refactorings that are mainly to improve code/design quality
    a-Concurrency Things related to concurrent access, session control
    a-DevOps CI, release management, version control, dev docs
    a-Docs User docs, product website
    a-FaultTolerance Resilience to user errors, environmental problems
    a-Performance Speed of operation
    a-Persistence Saving data permanently
    a-Scalability Related to behavior at increasing loads
    a-Security Protection from security threats
    a-Testing Testing efficiency and robustness (as opposed to testing a specific feature)
    a-UIX User interface, User experience, Responsiveness

    Feature (f-)

    Classifies the issue based on the feature it involves. These labels depend on the project. e.g. f-Admin, f-Sessions, f-Delete

    Tech (t-)

    Classifies the issue based on the tool/technology it involves. Some examples given below.

    Label Description
    t-CSS CSS, Bootstrap
    t-HTML HTML, Browsers
    t-JS Javascript, JQuery
    t-JSTL JSTL, JSP, Servlets

    Special labels

    Other guidelines

    +
  • Use UpperCamelCase for label names; Keep group prefixes short and use lower case.
  • diff --git a/guidelines/labels.page-vue-render.js b/guidelines/labels.page-vue-render.js index adbd9c68..c64d3555 100644 --- a/guidelines/labels.page-vue-render.js +++ b/guidelines/labels.page-vue-render.js @@ -8,6 +8,6 @@ with(this){return _c('div',{attrs:{"id":"app"}},[_c('header',{attrs:{"sticky":"" with(this){return _c('div',{staticClass:"fixed-header-padding",attrs:{"id":"content-wrapper"}},[_c('h1',{attrs:{"id":"guides-for-se-student-projects"}},[_c('span',{staticClass:"text-dark"},[_c('strong',[_c('strong',[_v("Guides for SE student projects »")])])]),_c('a',{staticClass:"fa fa-anchor",attrs:{"href":"#guides-for-se-student-projects","onclick":"event.stopPropagation()"}})]),_v(" "),_c('p'),_c('h1',{attrs:{"id":"working-with-github-labels"}},[_v("Working with GitHub labels"),_c('a',{staticClass:"fa fa-anchor",attrs:{"href":"#working-with-github-labels","onclick":"event.stopPropagation()"}})]),_v(" "),_c('div',{staticClass:"lead"},[_c('p',[_v("As a project grows, issue/PR labels can play an increasingly important role in managing a large number of issues/PRs. This document has some guidelines that can improve consistency across projects and help make the use of labels more productive.")])]),_v(" "),_c('p',[_v("Unless mentioned otherwise, "),_c('em',[_v("labels are applied to issues only")]),_v(" (not PRs).")]),_v(" "),_c('h2',{attrs:{"id":"label-groups"}},[_v("Label groups"),_c('a',{staticClass:"fa fa-anchor",attrs:{"href":"#label-groups","onclick":"event.stopPropagation()"}})]),_v(" "),_c('p',[_v("While GitHub does not have the concept of label groups, we can simulate label groups using systematic label naming.\ni.e. labels having the same prefix are considered part of a label group.")]),_v(" "),_c('p',[_v("There are two types of label groups:")]),_v(" "),_c('ul',[_c('li',[_c('strong',[_v("Exclusive groups")]),_v(": No more than one label from the group can be applied to an issue")]),_v(" "),_c('li',[_c('strong',[_v("Non-exclusive groups")]),_v(": Multiple labels from a group can be applied to an issue")])]),_v(" "),_c('p',[_c('em',[_v("Common label groups")]),_v(":")]),_v(" "),_c('ul',[_c('li',[_v("exclusive: "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("s.")]),_v(" status, "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("p.")]),_v(" priority, "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("c.")]),_v(" category, "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("d.")]),_v(" difficulty, "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("e.")]),_v(" effort,")]),_v(" "),_c('li',[_v("non-exclusive: "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("a-")]),_v(" aspect, "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("f-")]),_v(" feature, "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("t-")]),_v(" tech,")])]),_v(" "),_c('h2',{attrs:{"id":"common-labels"}},[_v("Common labels"),_c('a',{staticClass:"fa fa-anchor",attrs:{"href":"#common-labels","onclick":"event.stopPropagation()"}})]),_v(" "),_c('h3',{attrs:{"id":"priority-p"}},[_v("Priority ("),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("p.")]),_v(")"),_c('a',{staticClass:"fa fa-anchor",attrs:{"href":"#priority-p","onclick":"event.stopPropagation()"}})]),_v(" "),_c('ul',[_c('li',[_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("p.Critical")]),_v(": Would like to fix it ASAP and release as a hot patch.")]),_v(" "),_c('li',[_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("p.Urgent")]),_v(": Would like to handle in the very next release.")]),_v(" "),_c('li',[_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("p.High")]),_v(": Enhances user experience significantly, would like to do in the next few releases.")]),_v(" "),_c('li',[_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("p.Medium")]),_v(": Marginal impact on user experience.")]),_v(" "),_c('li',[_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("p.Low")]),_v(": Very little impact, unlikely to do in the near future.")]),_v(" "),_c('li',[_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("p.Zero")]),_v(": Unlikely to do, ever.")])]),_v(" "),_c('p',[_v("NOTE: An issue is considered as "),_c('em',[_v("accepted")]),_v(" when a priority label has been assigned.")]),_v(" "),_c('h3',{attrs:{"id":"status-s"}},[_v("Status ("),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("s.")]),_v(")"),_c('a',{staticClass:"fa fa-anchor",attrs:{"href":"#status-s","onclick":"event.stopPropagation()"}})]),_v(" "),_c('ul',[_c('li',[_v("Open issues\n"),_c('ul',[_c('li',[_v("No status: New issue yet to be triaged.")]),_v(" "),_c('li',[_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("s.OnHold")]),_v(": The work on the issue has been put on hold pending some other event.")])])]),_v(" "),_c('li',[_v("Open PR\n"),_c('ul',[_c('li',[_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("s.ToReview")]),_v(": Waiting for the review.")]),_v(" "),_c('li',[_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("s.Ongoing")]),_v(": The PR is being worked on.")]),_v(" "),_c('li',[_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("s.ToMerge")]),_v(": Main reviewer approved the changes.")]),_v(" "),_c('li',[_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("s.MergeApproved")]),_v(": Both main reviewer and the code quality reviewer has approved the merge. PR can be merged.")]),_v(" "),_c('li',[_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("s.OnHold")]),_v(": The work on the PR has been put on hold pending some other event.")])])])]),_v(" "),_c('h3',{attrs:{"id":"category-c"}},[_v("Category ("),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("c.")]),_v(")"),_c('a',{staticClass:"fa fa-anchor",attrs:{"href":"#category-c","onclick":"event.stopPropagation()"}})]),_v(" "),_c('ul',[_c('li',[_v("Changes to "),_c('em',[_v("functionality")]),_v(", categorized based on size\n"),_c('ul',[_c('li',[_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("c.Enhancement")]),_v(": An enhancement to an existing functionality (not big enough to be considered as a user story).")]),_v(" "),_c('li',[_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("c.Story")]),_v(" : A user story."),_c('br'),_v("\nOR "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("c.Feature")]),_v(": A new feature.")]),_v(" "),_c('li',[_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("c.Epic")]),_v(" or "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("c.Theme")]),_v(": A feature that be broken down into many user-stories/features.")])])]),_v(" "),_c('li',[_v("Other work\n"),_c('ul',[_c('li',[_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("c.Bug")])]),_v(" "),_c('li',[_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("c.Task")]),_v(", "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("c.Chore")]),_v(": Other work items such as updating documentation.")]),_v(" "),_c('li',[_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("c.Message")]),_v(": Issue used as a means of discussing something with the dev team."),_c('br'),_v("\ne.g. a request for help on setting up dev environment.")])])])]),_v(" "),_c('h3',{attrs:{"id":"difficulty-d"}},[_v("Difficulty ("),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("d.")]),_v(")"),_c('a',{staticClass:"fa fa-anchor",attrs:{"href":"#difficulty-d","onclick":"event.stopPropagation()"}})]),_v(" "),_c('ul',[_c('li',[_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("d.Easy")]),_v(": For new contributors to do as their first PR. MUST be simple enough to be contained in one commit.")]),_v(" "),_c('li',[_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("d.Moderate")]),_v(": Moderate difficulty. Small localized change.")]),_v(" "),_c('li',[_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("d.Hard")]),_v(", "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("d.VeryHard")]),_v(": More difficult issues that are better left for committers or more senior developers.")])]),_v(" "),_c('h3',{attrs:{"id":"effort-e"}},[_v("Effort ("),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("e.")]),_v(")"),_c('a',{staticClass:"fa fa-anchor",attrs:{"href":"#effort-e","onclick":"event.stopPropagation()"}})]),_v(" "),_c('p',[_v("This label can be used to indicate how much effort is expected for (or was spent on) an issue.")]),_v(" "),_c('p',[_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("e.1")]),_v(" is roughly equal to an hour of work, "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("e.2")]),_v(" is two hours of work, and so on. Recommended values: 1,2,4,8,16,32")]),_v(" "),_c('p',[_v("Effort labels can be applied to PRs indicate effort for reviewing (by the main reviewer). Those applied for issues can indicate\nthe effort for fixing the issue.")]),_v(" "),_c('h3',{attrs:{"id":"aspect-a"}},[_v("Aspect ("),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("a-")]),_v(")"),_c('a',{staticClass:"fa fa-anchor",attrs:{"href":"#aspect-a","onclick":"event.stopPropagation()"}})]),_v(" "),_c('p',[_v("Classifies the issues based on the non-functional aspect it tackles. Some examples:")]),_v(" "),_c('div',{staticClass:"table-responsive"},[_c('table',{staticClass:"markbind-table table table-bordered table-striped"},[_c('thead',[_c('tr',[_c('th',[_v("Label")]),_v(" "),_c('th',[_v("Description")])])]),_v(" "),_c('tbody',[_c('tr',[_c('td',[_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("a-AccessControl")])]),_v(" "),_c('td',[_v("Controlling access to user groups, authentication, privacy, anonymity")])]),_v(" "),_c('tr',[_c('td',[_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("a-CodeQuality")])]),_v(" "),_c('td',[_v("Refactorings that are mainly to improve code/design quality")])]),_v(" "),_c('tr',[_c('td',[_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("a-Concurrency")])]),_v(" "),_c('td',[_v("Things related to concurrent access, session control")])]),_v(" "),_c('tr',[_c('td',[_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("a-DevOps")])]),_v(" "),_c('td',[_v("CI, release management, version control, dev docs")])]),_v(" "),_c('tr',[_c('td',[_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("a-Docs")])]),_v(" "),_c('td',[_v("User docs, product website")])]),_v(" "),_c('tr',[_c('td',[_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("a-FaultTolerance")])]),_v(" "),_c('td',[_v("Resilience to user errors, environmental problems")])]),_v(" "),_c('tr',[_c('td',[_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("a-Performance")])]),_v(" "),_c('td',[_v("Speed of operation")])]),_v(" "),_c('tr',[_c('td',[_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("a-Persistence")])]),_v(" "),_c('td',[_v("Saving data permanently")])]),_v(" "),_c('tr',[_c('td',[_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("a-Scalability")])]),_v(" "),_c('td',[_v("Related to behavior at increasing loads")])]),_v(" "),_c('tr',[_c('td',[_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("a-Security")])]),_v(" "),_c('td',[_v("Protection from security threats")])]),_v(" "),_c('tr',[_c('td',[_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("a-Testing")])]),_v(" "),_c('td',[_v("Testing efficiency and robustness (as opposed to testing a specific feature)")])]),_v(" "),_c('tr',[_c('td',[_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("a-UIX")])]),_v(" "),_c('td',[_v("User interface, User experience, Responsiveness")])])])])]),_v(" "),_c('h3',{attrs:{"id":"feature-f"}},[_v("Feature ("),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("f-")]),_v(")"),_c('a',{staticClass:"fa fa-anchor",attrs:{"href":"#feature-f","onclick":"event.stopPropagation()"}})]),_v(" "),_c('p',[_v("Classifies the issue based on the feature it involves. These labels depend on the project.\ne.g. "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("f-Admin")]),_v(", "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("f-Sessions")]),_v(", "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("f-Delete")])]),_v(" "),_c('h3',{attrs:{"id":"tech-t"}},[_v("Tech ("),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("t-")]),_v(")"),_c('a',{staticClass:"fa fa-anchor",attrs:{"href":"#tech-t","onclick":"event.stopPropagation()"}})]),_v(" "),_c('p',[_v("Classifies the issue based on the tool/technology it involves. Some examples given below.")]),_v(" "),_c('div',{staticClass:"table-responsive"},[_c('table',{staticClass:"markbind-table table table-bordered table-striped"},[_c('thead',[_c('tr',[_c('th',[_v("Label")]),_v(" "),_c('th',[_v("Description")])])]),_v(" "),_c('tbody',[_c('tr',[_c('td',[_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("t-CSS")])]),_v(" "),_c('td',[_v("CSS, Bootstrap")])]),_v(" "),_c('tr',[_c('td',[_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("t-HTML")])]),_v(" "),_c('td',[_v("HTML, Browsers")])]),_v(" "),_c('tr',[_c('td',[_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("t-JS")])]),_v(" "),_c('td',[_v("Javascript, JQuery")])]),_v(" "),_c('tr',[_c('td',[_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("t-JSTL")])]),_v(" "),_c('td',[_v("JSTL, JSP, Servlets")])])])])]),_v(" "),_c('h3',{attrs:{"id":"special-labels"}},[_v("Special labels"),_c('a',{staticClass:"fa fa-anchor",attrs:{"href":"#special-labels","onclick":"event.stopPropagation()"}})]),_v(" "),_c('ul',[_c('li',[_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("good first issue")]),_v(": for first time contributors (note that "),_c('a',{attrs:{"href":"https://help.github.com/en/github/building-a-strong-community/encouraging-helpful-contributions-to-your-project-with-labels"}},[_v("GitHub treats this label in a special way")]),_v(")")]),_v(" "),_c('li',[_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("kudos")]),_v(": to appreciate good work done in a PR")])]),_v(" "),_c('h2',{attrs:{"id":"other-guidelines"}},[_v("Other guidelines"),_c('a',{staticClass:"fa fa-anchor",attrs:{"href":"#other-guidelines","onclick":"event.stopPropagation()"}})]),_v(" "),_c('ul',[_c('li',[_v("When choosing label colors:\n"),_c('ul',[_c('li',[_v("Choose bright colors for labels that should get more attention. "),_c('a',{attrs:{"href":"https://github.com/oss-generic/process/labels?sort=name-asc%5BHere%5D"}},[_v("https://github.com/oss-generic/process/labels?sort=name-asc[Here]")]),_v(" are some sample labels with suitable colors.")]),_v(" "),_c('li',[_v("Label groups that represent a scale (e.g., difficulty, effort, severity) can be given increasingly darker shades of the same color ("),_c('a',{attrs:{"href":"https://github.com/oss-generic/process/labels?q=e."}},[_v("example")]),_v(")")])])]),_v(" "),_c('li',[_v("Use UpperCamelCase for label names; Keep group prefixes short and use lower case.")])]),_c('p')])} },function anonymous( ) { -with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Tue, 24 Sept 2024, 23:18:52 GMT+8]")])])])} +with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Thu, 26 Sept 2024, 17:41:12 GMT+8]")])])])} }]; \ No newline at end of file diff --git a/index.html b/index.html index f42f0e5c..26457823 100644 --- a/index.html +++ b/index.html @@ -18,7 +18,7 @@
  • Intellij IDEA:
  • Sourcetree
  • Testing
  • GitHub Actions
  • Gradle
  • Project documentation: -
  • Conventions

    Coding standards, format conventions, style guides, ...

    Guidelines

    Best practices, processes, workflows, ...

    +

    Conventions

    Coding standards, format conventions, style guides, ...

    Guidelines

    Best practices, processes, workflows, ...

    diff --git a/index.page-vue-render.js b/index.page-vue-render.js index 863850ae..65d8a7a2 100644 --- a/index.page-vue-render.js +++ b/index.page-vue-render.js @@ -20,6 +20,6 @@ with(this){return _c('ul',[_c('li',[_c('a',{attrs:{"href":"/guides/conventions/c with(this){return _c('ul',[_c('li',[_c('a',{attrs:{"href":"/guides/guidelines/codeOfConduct.html"}},[_c('strong',[_v("Code of conduct")])]),_c('br')]),_v(" "),_c('li',[_c('a',{attrs:{"href":"/guides/guidelines/commits.html"}},[_c('strong',[_v("Working with Git")])])]),_v(" "),_c('li',[_c('strong',[_v("GitHub:")]),_v(" "),_c('ul',[_c('li',[_c('a',{attrs:{"href":"/guides/guidelines/PRs.html"}},[_v("Working with "),_c('strong',[_v("PRs")])]),_v(" "),_c('ul',[_c('li',[_c('a',{attrs:{"href":"/guides/guidelines/PRs-reviewing.html"}},[_v("Best practices for "),_c('strong',[_v("reviewing PRs")])])])])]),_v(" "),_c('li',[_c('a',{attrs:{"href":"/guides/guidelines/labels.html"}},[_v("Working with "),_c('strong',[_v("labels")])])])])])])} },function anonymous( ) { -with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Tue, 24 Sept 2024, 23:18:52 GMT+8]")])])])} +with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Thu, 26 Sept 2024, 17:41:12 GMT+8]")])])])} }]; \ No newline at end of file diff --git a/tutorials/ab3.html b/tutorials/ab3.html index f189401b..bc3b0e21 100644 --- a/tutorials/ab3.html +++ b/tutorials/ab3.html @@ -14,7 +14,7 @@

    Guides for SE student projects »

    AddressBook-Level3 (AB3) Tutorials

    AddressBook-Level3 (AB3) is a brownfield project template used by SE courses. Given below are some tutorials to help students understand how to navigate and modify the existing AB3 codebase.

    • Tracing code - A tutorial on how to use Intellij IDEA to trace execution paths in AB3 code.
    • Adding a command - A tutorial on how to introduce a new user command to the AB3 code.
    • Removing fields - A tutorial on how to safely remove a field of the Person class.

    Authors:

    +

    Guides for SE student projects »

    AddressBook-Level3 (AB3) Tutorials

    AddressBook-Level3 (AB3) is a brownfield project template used by SE courses. Given below are some tutorials to help students understand how to navigate and modify the existing AB3 codebase.

    • Tracing code - A tutorial on how to use Intellij IDEA to trace execution paths in AB3 code.
    • Adding a command - A tutorial on how to introduce a new user command to the AB3 code.
    • Removing fields - A tutorial on how to safely remove a field of the Person class.

    Authors:

    diff --git a/tutorials/ab3.page-vue-render.js b/tutorials/ab3.page-vue-render.js index 4dc28854..bbb4707b 100644 --- a/tutorials/ab3.page-vue-render.js +++ b/tutorials/ab3.page-vue-render.js @@ -8,6 +8,6 @@ with(this){return _c('div',{attrs:{"id":"app"}},[_c('header',{attrs:{"sticky":"" with(this){return _c('div',{staticClass:"fixed-header-padding",attrs:{"id":"content-wrapper"}},[_c('h1',{attrs:{"id":"guides-for-se-student-projects"}},[_c('span',{staticClass:"text-dark"},[_c('strong',[_c('strong',[_v("Guides for SE student projects »")])])]),_c('a',{staticClass:"fa fa-anchor",attrs:{"href":"#guides-for-se-student-projects","onclick":"event.stopPropagation()"}})]),_v(" "),_c('p'),_c('h1',{attrs:{"id":"addressbook-level3-ab3-tutorials"}},[_v("AddressBook-Level3 (AB3) Tutorials"),_c('a',{staticClass:"fa fa-anchor",attrs:{"href":"#addressbook-level3-ab3-tutorials","onclick":"event.stopPropagation()"}})]),_v(" "),_c('p',[_c('a',{attrs:{"href":"https://se-education.org/addressbook-level3"}},[_v("AddressBook-Level3 (AB3)")]),_v(" is a brownfield project template used by SE courses. Given below are some tutorials to help students understand how to navigate and modify the existing AB3 codebase.")]),_v(" "),_c('ul',[_c('li',[_c('a',{attrs:{"href":"/guides/tutorials/ab3TracingCode.html"}},[_c('strong',[_v("Tracing code")])]),_v(" - A tutorial on how to use Intellij IDEA to trace execution paths in AB3 code.")]),_v(" "),_c('li',[_c('a',{attrs:{"href":"/guides/tutorials/ab3AddRemark.html"}},[_c('strong',[_v("Adding a command")])]),_v(" - A tutorial on how to introduce a new user command to the AB3 code.")]),_v(" "),_c('li',[_c('a',{attrs:{"href":"/guides/tutorials/ab3RemovingFields.html"}},[_c('strong',[_v("Removing fields")])]),_v(" - A tutorial on how to safely remove a field of the "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Person")]),_v(" class.")])]),_v(" "),_c('hr'),_v(" "),_c('p',[_c('strong',[_v("Authors:")])]),_v(" "),_c('ul',[_c('li',[_v("Initial Version: Jeffry Lum")]),_v(" "),_c('li',[_v("Adapted to MarkBind: "),_c('a',{attrs:{"href":"https://github.com/tlylt"}},[_v("Liu Yongliang")])])]),_c('p')])} },function anonymous( ) { -with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Tue, 24 Sept 2024, 23:18:52 GMT+8]")])])])} +with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Thu, 26 Sept 2024, 17:41:12 GMT+8]")])])])} }]; \ No newline at end of file diff --git a/tutorials/ab3AddRemark.html b/tutorials/ab3AddRemark.html index d0a0dadb..b9d37736 100644 --- a/tutorials/ab3AddRemark.html +++ b/tutorials/ab3AddRemark.html @@ -344,7 +344,7 @@

    Updating tests to match ...


    Previous | ToC | What's next? Removing Fields


    Authors:

    +

    diff --git a/tutorials/ab3AddRemark.page-vue-render.js b/tutorials/ab3AddRemark.page-vue-render.js index 8ae31eaf..d6f153fc 100644 --- a/tutorials/ab3AddRemark.page-vue-render.js +++ b/tutorials/ab3AddRemark.page-vue-render.js @@ -260,6 +260,6 @@ with(this){return _c('p',[_c('strong',[_v("Authors:")])])} with(this){return _c('ul',[_c('li',[_v("Initial Version: Jeffry Lum")]),_v(" "),_c('li',[_v("Contributors:\n"),_c('ul',[_c('li',[_v("Rui Shan Teo (@ruishanteo): Added more explanations for writing tests")])])])])} },function anonymous( ) { -with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Tue, 24 Sept 2024, 23:18:52 GMT+8]")])])])} +with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Thu, 26 Sept 2024, 17:41:12 GMT+8]")])])])} }]; \ No newline at end of file diff --git a/tutorials/ab3RemovingFields.html b/tutorials/ab3RemovingFields.html index 20566844..0a3e357a 100644 --- a/tutorials/ab3RemovingFields.html +++ b/tutorials/ab3RemovingFields.html @@ -82,7 +82,7 @@ -

    You can go through each individual json file and manually remove the address field.

    Previous | ToC


    Authors:

    +

    You can go through each individual json file and manually remove the address field.

    Previous | ToC


    Authors:

    diff --git a/tutorials/ab3RemovingFields.page-vue-render.js b/tutorials/ab3RemovingFields.page-vue-render.js index 5335bcd9..09b61963 100644 --- a/tutorials/ab3RemovingFields.page-vue-render.js +++ b/tutorials/ab3RemovingFields.page-vue-render.js @@ -107,6 +107,6 @@ with(this){return _c('p',[_c('strong',[_v("Authors:")])])} with(this){return _c('ul',[_c('li',[_v("Initial Version: Jeffry Lum")])])} },function anonymous( ) { -with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Tue, 24 Sept 2024, 23:18:52 GMT+8]")])])])} +with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Thu, 26 Sept 2024, 17:41:12 GMT+8]")])])])} }]; \ No newline at end of file diff --git a/tutorials/ab3TracingCode.html b/tutorials/ab3TracingCode.html index 8cd2b9cf..80f807e3 100644 --- a/tutorials/ab3TracingCode.html +++ b/tutorials/ab3TracingCode.html @@ -14,7 +14,10 @@

    Guides for SE student projects »

    Noticed any bugs/issues or unclear areas while following this tutorial? Help us improve it by reporting it at our issue tracker.

    AB3 Tutorial: Tracing Code

    Indeed, the ratio of time spent reading versus writing is well over 10 to 1. We are constantly reading old code as part of the effort to write new code. …[Therefore,] making it easy to read makes it easier to write.

    — Robert C. Martin Clean Code: A Handbook of Agile Software Craftsmanship

    When trying to understand an unfamiliar code base, one common strategy used is to trace some representative execution path through the code base. One easy way to trace an execution path is to use a debugger to step through the code. In this tutorial, you will be using the IntelliJ IDEA’s debugger to trace the execution path of a specific user command to:
    (a) learn how to use a debugger to trace code, and
    (b) get a preliminary sense of how AB3's code works.

    Before we start

    Before we jump into the code, it is useful to get an idea of the overall structure and the high-level behavior of the application. This is provided in the 'Architecture' section of the developer guide. In particular, the architecture diagram (reproduced below), tells us that the App consists of several components.

    ArchitectureDiagram

    It also has a sequence diagram (reproduced below) that tells us how a command propagates through the App.

    Note how the diagram shows only the execution flows between the main components. That is, it does not show details of the execution path inside each component. By hiding those details, the diagram aims to inform the reader about the overall execution path of a command without overwhelming the reader with too much details. In this tutorial, you aim to find those omitted details so that you get a more in-depth understanding of how the code works.

    Before we proceed, ensure that you have done the following:

    1. Learn the AB3 architecture: As we go through this tutorial, we will be referring you to read corresponding sections of the AB3 Developer Guide, so that you can mentally connect the code you encounter with corresponding design descriptions. Given below is the first of such DG cross-references that you need to read.
      DG Read the Architecture section of the DG (no need to read the other sections yet).
    2. Set up your AB3 project (i.e., the one you cloned to your computer) in Intellij IDEA.
    3. Learn basic debugging features of Intellij IDEA: +

    Guides for SE student projects »

    Noticed any bugs/issues or unclear areas while following this tutorial? Help us improve it by reporting it at our issue tracker.

    AB3 Tutorial: Tracing Code

    Indeed, the ratio of time spent reading versus writing is well over 10 to 1. We are constantly reading old code as part of the effort to write new code. …[Therefore,] making it easy to read makes it easier to write.

    — Robert C. Martin Clean Code: A Handbook of Agile Software Craftsmanship

    When trying to understand an unfamiliar code base, one common strategy used is to trace some representative execution path through the code base. One easy way to trace an execution path is to use a debugger to step through the code. In this tutorial, you will be using the IntelliJ IDEA’s debugger to trace the execution path of a specific user command to:
    (a) learn how to use a debugger to trace code, and
    (b) get a preliminary sense of how AB3's code works.

    Before we start

    Before we jump into the code, it is useful to get an idea of the overall structure and the high-level behavior of the application. This is provided in the 'Architecture' section of the developer guide. In particular, the architecture diagram (reproduced below), tells us that the App consists of several components.

    ArchitectureDiagram

    It also has a sequence diagram (reproduced below) that tells us how a command propagates through the App.

    Note how the diagram shows only the execution flows between the main components. That is, it does not show details of the execution path inside each component. By hiding those details, the diagram aims to inform the reader about the overall execution path of a command without overwhelming the reader with too much details. In this tutorial, you aim to find those omitted details so that you get a more in-depth understanding of how the code works.

    Before we proceed, ensure that you have done the following:

    1. Learn the AB3 architecture: As we go through this tutorial, we will be referring you to read corresponding sections of the AB3 Developer Guide, so that you can mentally connect the code you encounter with corresponding design descriptions. Given below is the first of such DG cross-references that you need to read.
      DG Read the Architecture section of the DG (no need to read the other sections yet).
    2. Set up your AB3 project (i.e., the one you cloned to your computer) in Intellij IDEA, and confirm the setup is correct by doing the following: +
      • Run ./gradlew run -- AB3 app should launch, and you should be able to interact with it.
        +If this step doesn't go as expected, ensure the default Java version is set correctly (more info: Mac | Windows).
      • Run ./gradlew check -- all tests should pass.
      • Run AB3 using Intellij UI (i.e., the button) and ensure the app launches.
        +If the first two steps work fine but this step doesn't, ensure you have set Intellij to use the correct JDK version (more info: here).
    3. Learn basic debugging features of Intellij IDEA:
      • If you are using a different IDE, we'll leave it to you to figure out the equivalent feature to use in your IDE.
      • If you are not using an IDE, we'll let you figure out how to achieve the same using your coding toolchain.

    Setting a breakpoint

    As you know, the first step of debugging is to put in a breakpoint where you want the debugger to pause the execution (e.g., to debug an issue with data saving, you might put a breakpoint in the method that saves data). When using the debugger to trace the code (to learn how it works), we start the same way, by putting a breakpoint in the code where we want to start tracing the execution path.

    In our case, it's natural that we start tracing the code at the point where the App start processing user input (i.e., somewhere in the UI component), and then trace through how the execution proceeds through the UI component. That is the part of the UI component's activation bar indicated by the yellow circle in the component-level sequence diagram below.

    However, the execution path through a GUI is often somewhat obscure due to various used by GUI frameworks. Therefore, let us skip that part of the execution path for now, and put the breakpoint where the UI transfers control to the Logic component.

    According to the sequence diagram, the UI component yields control to the Logic component through a method named execute (also indicated by the yellow circle in the diagram above). So, let's put our breakpoint in the execute method of the Logic component.

    Searching through the code base for an execute() method that belongs to the Logic component yields a promising candidate in seedu.address.logic.Logic, as shown below.

    Intellij Tip: The 'Search Everywhere' feature can be used here. In particular, the 'Find Symbol' ('Symbol' here refers to methods, variables, classes etc.) variant of that feature is quite useful here as we are looking for a method named execute, not simply the text execute.

    A quick look at the seedu.address.logic.Logic (an extract given below) confirms that this indeed might be what we’re looking for.

    public interface Logic {
         /**
          * Executes the command and returns the result.
    @@ -62,7 +65,7 @@
              //We can deduce that the previous line of code modifies model in some way
              // since it's being stored here.
              storage.saveAddressBook(model.getAddressBook());
    -     } catch (IOException ioe) {
    +     }} catch (IOException ioe) {
              throw new CommandException(FILE_OPS_ERROR_MESSAGE + ioe, ioe);
          }
     
    @@ -209,7 +212,7 @@
     
         
  • Finally, you can step through until you reach the end ofMainWindow#executeCommand().
    DG This is a good time to read through the UI component section of the DG

  • More things to try

    Here are some quick questions you can try to answer based on your execution path tracing. In some cases, you can do further tracing for the given commands to find exactly what happens.

    [A] In this tutorial, we traced the "happy path" (i.e., no errors). What do you think will happen if we traced the following commands instead? What exceptions do you think will be thrown (if any), where will the exceptions be thrown and where will they be handled?

    A1. redit 1 n/Alice Yu


    A2. edit 0 n/Alice Yu


    A3. edit 1 n/Alex Yeoh


    A4. edit 1


    A5. edit 1 n/アリス ユー


    A6. edit 1 t/one t/two t/three t/one



    [B] What components will you have to modify to perform the following enhancements to the application?

    B1. Make command words case-insensitive


    B2. Allow delete to remove more than one index at a time


    B3. Save the address book in the CSV format instead


    B4. Add a new field to Person


    B5. Add a new entity to the address book


    B6. Add a new command



    ToC | What's next? Adding a Command


    Authors:

    +

    diff --git a/tutorials/ab3TracingCode.page-vue-render.js b/tutorials/ab3TracingCode.page-vue-render.js index 07694607..af276b62 100644 --- a/tutorials/ab3TracingCode.page-vue-render.js +++ b/tutorials/ab3TracingCode.page-vue-render.js @@ -23,7 +23,7 @@ with(this){return _c('h2',{attrs:{"id":"before-we-start"}},[_v("Before we start" with(this){return _c('p',[_v("Note how the diagram shows only the execution flows "),_c('em',[_v("between")]),_v(" the main components. That is, it does not show details of the execution path "),_c('em',[_v("inside")]),_v(" each component. By hiding those details, the diagram aims to inform the reader about the overall execution path of a command without overwhelming the reader with too much details. In this tutorial, you aim to find those omitted details so that you get a more in-depth understanding of how the code works.")])} },function anonymous( ) { -with(this){return _c('ol',[_c('li',[_c('strong',[_v("Learn the AB3 architecture")]),_v(": As we go through this tutorial, we will be referring you to read corresponding sections of the AB3 Developer Guide, so that you can mentally connect the code you encounter with corresponding design descriptions. Given below is the first of such DG cross-references that you need to read."),_c('br'),_v(" "),_c('span',{staticClass:"badge rounded-pill bg-info"},[_c('span',{staticClass:"fas fa-arrow-right-long",attrs:{"aria-hidden":"true"}}),_v(" DG")]),_v(" Read the "),_c('a',{attrs:{"href":"https://se-education.org/addressbook-level3/DeveloperGuide.html#architecture"}},[_c('strong',[_c('em',[_v("Architecture")]),_v(" section")]),_v(" of the DG")]),_v(" (no need to read the other sections yet).")]),_v(" "),_c('li',[_c('strong',[_v("Set up your AB3 project")]),_v(" (i.e., the one you cloned to your computer) in Intellij IDEA.")]),_v(" "),_c('li',[_c('strong',[_v("Learn "),_c('a',{attrs:{"href":"/guides/tutorials/intellijDebugger.html"}},[_v("basic debugging features of Intellij IDEA")])]),_v(":\n"),_c('ul',[_c('li',[_v("If you are using a different IDE, we'll leave it to you to figure out the equivalent feature to use in your IDE.")]),_v(" "),_c('li',[_v("If you are not using an IDE, we'll let you figure out how to achieve the same using your coding toolchain.")])])])])} +with(this){return _c('ol',[_c('li',[_c('strong',[_v("Learn the AB3 architecture")]),_v(": As we go through this tutorial, we will be referring you to read corresponding sections of the AB3 Developer Guide, so that you can mentally connect the code you encounter with corresponding design descriptions. Given below is the first of such DG cross-references that you need to read."),_c('br'),_v(" "),_c('span',{staticClass:"badge rounded-pill bg-info"},[_c('span',{staticClass:"fas fa-arrow-right-long",attrs:{"aria-hidden":"true"}}),_v(" DG")]),_v(" Read the "),_c('a',{attrs:{"href":"https://se-education.org/addressbook-level3/DeveloperGuide.html#architecture"}},[_c('strong',[_c('em',[_v("Architecture")]),_v(" section")]),_v(" of the DG")]),_v(" (no need to read the other sections yet).")]),_v(" "),_c('li',[_c('strong',[_v("Set up your AB3 project")]),_v(" (i.e., the one you cloned to your computer) in Intellij IDEA, and confirm the setup is correct by doing the following:\n"),_c('ul',{staticStyle:{"list-style-type":"none","padding-inline-start":"0px"}},[_c('li',{staticStyle:{"display":"flex"},attrs:{"texts":"['2.1', '2.2', '2.3']"}},[_c('span',{staticStyle:{"line-height":"unset","margin-inline-end":"0.35em","align-self":"flex-start","flex-shrink":"0"},attrs:{"aria-hidden":"true"}},[_v("2.1")]),_c('div',[_v("Run "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("./gradlew run")]),_v(" -- AB3 app should launch, and you should be able to interact with it."),_c('br'),_v("\nIf this step doesn't go as expected, ensure the default Java version is set correctly (more info: "),_c('a',{attrs:{"href":"/guides/tutorials/javaInstallationMac.html"}},[_c('span',{staticClass:"fab fa-apple",attrs:{"aria-hidden":"true"}}),_v(" Mac")]),_v(" | "),_c('a',{attrs:{"href":"/guides/tutorials/javaInstallationWindows.html"}},[_c('span',{staticClass:"fab fa-windows",attrs:{"aria-hidden":"true"}}),_v(" Windows")]),_v(").")])]),_v(" "),_c('li',{staticStyle:{"display":"flex"}},[_c('span',{staticStyle:{"line-height":"unset","margin-inline-end":"0.35em","align-self":"flex-start","flex-shrink":"0"},attrs:{"aria-hidden":"true"}},[_v("2.2")]),_c('div',[_v("Run "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("./gradlew check")]),_v(" -- all tests should pass.")])]),_v(" "),_c('li',{staticStyle:{"display":"flex"}},[_c('span',{staticStyle:{"line-height":"unset","margin-inline-end":"0.35em","align-self":"flex-start","flex-shrink":"0"},attrs:{"aria-hidden":"true"}},[_v("2.3")]),_c('div',[_v("Run AB3 using Intellij UI (i.e., the "),_c('span',{staticClass:"text-success"},[_c('span',{staticClass:"fas fa-play",attrs:{"aria-hidden":"true"}})]),_v(" button) and ensure the app launches."),_c('br'),_v("\nIf the first two steps work fine but this step doesn't, ensure you have set Intellij to use the correct JDK version (more info: "),_c('a',{attrs:{"href":"/guides/tutorials/intellijJdk.html"}},[_v("here")]),_v(").")])])])]),_v(" "),_c('li',[_c('strong',[_v("Learn "),_c('a',{attrs:{"href":"/guides/tutorials/intellijDebugger.html"}},[_v("basic debugging features of Intellij IDEA")])]),_v(":\n"),_c('ul',[_c('li',[_v("If you are using a different IDE, we'll leave it to you to figure out the equivalent feature to use in your IDE.")]),_v(" "),_c('li',[_v("If you are not using an IDE, we'll let you figure out how to achieve the same using your coding toolchain.")])])])])} },function anonymous( ) { with(this){return _c('h2',{attrs:{"id":"setting-a-breakpoint"}},[_v("Setting a breakpoint"),_c('a',{staticClass:"fa fa-anchor",attrs:{"href":"#setting-a-breakpoint","onclick":"event.stopPropagation()"}})])} @@ -83,7 +83,7 @@ with(this){return _c('p',[_v("We end up in "),_c('code',{pre:true,attrs:{"class" with(this){return _c('p',[_c('strong',[_v("LogicManager#execute().")])])} },function anonymous( ) { -with(this){return _c('code',{pre:true,attrs:{"class":"hljs java"}},[_c('span',[_c('span',{pre:true,attrs:{"class":"hljs-meta"}},[_v("@Override")]),_v("\n")]),_c('span',[_c('span',{pre:true,attrs:{"class":"hljs-function"}},[_c('span',{pre:true,attrs:{"class":"hljs-keyword"}},[_v("public")]),_v(" CommandResult "),_c('span',{pre:true,attrs:{"class":"hljs-title"}},[_v("execute")]),_c('span',{pre:true,attrs:{"class":"hljs-params"}},[_v("(String commandText)")])]),_v("\n")]),_c('span',[_c('span',{pre:true,attrs:{"class":"hljs-function"}},[_v(" "),_c('span',{pre:true,attrs:{"class":"hljs-keyword"}},[_v("throws")]),_v(" CommandException, ParseException ")]),_v("{\n")]),_c('span',[_v("\n")]),_c('span',[_v(" "),_c('span',{pre:true,attrs:{"class":"hljs-comment"}},[_v("//Logging, safe to ignore")]),_v("\n")]),_c('span',[_v(" logger.info("),_c('span',{pre:true,attrs:{"class":"hljs-string"}},[_v("\"----------------[USER COMMAND][\"")]),_v(" + commandText + "),_c('span',{pre:true,attrs:{"class":"hljs-string"}},[_v("\"]\"")]),_v(");\n")]),_c('span',[_v("\n")]),_c('span',[_v(" CommandResult commandResult;\n")]),_c('span',[_v(" "),_c('span',{pre:true,attrs:{"class":"hljs-comment"}},[_v("//Parse user input from String to a Command")]),_v("\n")]),_c('span',[_v(" Command command = addressBookParser.parseCommand(commandText);\n")]),_c('span',[_v(" "),_c('span',{pre:true,attrs:{"class":"hljs-comment"}},[_v("//Executes the Command and stores the result")]),_v("\n")]),_c('span',[_v(" commandResult = command.execute(model);\n")]),_c('span',[_v("\n")]),_c('span',[_v(" "),_c('span',{pre:true,attrs:{"class":"hljs-keyword"}},[_v("try")]),_v(" {\n")]),_c('span',[_v(" "),_c('span',{pre:true,attrs:{"class":"hljs-comment"}},[_v("//We can deduce that the previous line of code modifies model in some way")]),_v("\n")]),_c('span',[_v(" "),_c('span',{pre:true,attrs:{"class":"hljs-comment"}},[_v("// since it's being stored here.")]),_v("\n")]),_c('span',[_v(" storage.saveAddressBook(model.getAddressBook());\n")]),_c('span',[_v(" } "),_c('span',{pre:true,attrs:{"class":"hljs-keyword"}},[_v("catch")]),_v(" (IOException ioe) {\n")]),_c('span',[_v(" "),_c('span',{pre:true,attrs:{"class":"hljs-keyword"}},[_v("throw")]),_v(" "),_c('span',{pre:true,attrs:{"class":"hljs-keyword"}},[_v("new")]),_v(" CommandException(FILE_OPS_ERROR_MESSAGE + ioe, ioe);\n")]),_c('span',[_v(" }\n")]),_c('span',[_v("\n")]),_c('span',[_v(" "),_c('span',{pre:true,attrs:{"class":"hljs-keyword"}},[_v("return")]),_v(" commandResult;\n")]),_c('span',[_v(" }\n")])])} +with(this){return _c('code',{pre:true,attrs:{"class":"hljs java"}},[_c('span',[_c('span',{pre:true,attrs:{"class":"hljs-meta"}},[_v("@Override")]),_v("\n")]),_c('span',[_c('span',{pre:true,attrs:{"class":"hljs-function"}},[_c('span',{pre:true,attrs:{"class":"hljs-keyword"}},[_v("public")]),_v(" CommandResult "),_c('span',{pre:true,attrs:{"class":"hljs-title"}},[_v("execute")]),_c('span',{pre:true,attrs:{"class":"hljs-params"}},[_v("(String commandText)")])]),_v("\n")]),_c('span',[_c('span',{pre:true,attrs:{"class":"hljs-function"}},[_v(" "),_c('span',{pre:true,attrs:{"class":"hljs-keyword"}},[_v("throws")]),_v(" CommandException, ParseException ")]),_v("{\n")]),_c('span',[_v("\n")]),_c('span',[_v(" "),_c('span',{pre:true,attrs:{"class":"hljs-comment"}},[_v("//Logging, safe to ignore")]),_v("\n")]),_c('span',[_v(" logger.info("),_c('span',{pre:true,attrs:{"class":"hljs-string"}},[_v("\"----------------[USER COMMAND][\"")]),_v(" + commandText + "),_c('span',{pre:true,attrs:{"class":"hljs-string"}},[_v("\"]\"")]),_v(");\n")]),_c('span',[_v("\n")]),_c('span',[_v(" CommandResult commandResult;\n")]),_c('span',[_v(" "),_c('span',{pre:true,attrs:{"class":"hljs-comment"}},[_v("//Parse user input from String to a Command")]),_v("\n")]),_c('span',[_v(" Command command = addressBookParser.parseCommand(commandText);\n")]),_c('span',[_v(" "),_c('span',{pre:true,attrs:{"class":"hljs-comment"}},[_v("//Executes the Command and stores the result")]),_v("\n")]),_c('span',[_v(" commandResult = command.execute(model);\n")]),_c('span',[_v("\n")]),_c('span',[_v(" "),_c('span',{pre:true,attrs:{"class":"hljs-keyword"}},[_v("try")]),_v(" {\n")]),_c('span',[_v(" "),_c('span',{pre:true,attrs:{"class":"hljs-comment"}},[_v("//We can deduce that the previous line of code modifies model in some way")]),_v("\n")]),_c('span',[_v(" "),_c('span',{pre:true,attrs:{"class":"hljs-comment"}},[_v("// since it's being stored here.")]),_v("\n")]),_c('span',[_v(" storage.saveAddressBook(model.getAddressBook());\n")]),_c('span',[_v(" }} "),_c('span',{pre:true,attrs:{"class":"hljs-keyword"}},[_v("catch")]),_v(" (IOException ioe) {\n")]),_c('span',[_v(" "),_c('span',{pre:true,attrs:{"class":"hljs-keyword"}},[_v("throw")]),_v(" "),_c('span',{pre:true,attrs:{"class":"hljs-keyword"}},[_v("new")]),_v(" CommandException(FILE_OPS_ERROR_MESSAGE + ioe, ioe);\n")]),_c('span',[_v(" }\n")]),_c('span',[_v("\n")]),_c('span',[_v(" "),_c('span',{pre:true,attrs:{"class":"hljs-keyword"}},[_v("return")]),_v(" commandResult;\n")]),_c('span',[_v(" }\n")])])} },function anonymous( ) { with(this){return _c('li',[_c('p',[_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("LogicManager#execute()")]),_v(" appears to delegate most of the heavy lifting to other components. Let’s take a closer look at each one.")])])} @@ -200,6 +200,6 @@ with(this){return _c('p',[_c('strong',[_v("Authors:")])])} with(this){return _c('ul',[_c('li',[_v("Initial Version: Jeffry Lum")]),_v(" "),_c('li',[_v("Contributors:\n"),_c('ul',[_c('li',[_v("Ruth Lim (@ruth-lim): Added answers to questions in the 'More things to try' section")])])])])} },function anonymous( ) { -with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Tue, 24 Sept 2024, 23:18:52 GMT+8]")])])])} +with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Thu, 26 Sept 2024, 17:41:12 GMT+8]")])])])} }]; \ No newline at end of file diff --git a/tutorials/checkstyle.html b/tutorials/checkstyle.html index 435f7dc1..bf3f4537 100644 --- a/tutorials/checkstyle.html +++ b/tutorials/checkstyle.html @@ -39,7 +39,7 @@

    Some relevant Gradle tasks added by the CheckStyle plugin.

    For example, you can run gradlew checkstyleMain checkstyleTest to verify that all your code complies with the style rules.

    Using Checkstyle-IDEA plugin

    Prerequisite: The two config files checkstyle.xml and suppressions.xml are present (see the Configuring Checkstyle section above for more details on these two files).

    Given below are the steps to install the Checkstyle-IDEA plugin so that Intellij can alert you about code style problems as you write code.

    1. Install the Checkstyle-IDEA plugin as follows:

      1. File > Settings (Windows/Linux), or IntelliJ IDEA > Settings…​ (macOS)
      2. Select Plugins (on the left slide menu in the dialog that pops up)
      3. Select Marketplace (on to top center of the same dialog box)
      4. Find the plugin.
      5. Restart the IDE to complete the installation.
    2. Click File > Settings (Windows/Linux), or IntelliJ IDEA > Settings…​ (macOS)

    3. Click Tools > Checkstyle

    4. Set Scan Scope to Only Java sources (including tests), so that the plugin will run checkstyle for our test source codes as well

    5. Ensure that the Checkstyle version is set to the one used by the project.
      If your project uses Gradle, you can check the build.gradle file to find the correct version.
      checkstyle idea scan scope

    6. Click the + sign under Configuration File

    7. Enter an arbitrary description e.g. addressbook

    8. Select Use a local Checkstyle file

    9. Use the checkstyle configuration file found at config/checkstyle/checkstyle.xml

    10. Click Next > Finish

    11. Mark Active for the newly imported check configuration
      checkstyle idea configuration

    12. Click OK

    13. To verify the plugin is set up correctly, temporarily modify the code to violate a style rule (e.g., add an extra line break before an {) and run the Checkstyle check using the plugin.

    Troubleshooting

    Problem: When importing checkstyle.xml, Checkstyle-IDEA plugin complains that The Checkstyle rules file could not be parsed. …​ The file has been blacklisted for 60s.

    Problem: After setting up checkstyle.xml, Checkstyle-IDEA plugin does not seem to highlight the errors / real-time scanning seems broken.

    Resources

    +Apply, as checkstyle.xml is written for Gradle’s checkstyle.

    Problem: After setting up checkstyle.xml, Checkstyle-IDEA plugin does not seem to highlight the errors / real-time scanning seems broken.

    Resources

    diff --git a/tutorials/checkstyle.page-vue-render.js b/tutorials/checkstyle.page-vue-render.js index c1c3cd76..2587963b 100644 --- a/tutorials/checkstyle.page-vue-render.js +++ b/tutorials/checkstyle.page-vue-render.js @@ -77,6 +77,6 @@ with(this){return _c('h2',{attrs:{"id":"resources"}},[_v("Resources"),_c('a',{st with(this){return _c('ul',[_c('li',[_c('a',{attrs:{"href":"https://checkstyle.sourceforge.io/"}},[_v("Checkstyle home page")])]),_v(" "),_c('li',[_c('a',{attrs:{"href":"https://docs.gradle.org/current/userguide/checkstyle_plugin.html"}},[_v("Gradle documentation for the Checkstyle plugin")])])])} },function anonymous( ) { -with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Tue, 24 Sept 2024, 23:18:52 GMT+8]")])])])} +with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Thu, 26 Sept 2024, 17:41:12 GMT+8]")])])])} }]; \ No newline at end of file diff --git a/tutorials/codecov.html b/tutorials/codecov.html index 0b9b480b..6140518c 100644 --- a/tutorials/codecov.html +++ b/tutorials/codecov.html @@ -20,7 +20,7 @@ You can skip the Step 1: Generate and upload coverage reports in your CI, as it is already set up in your repo.
    But you still need to do steps 2 i.e., set up the CODECOV_TOKEN secret as instructed but there.
    You can skip step 3 as well.
  • Check for coverage status: Go back to your Codecov home page, choose the org and click on the repo name. After the next time CI runs in your fork, you should see the code coverage percentage in front of your fork name. Here is an example: -
  • Display the Codecov badge: If your fork has a badge showing the Codecov status (e.g, codecov), get the Markdown code for the Codecov badge provided in https://app.codecov.io/gh/{YOUR_ORG}/{YOUR_FORK}/settings/badge (e.g., https://app.codecov.io/gh/se-edu/addressbook-level3/settings/badge) and update the appropriate page in your fork.
  • You can control if CI still passes even if Codecov task fails using the line
    fail_ci_if_error: true or fail_ci_if_error: false in .github/workflows/gradle.yml, under the section related to Codecov.

    +
  • Display the Codecov badge: If your fork has a badge showing the Codecov status (e.g, codecov), get the Markdown code for the Codecov badge provided in https://app.codecov.io/gh/{YOUR_ORG}/{YOUR_FORK}/settings/badge (e.g., https://app.codecov.io/gh/se-edu/addressbook-level3/settings/badge) and update the appropriate page in your fork.
  • You can control if CI still passes even if Codecov task fails using the line
    fail_ci_if_error: true or fail_ci_if_error: false in .github/workflows/gradle.yml, under the section related to Codecov.

    diff --git a/tutorials/codecov.page-vue-render.js b/tutorials/codecov.page-vue-render.js index 9356770c..94b46100 100644 --- a/tutorials/codecov.page-vue-render.js +++ b/tutorials/codecov.page-vue-render.js @@ -32,6 +32,6 @@ with(this){return _c('li',[_c('strong',[_v("Configure Codecov for the specific f with(this){return _c('li',[_c('strong',[_v("Display the Codecov badge:")]),_v(" If your fork has a badge showing the Codecov status (e.g, "),_c('a',{attrs:{"href":"https://codecov.io/gh/se-edu/addressbook-level3/branch/master/graph/badge.svg","target":"_self"}},[_c('img',{staticClass:"img-fluid",attrs:{"src":"https://codecov.io/gh/se-edu/addressbook-level3/branch/master/graph/badge.svg","alt":"codecov"}})]),_v("), get the Markdown code for the Codecov badge provided in "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("https://app.codecov.io/gh/{YOUR_ORG}/{YOUR_FORK}/settings/badge")]),_v(" (e.g., "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("https://app.codecov.io/gh/se-edu/addressbook-level3/settings/badge")]),_v(") and update the appropriate page in your fork.")])} },function anonymous( ) { -with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Tue, 24 Sept 2024, 23:18:52 GMT+8]")])])])} +with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Thu, 26 Sept 2024, 17:41:12 GMT+8]")])])])} }]; \ No newline at end of file diff --git a/tutorials/githubActions.html b/tutorials/githubActions.html index 17d5a083..72285933 100644 --- a/tutorials/githubActions.html +++ b/tutorials/githubActions.html @@ -14,7 +14,7 @@

    Guides for SE student projects »

    Using GitHub Actions

    GitHub Actions is CI/CD tool integrated into GitHub.

    Setting up a custom workflow

    In the simplest case, setting up is a matter of adding a .yml file into the [root]\.github\workflows folder (example).

    GitHub Actions will run the workflow (as per the .yml file) every time certain project events are triggered (e.g., when a PR is updated, or the master branch is updated).

    Resources

    +

    Guides for SE student projects »

    Using GitHub Actions

    GitHub Actions is CI/CD tool integrated into GitHub.

    Setting up a custom workflow

    In the simplest case, setting up is a matter of adding a .yml file into the [root]\.github\workflows folder (example).

    GitHub Actions will run the workflow (as per the .yml file) every time certain project events are triggered (e.g., when a PR is updated, or the master branch is updated).

    Resources

    diff --git a/tutorials/githubActions.page-vue-render.js b/tutorials/githubActions.page-vue-render.js index 69634ff8..69c57693 100644 --- a/tutorials/githubActions.page-vue-render.js +++ b/tutorials/githubActions.page-vue-render.js @@ -8,6 +8,6 @@ with(this){return _c('div',{attrs:{"id":"app"}},[_c('header',{attrs:{"sticky":"" with(this){return _c('div',{staticClass:"fixed-header-padding",attrs:{"id":"content-wrapper"}},[_c('h1',{attrs:{"id":"guides-for-se-student-projects"}},[_c('span',{staticClass:"text-dark"},[_c('strong',[_c('strong',[_v("Guides for SE student projects »")])])]),_c('a',{staticClass:"fa fa-anchor",attrs:{"href":"#guides-for-se-student-projects","onclick":"event.stopPropagation()"}})]),_v(" "),_c('p'),_c('h1',{attrs:{"id":"using-github-actions"}},[_v("Using GitHub Actions"),_c('a',{staticClass:"fa fa-anchor",attrs:{"href":"#using-github-actions","onclick":"event.stopPropagation()"}})]),_v(" "),_c('div',{staticClass:"lead"},[_c('p',[_c('a',{attrs:{"href":"https://github.com/features/actions"}},[_v("GitHub Actions")]),_v(" is CI/CD tool integrated into GitHub.")])]),_v(" "),_c('h2',{attrs:{"id":"setting-up-a-custom-workflow"}},[_v("Setting up a custom workflow"),_c('a',{staticClass:"fa fa-anchor",attrs:{"href":"#setting-up-a-custom-workflow","onclick":"event.stopPropagation()"}})]),_v(" "),_c('p',[_v("In the simplest case, setting up is a matter of adding a "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v(".yml")]),_v(" file into the "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("[root]\\.github\\workflows")]),_v(" folder ("),_c('a',{attrs:{"href":"https://github.com/se-edu/duke/blob/full-template/.github/workflows/gradle.yml"}},[_v("example")]),_v(").")]),_v(" "),_c('p',[_v("GitHub Actions will run the workflow (as per the "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v(".yml")]),_v(" file) every time certain project events are triggered (e.g., when a PR is updated, or the "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("master")]),_v(" branch is updated).")]),_v(" "),_c('h2',{attrs:{"id":"resources"}},[_v("Resources"),_c('a',{staticClass:"fa fa-anchor",attrs:{"href":"#resources","onclick":"event.stopPropagation()"}})]),_v(" "),_c('ul',[_c('li',[_c('a',{attrs:{"href":"https://help.github.com/en/actions"}},[_v("GitHub Actions documentation")])])]),_c('p')])} },function anonymous( ) { -with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Tue, 24 Sept 2024, 23:18:52 GMT+8]")])])])} +with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Thu, 26 Sept 2024, 17:41:12 GMT+8]")])])])} }]; \ No newline at end of file diff --git a/tutorials/gradle.html b/tutorials/gradle.html index c95fe5b7..e68db9bd 100644 --- a/tutorials/gradle.html +++ b/tutorials/gradle.html @@ -19,9 +19,8 @@ Given below are three scenarios of adding the Gradle wrapper to a project. Choose the one that fits your situation best.

    Scenario 1: You are setting up a project that already has Gradle wrapper files.

    If the project comes with Gradle support, you will see a build.gradle file in your project root.

    IntelliJ IDEA has the Gradle plugin installed by default. If you have disabled it, go to FileSettingsPlugins to re-enable it.
    If your project involves GUI programming, similarly ensure the JavaFX plugin has not been disabled.

    1. Open Intellij.
    2. If you are in the welcome screen, Click Open. Otherwise, click File -> Open.
      i. Select the project directory, and click OK.
      -ii. If there are any further prompts, accept the defaults but do ensure that the selected version of Gradle JVM matches the JDK being used for the project.
    3. Confirm the correct Java version is being used for Gradle, as follows:
      -(a) Confirm the project JDK is set to the one you are supposed to use for the project, as explained here.
      -(b) Confirm the correct JVM is used for Gradle, as given in the panel below:

    Intellij: Setting the JVM for Gradle

    Go to File -> Settings and ensure the Gradle JVM is set as Project SDK ..., so that Gradle will use the same JDK used by the project.

    Also take note of the Build and run using: and Run tests using: settings. They are useful if you want to control whether you want Intellij to use Gradle to build/run/test your project.


    1. After the importing of the project is complete (which could take a few minutes), you will see the Gradle Toolbar in the IDEA interface e.g., look for the elephant icon (on Windows, this appears on the right-edge of the IDE window) and click it.
      Gradle icon

    Run the java -version command in the same terminal you use for running Gradle commands, to ensure you are using the intended Java version for Gradle.

    No further action required. You should be able to use Gradle via the command line right away.


    Scenario 2: You are adding Gradle support to an ongoing project. Gradle wrapper files are available but have not been added to the project yet.

    First, add the Gradle wrapper files to the project. e.g., if they are in a separate branch, merge that branch.

    1. Close the IDEA project if it is open.
    2. Delete the .idea folder.
      Note that some operating systems hides folders/files starting with . by default. If you can't see the .idea folder, you might need to configure the OS to 'un-hide' those files/folders.
    3. Open/import the project again, as explained in scenario 1 above.

    No further actions required. You should be able to use Gradle via the command line now.


    Scenario 3: You are adding Gradle support to an ongoing project from scratch.

    • This is a good place to start.

    Running Gradle tasks

    There are several ways to run a Gradle task in Intellij. Examples:

    • Locate the task in the Gradle toolbar, and double-click it.
    • Hit Ctrl key twice (to bring up the command runner), and type gradlew followed by tasks to run e.g., gradlew clean test.

    See this video for more ways to run Gradle tasks inside Intellij.

    Alternatively, you can run Gradle tasks using the command line (even if you are using Intellij). Follow the instructions in the Using the terminal tab above.

    If the Gradle tasks don't appear in the Gradle window, click the 'refresh' button in the toolbar to reimport the Gradle project.

    Intellij uses Gradle to run your application by default. If you would like to run the project in the normal way, go to File > Settings and change the following settings:

    Expand to see screenshot ...

    change Intellij settings to not use Gradle



    You can open a terminal, navigate to the project root, and type the following command in the terminal.

    • On Windows: gradlew <task1> <task2> …​ e.g. gradlew clean test
    • On Mac/Linux: ./gradlew <task1> <task2> …​ e.g. ./gradlew clean test

    Managing plugins and dependencies

    Gradle functionality can be extended using plugins. Here are some plugins commonly used in Java projects.

    More info on specific plugins:

    • Java -- a built-in plugin that adds Java compilation along with testing and bundling capabilities to a project.
      Application -- a built-in plugin for creating an executable JVM application.
    • Checkstyle -- a built-in plugin for using Checkstyle in a project.
    • Shadow -- a third-party plugin for creating fat/uber JARs.

    The relevant lines for adding the above plugins to the build.gradle are given below:

    build.gradle
    plugins {
    +ii. If there are any further prompts, accept the defaults but do ensure that the selected version of Gradle JVM matches the JDK being used for the project. 
  • Confirm the correct Java version is being used for Gradle, as follows:
  • (a) Confirm the project JDK is set to the one you are supposed to use for the project, as explained here.
    +(b) Confirm the correct JVM is used for Gradle, as given in the panel below:

    Intellij: Setting the JVM for Gradle

    Go to File -> Settings and ensure the Gradle JVM is set as Project SDK ..., so that Gradle will use the same JDK used by the project.

    Also take note of the Build and run using: and Run tests using: settings. They are useful if you want to control whether you want Intellij to use Gradle to build/run/test your project.


    1. After the importing of the project is complete (which could take a few minutes), you will see the Gradle Toolbar in the IDEA interface e.g., look for the elephant icon (on Windows, this appears on the right-edge of the IDE window) and click it.
      Gradle icon

    Run the java -version command in the same terminal you use for running Gradle commands, to ensure you are using the intended Java version for Gradle.

    No further action required. You should be able to use Gradle via the command line right away.


    Scenario 2: You are adding Gradle support to an ongoing project. Gradle wrapper files are available but have not been added to the project yet.

    First, add the Gradle wrapper files to the project. e.g., if they are in a separate branch, merge that branch.

    1. Close the IDEA project if it is open.
    2. Delete the .idea folder.
      Note that some operating systems hides folders/files starting with . by default. If you can't see the .idea folder, you might need to configure the OS to 'un-hide' those files/folders.
    3. Open/import the project again, as explained in scenario 1 above.

    No further actions required. You should be able to use Gradle via the command line now.


    Scenario 3: You are adding Gradle support to an ongoing project from scratch.

    • This is a good place to start.

    Running Gradle tasks

    There are several ways to run a Gradle task in Intellij. Examples:

    • Locate the task in the Gradle toolbar, and double-click it.
    • Hit Ctrl key twice (to bring up the command runner), and type gradlew followed by tasks to run e.g., gradlew clean test.

    See this video for more ways to run Gradle tasks inside Intellij.

    Alternatively, you can run Gradle tasks using the command line (even if you are using Intellij). Follow the instructions in the Using the terminal tab above.

    If the Gradle tasks don't appear in the Gradle window, click the 'refresh' button in the toolbar to reimport the Gradle project.

    Intellij uses Gradle to run your application by default. If you would like to run the project in the normal way, go to File > Settings and change the following settings:

    Expand to see screenshot ...

    change Intellij settings to not use Gradle



    You can open a terminal, navigate to the project root, and type the following command in the terminal.

    • On Windows: gradlew <task1> <task2> …​ e.g. gradlew clean test
    • On Mac/Linux: ./gradlew <task1> <task2> …​ e.g. ./gradlew clean test

    Managing plugins and dependencies

    Gradle functionality can be extended using plugins. Here are some plugins commonly used in Java projects.

    More info on specific plugins:

    • Java -- a built-in plugin that adds Java compilation along with testing and bundling capabilities to a project.
      Application -- a built-in plugin for creating an executable JVM application.
    • Checkstyle -- a built-in plugin for using Checkstyle in a project.
    • Shadow -- a third-party plugin for creating fat/uber JARs.

    The relevant lines for adding the above plugins to the build.gradle are given below:

    build.gradle
    plugins {
         id 'java'
         id 'application'
         id 'checkstyle'
    @@ -124,7 +123,7 @@
     
     
         
    -

    Resources


    Authors:

    • Initial Version: Jeffry Lum

    +

    Resources


    Authors:

    • Initial Version: Jeffry Lum

    diff --git a/tutorials/gradle.page-vue-render.js b/tutorials/gradle.page-vue-render.js index 68c81226..d10ac672 100644 --- a/tutorials/gradle.page-vue-render.js +++ b/tutorials/gradle.page-vue-render.js @@ -1,7 +1,7 @@ var pageVueRenderFn = function anonymous( ) { -with(this){return _c('div',{attrs:{"id":"app"}},[_c('header',{attrs:{"sticky":""}},[_c('navbar',{attrs:{"type":"dark"},scopedSlots:_u([{key:"brand",fn:function(){return [_c('a',{staticClass:"navbar-brand",attrs:{"href":"https://se-education.org","title":"SE-EDU"}},[_c('span',[_c('span',{staticClass:"fas fa-chevron-circle-left",attrs:{"aria-hidden":"true"}}),_v(" "),_c('strong',[_c('strong',[_v("SE-EDU")])])])])]},proxy:true},{key:"right",fn:function(){return [_c('li',{staticClass:"nav-link"},[_c('form',{staticClass:"navbar-form"},[_c('searchbar',{attrs:{"data":searchData,"placeholder":"Search this site","on-hit":searchCallback,"menu-align-right":""}})],1)])]},proxy:true}])},[_v(" "),_c('li',[_c('a',{staticClass:"nav-link",attrs:{"href":"/guides/index.html"}},[_c('span',[_c('strong',[_v("Home")])])])]),_v(" "),_c('li',[_c('a',{staticClass:"nav-link",attrs:{"href":"/guides/about.html"}},[_c('span',[_c('strong',[_v("About")])])])]),_v(" "),_c('li',[_c('a',{staticClass:"nav-link",attrs:{"href":"https://github.com/se-edu/guides"}},[_c('span',[_c('span',{staticClass:"fab fa-github",attrs:{"aria-hidden":"true"}})])])])])],1),_v(" "),_c('div',{attrs:{"id":"flex-body"}},[_c('div',{staticClass:"fixed-header-padding",attrs:{"id":"content-wrapper"}},[_m(0),_v(" "),_c('p'),_m(1),_v(" "),_m(2),_v(" "),_m(3),_v(" "),_m(4),_v(" "),_m(5),_v(" "),_m(6),_v(" "),_c('panel',{attrs:{"peek":"","no-close":"","no-switch":""},scopedSlots:_u([{key:"header",fn:function(){return [_c('div',[_c('span',[_c('span',{staticClass:"text-danger"},[_c('span',{staticClass:"fab fa-youtube",attrs:{"aria-hidden":"true"}})]),_v(" VIDEO: Working with Gradle")])])]},proxy:true}])},[_v(" "),_c('div',{staticClass:"block-embed block-embed-service-youtube",staticStyle:{"position":"relative","padding-bottom":"60.9375%"}},[_c('iframe',{attrs:{"type":"text/html","src":"//www.youtube.com/embed/6V6G3RyxEMk","frameborder":"0","webkitallowfullscreen":"","mozallowfullscreen":"","allowfullscreen":""}})])]),_v(" "),_c('p'),_v(" "),_m(7),_v(" "),_m(8),_v(" "),_m(9),_v(" "),_c('tabs',[_c('tab',{scopedSlots:_u([{key:"header",fn:function(){return [_v("Using Intellij")]},proxy:true}])},[_v(" "),_c('div',{staticClass:"ml-3"},[_c('div',[_c('box',{attrs:{"type":"tip","seamless":""}},[_c('p',[_v("If the project comes with Gradle support, you will see a "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("build.gradle")]),_v(" file in your project root.")])]),_v(" "),_c('box',{attrs:{"type":"warning","seamless":""}},[_c('p',[_v("IntelliJ IDEA has the Gradle plugin installed by default. If you have disabled it, go to "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("File")]),_v(" → "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Settings")]),_v(" → "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Plugins")]),_v(" to re-enable it."),_c('br'),_v("\nIf your project involves GUI programming, similarly ensure the JavaFX plugin has not been disabled.")])]),_v(" "),_c('ol',[_c('li',[_v("Open Intellij.")]),_v(" "),_c('li',[_v("If you are in the welcome screen, Click "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Open")]),_v(". Otherwise, click "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("File")]),_v(" -> "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Open")]),_v("."),_c('br'),_v("\ni. Select the project directory, and click "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("OK")]),_v("."),_c('br'),_v("\nii. If there are any further prompts, accept the defaults but do ensure that the selected version of "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Gradle JVM")]),_v(" matches the JDK being used for the project.")]),_v(" "),_c('li',[_v("Confirm the correct Java version is being used for Gradle, as follows:"),_c('br'),_v("\n(a) Confirm the project JDK is set to the one you are supposed to use for the project, as explained "),_c('a',{attrs:{"href":"https://www.jetbrains.com/help/idea/sdk.html#set-up-jdk"}},[_v("here")]),_v("."),_c('br'),_v("\n(b) Confirm the correct JVM is used for Gradle, as given in the panel below:")])]),_v(" "),_c('div',{staticClass:"indented-level2"},[_c('panel',{attrs:{"peek":""},scopedSlots:_u([{key:"header",fn:function(){return [_c('p',[_v("Intellij: Setting the JVM for Gradle")])]},proxy:true}])},[_v(" "),_c('p',[_v("Go to "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("File")]),_v(" -> "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Settings")]),_v(" and ensure the "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Gradle JVM")]),_v(" is set as "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Project SDK ...")]),_v(", so that Gradle will use the same JDK used by the project.")]),_v(" "),_c('pic',{attrs:{"src":"/guides/tutorials/images/gradle/intellijSetGradleJvm.png"}}),_v(" "),_c('p',[_v("Also take note of the "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Build and run using:")]),_v(" and "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Run tests using:")]),_v(" settings. They are useful if you want to control whether you want Intellij to use Gradle to build/run/test your project.")])],1)],1),_v(" "),_c('ol',{attrs:{"start":"4"}},[_c('li',[_v("After the importing of the project is complete (which could take a few minutes), you will see the "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Gradle Toolbar")]),_v(" in the IDEA interface "),_c('span',{staticClass:"dimmed"},[_v("e.g., look for the elephant icon (on Windows, this appears on the right-edge of the IDE window) and click it")]),_v("."),_c('br'),_v(" "),_c('a',{attrs:{"href":"/guides/tutorials/images/gradle/GradleIcon.png","target":"_self"}},[_c('img',{staticClass:"img-fluid",attrs:{"src":"/guides/tutorials/images/gradle/GradleIcon.png","alt":"Gradle icon"}})])])])],1)])]),_v(" "),_c('tab',{scopedSlots:_u([{key:"header",fn:function(){return [_v("Not using an IDE")]},proxy:true}])},[_v(" "),_c('p',[_v("Run the "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("java -version")]),_v(" command in the same terminal you use for running Gradle commands, to ensure you are using the intended Java version for Gradle.")]),_v(" "),_c('p',[_v("No further action required. You should be able to use Gradle via the command line right away.")])]),_v(" "),_c('p'),_v(" "),_c('p',[_c('strong',[_c('strong',[_v("Scenario 2:")])]),_v(" You are adding Gradle support to an ongoing project. Gradle wrapper files are available but have not been added to the project yet.")]),_v(" "),_c('p',[_v("First, add the Gradle wrapper files to the project. e.g., if they are in a separate branch, merge that branch.")]),_v(" "),_c('tabs',[_c('tab',{scopedSlots:_u([{key:"header",fn:function(){return [_v("Using Intellij")]},proxy:true}])},[_v(" "),_c('ol',[_c('li',[_v("Close the IDEA project if it is open.")]),_v(" "),_c('li',[_v("Delete the "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v(".idea")]),_v(" folder."),_c('br'),_v(" "),_c('span',[_c('span',{staticClass:"fas fa-info-circle",attrs:{"aria-hidden":"true"}})]),_v(" Note that some operating systems hides folders/files starting with "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v(".")]),_v(" by default. If you can't see the "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v(".idea")]),_v(" folder, you might need to configure the OS to 'un-hide' those files/folders.")]),_v(" "),_c('li',[_v("Open/import the project again, as explained in scenario 1 above.")])])]),_v(" "),_c('tab',{scopedSlots:_u([{key:"header",fn:function(){return [_v("Not using an IDE")]},proxy:true}])},[_v(" "),_c('p',[_v("No further actions required. You should be able to use Gradle via the command line now.")])]),_v(" "),_c('p'),_v(" "),_c('p',[_c('strong',[_c('strong',[_v("Scenario 3:")])]),_v(" You are adding Gradle support to an ongoing project from scratch.")]),_v(" "),_c('ul',[_c('li',[_c('a',{attrs:{"href":"https://docs.gradle.org/current/userguide/gradle_wrapper.html"}},[_v("This")]),_v(" is a good place to start.")])]),_v(" "),_c('h2',{attrs:{"id":"running-gradle-tasks"}},[_v("Running Gradle tasks"),_c('a',{staticClass:"fa fa-anchor",attrs:{"href":"#running-gradle-tasks","onclick":"event.stopPropagation()"}})]),_v(" "),_c('tabs',[_c('tab',{scopedSlots:_u([{key:"header",fn:function(){return [_v("Using Intellij")]},proxy:true}])},[_v(" "),_c('p',[_v("There are several ways to run a Gradle task in Intellij. Examples:")]),_v(" "),_c('ul',[_c('li',[_v("Locate the task in the Gradle toolbar, and double-click it.")]),_v(" "),_c('li',[_v("Hit "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Ctrl")]),_v(" key twice (to bring up the command runner), and type "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("gradlew")]),_v(" followed by tasks to run e.g., "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("gradlew clean test")]),_v(".")])]),_v(" "),_c('p',[_v("See "),_c('a',{attrs:{"href":"https://www.youtube.com/watch?v=6V6G3RyxEMk#t=13m44s"}},[_v("this video")]),_v(" for more ways to run Gradle tasks inside Intellij.")]),_v(" "),_c('p',[_v("Alternatively, you can run Gradle tasks using the command line (even if you are using Intellij). Follow the instructions in the "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Using the terminal")]),_v(" tab above.")]),_v(" "),_c('box',{attrs:{"type":"tip","seamless":""}},[_c('p',[_v("If the Gradle tasks don't appear in the Gradle window, click the 'refresh' button in the toolbar to reimport the Gradle project.")])]),_v(" "),_c('box',{attrs:{"type":"tip","seamless":""}},[_c('p',[_v("Intellij uses Gradle to run your application by default. If you would like to run the project in the normal way, go to "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("File")]),_v(" > "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Settings")]),_v(" and change the following settings:")]),_v(" "),_c('panel',{attrs:{"peek":"","no-close":"","no-switch":""},scopedSlots:_u([{key:"header",fn:function(){return [_c('p',[_v("Expand to see screenshot ...")])]},proxy:true}])},[_v(" "),_c('p',[_c('a',{attrs:{"href":"/guides/tutorials/images/gradle/intellijRunUsingGradle.png","target":"_self"}},[_c('img',{staticClass:"img-fluid",attrs:{"src":"/guides/tutorials/images/gradle/intellijRunUsingGradle.png","alt":"change Intellij settings to not use Gradle"}})])])])],1)],1),_v(" "),_c('tab',{scopedSlots:_u([{key:"header",fn:function(){return [_v("Using the terminal")]},proxy:true}])},[_v(" "),_c('p',[_v("You can open a terminal, navigate to the project root, and type the following command in the terminal.")]),_v(" "),_c('ul',[_c('li',[_v("On Windows: "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("gradlew …")]),_v("​ e.g. "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("gradlew clean test")])]),_v(" "),_c('li',[_v("On Mac/Linux: "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("./gradlew …")]),_v("​ e.g. "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("./gradlew clean test")])])])]),_v(" "),_c('p'),_v(" "),_c('h2',{attrs:{"id":"managing-plugins-and-dependencies"}},[_v("Managing plugins and dependencies"),_c('a',{staticClass:"fa fa-anchor",attrs:{"href":"#managing-plugins-and-dependencies","onclick":"event.stopPropagation()"}})]),_v(" "),_c('p',[_c('strong',[_v("Gradle functionality can be extended using plugins.")]),_v(" Here are some plugins commonly used in Java projects.")]),_v(" "),_c('p',[_v("More info on specific plugins:")]),_v(" "),_c('ul',[_c('li',[_c('a',{attrs:{"href":"https://docs.gradle.org/current/userguide/java_plugin.html#java_plugin"}},[_v("Java")]),_v(" -- a built-in plugin that adds Java compilation along with testing and bundling capabilities to a project."),_c('br'),_v(" "),_c('a',{attrs:{"href":"https://docs.gradle.org/current/userguide/application_plugin.html#application_plugin"}},[_v("Application")]),_v(" -- a built-in plugin for creating an executable JVM application.")]),_v(" "),_c('li',[_c('a',{attrs:{"href":"https://docs.gradle.org/current/userguide/checkstyle_plugin.html#checkstyle_plugin"}},[_v("Checkstyle")]),_v(" -- a built-in plugin for using Checkstyle in a project.")]),_v(" "),_c('li',[_c('a',{attrs:{"href":"https://plugins.gradle.org/plugin/com.github.johnrengelman.shadow"}},[_v("Shadow")]),_v(" -- a third-party plugin for creating "),_c('trigger',{attrs:{"trigger":"click","for":"modal:gradleTutorial-fatJar"}},[_v("fat/uber JARs")]),_v(".")],1)]),_v(" "),_c('modal',{attrs:{"large":"","id":"modal:gradleTutorial-fatJar"},scopedSlots:_u([{key:"header",fn:function(){return [_v("Fat/Uber JAR files")]},proxy:true}])},[_v(" "),_c('div',[_c('p',[_c('strong',[_v("A normal JAR file contains only the classes and resources that you created for your app.")]),_v(" If your app has "),_c('em',[_v("dependencies")]),_v(" (i.e., third party libraries that your app depends on), the JAR file will not work unless the person running the JAR file also has those dependencies in their computer. This is not ideal.")]),_v(" "),_c('p',[_c('strong',[_v("A "),_c('em',[_v("fat")]),_v(" JAR (aka "),_c('em',[_v("uber")]),_v(" JAR) file solves the above problem by including all the dependencies inside the JAR file")]),_v(" itself "),_c('span',{staticClass:"dimmed"},[_v("(which makes the JAR file bigger than usual, hence the term "),_c('em',[_v("fat")]),_v(")")]),_v(".")])])]),_v(" "),_c('p',[_v("The relevant lines for adding the above plugins to the "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("build.gradle")]),_v(" are given below:")]),_v(" "),_c('div',{staticClass:"code-block"},[_c('div',{staticClass:"code-block-heading"},[_c('span',[_v("build.gradle")])]),_c('div',{staticClass:"code-block-content"},[_c('pre',[_c('code',{pre:true,attrs:{"heading":"build.gradle","class":"hljs groovy"}},[_c('span',[_v("plugins {\n")]),_c('span',[_v(" id "),_c('span',{pre:true,attrs:{"class":"hljs-string"}},[_v("'java'")]),_v("\n")]),_c('span',[_v(" id "),_c('span',{pre:true,attrs:{"class":"hljs-string"}},[_v("'application'")]),_v("\n")]),_c('span',[_v(" id "),_c('span',{pre:true,attrs:{"class":"hljs-string"}},[_v("'checkstyle'")]),_v("\n")]),_c('span',[_v(" id "),_c('span',{pre:true,attrs:{"class":"hljs-string"}},[_v("'com.github.johnrengelman.shadow'")]),_v(" version "),_c('span',{pre:true,attrs:{"class":"hljs-string"}},[_v("'7.1.2'")]),_v("\n")]),_c('span',[_v("}\n")])]),_c('div',{staticClass:"function-btn-container"},[_c('button',{staticClass:"function-btn d-print-none",attrs:{"onclick":"copyCodeBlock(this)"}},[_v("\n "),_c('div',{staticClass:"function-btn-body"},[_v("\n \n"),_c('svg',{attrs:{"xmlns":"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","width":"18","height":"18","viewBox":"0 0 18 18","version":"1.1"}},[_v("\n "),_c('g',{attrs:{"id":"surface1"}},[_v("\n "),_c('path',{attrs:{"d":"M 11.273438 0 L 2.546875 0 C 1.746094 0 1.089844 0.613281 1.089844\n 1.363281 L 1.089844 10.910156 L 2.546875 10.910156 L 2.546875 1.363281 L 11.273438\n 1.363281 Z M 13.453125 2.726562 L 5.453125 2.726562 C 4.65625 2.726562 4 3.339844 4\n 4.089844 L 4 13.636719 C 4 14.386719 4.65625 15 5.453125 15 L 13.453125 15 C 14.253906\n 15 14.910156 14.386719 14.910156 13.636719 L 14.910156 4.089844 C 14.910156 3.339844\n 14.253906 2.726562 13.453125 2.726562 Z M 13.453125 13.636719 L 5.453125 13.636719 L\n 5.453125 4.089844 L 13.453125 4.089844 Z M 13.453125 13.636719 "}}),_v("\n ")]),_v("\n")]),_v("\n\n ")]),_v("\n ")])])])])]),_c('p',[_v("You can follow the links in the list above to find what tasks are provided by a plugin and how to configure it. For example, "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("run")]),_v(" is a task provided by the Application plugin, and you can set the "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("mainClassName")]),_v(" ("),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("mainClass")]),_v(" in some versions) property, to indicate which class should be used as the as the entry point of the application:")]),_v(" "),_c('div',{staticClass:"code-block"},[_c('div',{staticClass:"code-block-heading"},[_c('span',[_v("build.gradle")])]),_c('div',{staticClass:"code-block-content"},[_c('pre',[_c('code',{pre:true,attrs:{"heading":"build.gradle","class":"hljs groovy"}},[_c('span',[_v("application {\n")]),_c('span',[_v(" mainClass.set("),_c('span',{pre:true,attrs:{"class":"hljs-string"}},[_v("\"seedu.duke.Main\"")]),_v(")\n")]),_c('span',[_v("}\n")])]),_c('div',{staticClass:"function-btn-container"},[_c('button',{staticClass:"function-btn d-print-none",attrs:{"onclick":"copyCodeBlock(this)"}},[_v("\n "),_c('div',{staticClass:"function-btn-body"},[_v("\n \n"),_c('svg',{attrs:{"xmlns":"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","width":"18","height":"18","viewBox":"0 0 18 18","version":"1.1"}},[_v("\n "),_c('g',{attrs:{"id":"surface1"}},[_v("\n "),_c('path',{attrs:{"d":"M 11.273438 0 L 2.546875 0 C 1.746094 0 1.089844 0.613281 1.089844\n 1.363281 L 1.089844 10.910156 L 2.546875 10.910156 L 2.546875 1.363281 L 11.273438\n 1.363281 Z M 13.453125 2.726562 L 5.453125 2.726562 C 4.65625 2.726562 4 3.339844 4\n 4.089844 L 4 13.636719 C 4 14.386719 4.65625 15 5.453125 15 L 13.453125 15 C 14.253906\n 15 14.910156 14.386719 14.910156 13.636719 L 14.910156 4.089844 C 14.910156 3.339844\n 14.253906 2.726562 13.453125 2.726562 Z M 13.453125 13.636719 L 5.453125 13.636719 L\n 5.453125 4.089844 L 13.453125 4.089844 Z M 13.453125 13.636719 "}}),_v("\n ")]),_v("\n")]),_v("\n\n ")]),_v("\n ")])])])])]),_c('p',[_c('strong',[_v("Gradle can automate the management of dependencies to third-party libraries")]),_v(" too. You just need to add the dependency into the "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("build.gradle")]),_v(" file and Gradle will do the rest. For example, to add the Natty (a third-party library used for parsing natural language dates e.g., "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("today")]),_v("), you simply have to add the following line to the "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("dependencies")]),_v(" section of the "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("build.gradle")]),_v(" file.")]),_v(" "),_c('div',{staticClass:"code-block"},[_c('div',{staticClass:"code-block-heading"},[_c('span',[_v("build.gradle")])]),_c('div',{staticClass:"code-block-content"},[_c('pre',[_c('code',{pre:true,attrs:{"heading":"build.gradle","class":"hljs groovy"}},[_c('span',[_v("implementation "),_c('span',{pre:true,attrs:{"class":"hljs-attr"}},[_v("group:")]),_v(" "),_c('span',{pre:true,attrs:{"class":"hljs-string"}},[_v("'com.joestelmach'")]),_v(", "),_c('span',{pre:true,attrs:{"class":"hljs-attr"}},[_v("name:")]),_v(" "),_c('span',{pre:true,attrs:{"class":"hljs-string"}},[_v("'natty'")]),_v(", "),_c('span',{pre:true,attrs:{"class":"hljs-attr"}},[_v("version:")]),_v(" "),_c('span',{pre:true,attrs:{"class":"hljs-string"}},[_v("'0.13'")]),_v("\n")])]),_c('div',{staticClass:"function-btn-container"},[_c('button',{staticClass:"function-btn d-print-none",attrs:{"onclick":"copyCodeBlock(this)"}},[_v("\n "),_c('div',{staticClass:"function-btn-body"},[_v("\n \n"),_c('svg',{attrs:{"xmlns":"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","width":"18","height":"18","viewBox":"0 0 18 18","version":"1.1"}},[_v("\n "),_c('g',{attrs:{"id":"surface1"}},[_v("\n "),_c('path',{attrs:{"d":"M 11.273438 0 L 2.546875 0 C 1.746094 0 1.089844 0.613281 1.089844\n 1.363281 L 1.089844 10.910156 L 2.546875 10.910156 L 2.546875 1.363281 L 11.273438\n 1.363281 Z M 13.453125 2.726562 L 5.453125 2.726562 C 4.65625 2.726562 4 3.339844 4\n 4.089844 L 4 13.636719 C 4 14.386719 4.65625 15 5.453125 15 L 13.453125 15 C 14.253906\n 15 14.910156 14.386719 14.910156 13.636719 L 14.910156 4.089844 C 14.910156 3.339844\n 14.253906 2.726562 13.453125 2.726562 Z M 13.453125 13.636719 L 5.453125 13.636719 L\n 5.453125 4.089844 L 13.453125 4.089844 Z M 13.453125 13.636719 "}}),_v("\n ")]),_v("\n")]),_v("\n\n ")]),_v("\n ")])])])])]),_c('p',[_v("Tip: Most third-party libraries specify how to add it as a Gradle dependency ("),_c('a',{attrs:{"href":"https://mvnrepository.com/artifact/com.joestelmach/natty/0.13"}},[_v("example")]),_v(").")]),_v(" "),_c('p',[_c('strong',[_v("From where does Gradle download dependencies?")]),_v(" The public servers Gradle will search to find the specified dependencies are listed in the "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("build.gradle")]),_v(" file. e.g.,")]),_v(" "),_c('div',{staticClass:"code-block"},[_c('div',{staticClass:"code-block-heading"},[_c('span',[_v("build.gradle")])]),_c('div',{staticClass:"code-block-content"},[_c('pre',[_c('code',{pre:true,attrs:{"heading":"build.gradle","class":"hljs groovy"}},[_c('span',[_v("repositories {\n")]),_c('span',[_v(" mavenCentral()\n")]),_c('span',[_v(" maven { url "),_c('span',{pre:true,attrs:{"class":"hljs-string"}},[_v("'https://oss.sonatype.org/content/repositories/snapshots/'")]),_v(" }\n")]),_c('span',[_v("}\n")])]),_c('div',{staticClass:"function-btn-container"},[_c('button',{staticClass:"function-btn d-print-none",attrs:{"onclick":"copyCodeBlock(this)"}},[_v("\n "),_c('div',{staticClass:"function-btn-body"},[_v("\n \n"),_c('svg',{attrs:{"xmlns":"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","width":"18","height":"18","viewBox":"0 0 18 18","version":"1.1"}},[_v("\n "),_c('g',{attrs:{"id":"surface1"}},[_v("\n "),_c('path',{attrs:{"d":"M 11.273438 0 L 2.546875 0 C 1.746094 0 1.089844 0.613281 1.089844\n 1.363281 L 1.089844 10.910156 L 2.546875 10.910156 L 2.546875 1.363281 L 11.273438\n 1.363281 Z M 13.453125 2.726562 L 5.453125 2.726562 C 4.65625 2.726562 4 3.339844 4\n 4.089844 L 4 13.636719 C 4 14.386719 4.65625 15 5.453125 15 L 13.453125 15 C 14.253906\n 15 14.910156 14.386719 14.910156 13.636719 L 14.910156 4.089844 C 14.910156 3.339844\n 14.253906 2.726562 13.453125 2.726562 Z M 13.453125 13.636719 L 5.453125 13.636719 L\n 5.453125 4.089844 L 13.453125 4.089844 Z M 13.453125 13.636719 "}}),_v("\n ")]),_v("\n")]),_v("\n\n ")]),_v("\n ")])])])])]),_c('box',{attrs:{"type":"tip","id":"after-updating-build-file","seamless":""}},[_c('p',[_c('strong',[_v("After updating the "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("build.gradle")]),_v(" file,")])]),_v(" "),_c('ul',[_c('li',[_v("if you are using an IDE: Use the IDE UI to reload dependencies based on the updated file. For example, if using Intellij IDEA, you can click the "),_c('img',{attrs:{"src":"/guides/tutorials/images/gradle/RefreshGradleIcon.png"}}),_v(" icon in the Gradle tool window to reload the file."),_c('br'),_v("\nFor good measure, you can restart the IDE too.")]),_v(" "),_c('li',[_v("if not using an IDE: Run "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v(".\\gradlew clean build")]),_v(" to rebuild everything based on the updated file.")])])]),_v(" "),_c('h2',{attrs:{"id":"using-gradle-to-do-some-common-project-activities"}},[_v("Using Gradle to do some common project activities"),_c('a',{staticClass:"fa fa-anchor",attrs:{"href":"#using-gradle-to-do-some-common-project-activities","onclick":"event.stopPropagation()"}})]),_v(" "),_c('h3',{attrs:{"id":"running-the-application"}},[_v("Running the application"),_c('a',{staticClass:"fa fa-anchor",attrs:{"href":"#running-the-application","onclick":"event.stopPropagation()"}})]),_v(" "),_c('p',[_v("Run the "),_c('strong',[_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("run")])]),_v(" task to launch the main class of the application."),_c('br'),_v("\ne.g. "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("./gradlew run")])]),_v(" "),_c('h3',{attrs:{"id":"cleaning-the-project"}},[_v("Cleaning the project"),_c('a',{staticClass:"fa fa-anchor",attrs:{"href":"#cleaning-the-project","onclick":"event.stopPropagation()"}})]),_v(" "),_c('p',[_v("Run the "),_c('strong',[_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("clean")])]),_v(" to delete the files created during the previous build tasks (e.g. files in the "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("build")]),_v(" folder)."),_c('br'),_v("\ne.g. "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("./gradlew clean")])]),_v(" "),_c('box',{attrs:{"type":"tip","seamless":""}},[_c('p',[_c('strong',[_v("You can use "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("clean")]),_v(" to prevent Gradle from skipping tasks")]),_v(": 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 you want to force Gradle to run a task, you can combine that task with "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("clean")]),_v(" (e.g., "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("./gradlew clean shadowJar")]),_v("). Once the build files have been "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("clean")]),_v(" ed, Gradle has no way to determine if the output will be same as before, and it will have no choice but to execute the task.")])]),_v(" "),_c('h3',{attrs:{"id":"running-checkstyle"}},[_v("Running Checkstyle"),_c('a',{staticClass:"fa fa-anchor",attrs:{"href":"#running-checkstyle","onclick":"event.stopPropagation()"}})]),_v(" "),_c('p',[_v("tasks "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("checkstyleMain")]),_v(" and "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("checkstyleTest")]),_v(" check if the main code and test code complies with the Checkstyle rules, respectively. "),_c('br'),_v("\ne.g., "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("./gradlew checkstyleMain checkstyleTest")])]),_v(" "),_c('p',[_v("See our "),_c('a',{attrs:{"href":"/guides/tutorials/checkstyle.html"}},[_v("Checkstyle Tutorial")]),_v(" for more details.")]),_v(" "),_c('h3',{attrs:{"id":"running-tests"}},[_v("Running tests"),_c('a',{staticClass:"fa fa-anchor",attrs:{"href":"#running-tests","onclick":"event.stopPropagation()"}})]),_v(" "),_c('p',[_v("Run the "),_c('strong',[_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("test")])]),_v(" to run all tests and test-related tasks."),_c('br'),_v("\ne.g. "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("./gradlew test")])]),_v(" "),_c('p',[_v("See our "),_c('a',{attrs:{"href":"/guides/tutorials/junit.html"}},[_v("JUnit tutorial")]),_v(" to find how to use JUnit with Gradle.")]),_v(" "),_c('h3',{attrs:{"id":"creating-jar-files"}},[_v("Creating JAR files"),_c('a',{staticClass:"fa fa-anchor",attrs:{"href":"#creating-jar-files","onclick":"event.stopPropagation()"}})]),_v(" "),_c('p',[_v("Run the "),_c('strong',[_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("shadowJar")])]),_v(" task to create a fat JAR file of the application."),_c('br'),_v("\ne.g. "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("./gradlew clean shadowJar")])]),_v(" "),_c('p',[_v("See our "),_c('a',{attrs:{"href":"/guides/tutorials/jar.html"}},[_v("JAR tutorial")]),_v(" to find more about creating JAR files using Gradle.")]),_v(" "),_c('h3',{attrs:{"id":"compiling"}},[_v("Compiling"),_c('a',{staticClass:"fa fa-anchor",attrs:{"href":"#compiling","onclick":"event.stopPropagation()"}})]),_v(" "),_c('p',[_v("There is no need to run these Gradle tasks manually as they are called automatically by other relevant Gradle tasks.")]),_v(" "),_c('ul',[_c('li',[_c('strong',[_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("compileJava")])]),_v(": Checks whether the project has the required dependencies to compile and run the main program, and download any missing dependencies before compiling the classes.")]),_v(" "),_c('li',[_c('strong',[_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("compileTestJava")])]),_v(": Checks whether the project has the required dependencies to perform testing, and download any missing dependencies before compiling the test classes.")])]),_v(" "),_c('h3',{attrs:{"id":"enabling-assertions"}},[_v("Enabling assertions"),_c('a',{staticClass:"fa fa-anchor",attrs:{"href":"#enabling-assertions","onclick":"event.stopPropagation()"}})]),_v(" "),_c('p',[_v("To enable assertions when executing Java code, add the following to the "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("build.gradle")]),_v(" file.")]),_v(" "),_c('pre',[_c('code',{pre:true,attrs:{"class":"hljs groovy"}},[_c('span',[_v("run {\n")]),_c('span',[_v(" enableAssertions = "),_c('span',{pre:true,attrs:{"class":"hljs-literal"}},[_v("true")]),_v("\n")]),_c('span',[_v("}\n")])]),_c('div',{staticClass:"function-btn-container"},[_c('button',{staticClass:"function-btn d-print-none",attrs:{"onclick":"copyCodeBlock(this)"}},[_v("\n "),_c('div',{staticClass:"function-btn-body"},[_v("\n \n"),_c('svg',{attrs:{"xmlns":"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","width":"18","height":"18","viewBox":"0 0 18 18","version":"1.1"}},[_v("\n "),_c('g',{attrs:{"id":"surface1"}},[_v("\n "),_c('path',{attrs:{"d":"M 11.273438 0 L 2.546875 0 C 1.746094 0 1.089844 0.613281 1.089844\n 1.363281 L 1.089844 10.910156 L 2.546875 10.910156 L 2.546875 1.363281 L 11.273438\n 1.363281 Z M 13.453125 2.726562 L 5.453125 2.726562 C 4.65625 2.726562 4 3.339844 4\n 4.089844 L 4 13.636719 C 4 14.386719 4.65625 15 5.453125 15 L 13.453125 15 C 14.253906\n 15 14.910156 14.386719 14.910156 13.636719 L 14.910156 4.089844 C 14.910156 3.339844\n 14.253906 2.726562 13.453125 2.726562 Z M 13.453125 13.636719 L 5.453125 13.636719 L\n 5.453125 4.089844 L 13.453125 4.089844 Z M 13.453125 13.636719 "}}),_v("\n ")]),_v("\n")]),_v("\n\n ")]),_v("\n ")])])]),_v(" "),_c('h2',{attrs:{"id":"resources"}},[_v("Resources"),_c('a',{staticClass:"fa fa-anchor",attrs:{"href":"#resources","onclick":"event.stopPropagation()"}})]),_v(" "),_c('ul',[_c('li',[_c('a',{attrs:{"href":"https://docs.gradle.org/current/userguide/userguide.html"}},[_v("Official Gradle Documentation")])])]),_v(" "),_c('hr'),_v(" "),_c('p',[_c('strong',[_v("Authors:")])]),_v(" "),_c('ul',[_c('li',[_v("Initial Version: Jeffry Lum")])])],1)],1)],1),_c('p')],1),_v(" "),_c('overlay-source',{staticClass:"fixed-header-padding",attrs:{"id":"page-nav","tag-name":"nav","to":"page-nav"}},[_c('div',{staticClass:"nav-component slim-scroll"},[_c('overlay-source',{staticClass:"nav nav-pills flex-column my-0 small no-flex-wrap",attrs:{"id":"mb-page-nav","tag-name":"nav","to":"mb-page-nav"}},[_c('a',{pre:true,attrs:{"class":"nav-link py-1","href":"#gradle-tutorial"}},[_v("Gradle tutorial‎")]),_v(" "),_c('nav',{staticClass:"nav nav-pills flex-column my-0 nested no-flex-wrap"},[_c('a',{pre:true,attrs:{"class":"nav-link py-1","href":"#basics"}},[_v("Basics‎")]),_v(" "),_c('a',{pre:true,attrs:{"class":"nav-link py-1","href":"#adding-gradle-to-the-project"}},[_v("Adding Gradle to the project‎")]),_v(" "),_c('a',{pre:true,attrs:{"class":"nav-link py-1","href":"#running-gradle-tasks"}},[_v("Running Gradle tasks‎")]),_v(" "),_c('a',{pre:true,attrs:{"class":"nav-link py-1","href":"#managing-plugins-and-dependencies"}},[_v("Managing plugins and dependencies‎")]),_v(" "),_c('a',{pre:true,attrs:{"class":"nav-link py-1","href":"#using-gradle-to-do-some-common-project-activities"}},[_v("Using Gradle to do some common project activities‎")]),_v(" "),_c('nav',{staticClass:"nav nav-pills flex-column my-0 nested no-flex-wrap"},[_c('a',{pre:true,attrs:{"class":"nav-link py-1","href":"#running-the-application"}},[_v("Running the application‎")]),_v(" "),_c('a',{pre:true,attrs:{"class":"nav-link py-1","href":"#cleaning-the-project"}},[_v("Cleaning the project‎")]),_v(" "),_c('a',{pre:true,attrs:{"class":"nav-link py-1","href":"#running-checkstyle"}},[_v("Running Checkstyle‎")]),_v(" "),_c('a',{pre:true,attrs:{"class":"nav-link py-1","href":"#running-tests"}},[_v("Running tests‎")]),_v(" "),_c('a',{pre:true,attrs:{"class":"nav-link py-1","href":"#creating-jar-files"}},[_v("Creating JAR files‎")]),_v(" "),_c('a',{pre:true,attrs:{"class":"nav-link py-1","href":"#compiling"}},[_v("Compiling‎")]),_v(" "),_c('a',{pre:true,attrs:{"class":"nav-link py-1","href":"#enabling-assertions"}},[_v("Enabling assertions‎")])]),_v(" "),_c('a',{pre:true,attrs:{"class":"nav-link py-1","href":"#resources"}},[_v("Resources‎")])])])],1)]),_v(" "),_c('scroll-top-button')],1),_v(" "),_m(10)])} +with(this){return _c('div',{attrs:{"id":"app"}},[_c('header',{attrs:{"sticky":""}},[_c('navbar',{attrs:{"type":"dark"},scopedSlots:_u([{key:"brand",fn:function(){return [_c('a',{staticClass:"navbar-brand",attrs:{"href":"https://se-education.org","title":"SE-EDU"}},[_c('span',[_c('span',{staticClass:"fas fa-chevron-circle-left",attrs:{"aria-hidden":"true"}}),_v(" "),_c('strong',[_c('strong',[_v("SE-EDU")])])])])]},proxy:true},{key:"right",fn:function(){return [_c('li',{staticClass:"nav-link"},[_c('form',{staticClass:"navbar-form"},[_c('searchbar',{attrs:{"data":searchData,"placeholder":"Search this site","on-hit":searchCallback,"menu-align-right":""}})],1)])]},proxy:true}])},[_v(" "),_c('li',[_c('a',{staticClass:"nav-link",attrs:{"href":"/guides/index.html"}},[_c('span',[_c('strong',[_v("Home")])])])]),_v(" "),_c('li',[_c('a',{staticClass:"nav-link",attrs:{"href":"/guides/about.html"}},[_c('span',[_c('strong',[_v("About")])])])]),_v(" "),_c('li',[_c('a',{staticClass:"nav-link",attrs:{"href":"https://github.com/se-edu/guides"}},[_c('span',[_c('span',{staticClass:"fab fa-github",attrs:{"aria-hidden":"true"}})])])])])],1),_v(" "),_c('div',{attrs:{"id":"flex-body"}},[_c('div',{staticClass:"fixed-header-padding",attrs:{"id":"content-wrapper"}},[_m(0),_v(" "),_c('p'),_m(1),_v(" "),_m(2),_v(" "),_m(3),_v(" "),_m(4),_v(" "),_m(5),_v(" "),_m(6),_v(" "),_c('panel',{attrs:{"peek":"","no-close":"","no-switch":""},scopedSlots:_u([{key:"header",fn:function(){return [_c('div',[_c('span',[_c('span',{staticClass:"text-danger"},[_c('span',{staticClass:"fab fa-youtube",attrs:{"aria-hidden":"true"}})]),_v(" VIDEO: Working with Gradle")])])]},proxy:true}])},[_v(" "),_c('div',{staticClass:"block-embed block-embed-service-youtube",staticStyle:{"position":"relative","padding-bottom":"60.9375%"}},[_c('iframe',{attrs:{"type":"text/html","src":"//www.youtube.com/embed/6V6G3RyxEMk","frameborder":"0","webkitallowfullscreen":"","mozallowfullscreen":"","allowfullscreen":""}})])]),_v(" "),_c('p'),_v(" "),_m(7),_v(" "),_m(8),_v(" "),_m(9),_v(" "),_c('tabs',[_c('tab',{scopedSlots:_u([{key:"header",fn:function(){return [_v("Using Intellij")]},proxy:true}])},[_v(" "),_c('div',{staticClass:"ml-3"},[_c('div',[_c('box',{attrs:{"type":"tip","seamless":""}},[_c('p',[_v("If the project comes with Gradle support, you will see a "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("build.gradle")]),_v(" file in your project root.")])]),_v(" "),_c('box',{attrs:{"type":"warning","seamless":""}},[_c('p',[_v("IntelliJ IDEA has the Gradle plugin installed by default. If you have disabled it, go to "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("File")]),_v(" → "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Settings")]),_v(" → "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Plugins")]),_v(" to re-enable it."),_c('br'),_v("\nIf your project involves GUI programming, similarly ensure the JavaFX plugin has not been disabled.")])]),_v(" "),_c('ol',[_c('li',[_v("Open Intellij.")]),_v(" "),_c('li',[_v("If you are in the welcome screen, Click "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Open")]),_v(". Otherwise, click "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("File")]),_v(" -> "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Open")]),_v("."),_c('br'),_v("\ni. Select the project directory, and click "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("OK")]),_v("."),_c('br'),_v("\nii. If there are any further prompts, accept the defaults but do ensure that the selected version of "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Gradle JVM")]),_v(" matches the JDK being used for the project.")]),_v(" "),_c('li',[_v("Confirm the correct Java version is being used for Gradle, as follows:")])]),_v(" "),_c('div',{staticClass:"indented-level1",attrs:{"id":"configure-intellij-sdk"}},[_c('p',[_v("(a) Confirm the project JDK is set to the one you are supposed to use for the project, as explained "),_c('a',{attrs:{"href":"https://www.jetbrains.com/help/idea/sdk.html#set-up-jdk"}},[_v("here")]),_v("."),_c('br'),_v("\n(b) Confirm the correct JVM is used for Gradle, as given in the panel below:")]),_v(" "),_c('div',{staticClass:"indented-level1"},[_c('panel',{attrs:{"peek":""},scopedSlots:_u([{key:"header",fn:function(){return [_c('p',[_v("Intellij: Setting the JVM for Gradle")])]},proxy:true}])},[_v(" "),_c('p',[_v("Go to "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("File")]),_v(" -> "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Settings")]),_v(" and ensure the "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Gradle JVM")]),_v(" is set as "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Project SDK ...")]),_v(", so that Gradle will use the same JDK used by the project.")]),_v(" "),_c('pic',{attrs:{"src":"/guides/tutorials/images/gradle/intellijSetGradleJvm.png"}}),_v(" "),_c('p',[_v("Also take note of the "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Build and run using:")]),_v(" and "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Run tests using:")]),_v(" settings. They are useful if you want to control whether you want Intellij to use Gradle to build/run/test your project.")])],1)],1)]),_v(" "),_c('ol',{attrs:{"start":"4"}},[_c('li',[_v("After the importing of the project is complete (which could take a few minutes), you will see the "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Gradle Toolbar")]),_v(" in the IDEA interface "),_c('span',{staticClass:"dimmed"},[_v("e.g., look for the elephant icon (on Windows, this appears on the right-edge of the IDE window) and click it")]),_v("."),_c('br'),_v(" "),_c('a',{attrs:{"href":"/guides/tutorials/images/gradle/GradleIcon.png","target":"_self"}},[_c('img',{staticClass:"img-fluid",attrs:{"src":"/guides/tutorials/images/gradle/GradleIcon.png","alt":"Gradle icon"}})])])])],1)])]),_v(" "),_c('tab',{scopedSlots:_u([{key:"header",fn:function(){return [_v("Not using an IDE")]},proxy:true}])},[_v(" "),_c('p',[_v("Run the "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("java -version")]),_v(" command in the same terminal you use for running Gradle commands, to ensure you are using the intended Java version for Gradle.")]),_v(" "),_c('p',[_v("No further action required. You should be able to use Gradle via the command line right away.")])]),_v(" "),_c('p'),_v(" "),_c('p',[_c('strong',[_c('strong',[_v("Scenario 2:")])]),_v(" You are adding Gradle support to an ongoing project. Gradle wrapper files are available but have not been added to the project yet.")]),_v(" "),_c('p',[_v("First, add the Gradle wrapper files to the project. e.g., if they are in a separate branch, merge that branch.")]),_v(" "),_c('tabs',[_c('tab',{scopedSlots:_u([{key:"header",fn:function(){return [_v("Using Intellij")]},proxy:true}])},[_v(" "),_c('ol',[_c('li',[_v("Close the IDEA project if it is open.")]),_v(" "),_c('li',[_v("Delete the "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v(".idea")]),_v(" folder."),_c('br'),_v(" "),_c('span',[_c('span',{staticClass:"fas fa-info-circle",attrs:{"aria-hidden":"true"}})]),_v(" Note that some operating systems hides folders/files starting with "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v(".")]),_v(" by default. If you can't see the "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v(".idea")]),_v(" folder, you might need to configure the OS to 'un-hide' those files/folders.")]),_v(" "),_c('li',[_v("Open/import the project again, as explained in scenario 1 above.")])])]),_v(" "),_c('tab',{scopedSlots:_u([{key:"header",fn:function(){return [_v("Not using an IDE")]},proxy:true}])},[_v(" "),_c('p',[_v("No further actions required. You should be able to use Gradle via the command line now.")])]),_v(" "),_c('p'),_v(" "),_c('p',[_c('strong',[_c('strong',[_v("Scenario 3:")])]),_v(" You are adding Gradle support to an ongoing project from scratch.")]),_v(" "),_c('ul',[_c('li',[_c('a',{attrs:{"href":"https://docs.gradle.org/current/userguide/gradle_wrapper.html"}},[_v("This")]),_v(" is a good place to start.")])]),_v(" "),_c('h2',{attrs:{"id":"running-gradle-tasks"}},[_v("Running Gradle tasks"),_c('a',{staticClass:"fa fa-anchor",attrs:{"href":"#running-gradle-tasks","onclick":"event.stopPropagation()"}})]),_v(" "),_c('tabs',[_c('tab',{scopedSlots:_u([{key:"header",fn:function(){return [_v("Using Intellij")]},proxy:true}])},[_v(" "),_c('p',[_v("There are several ways to run a Gradle task in Intellij. Examples:")]),_v(" "),_c('ul',[_c('li',[_v("Locate the task in the Gradle toolbar, and double-click it.")]),_v(" "),_c('li',[_v("Hit "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Ctrl")]),_v(" key twice (to bring up the command runner), and type "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("gradlew")]),_v(" followed by tasks to run e.g., "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("gradlew clean test")]),_v(".")])]),_v(" "),_c('p',[_v("See "),_c('a',{attrs:{"href":"https://www.youtube.com/watch?v=6V6G3RyxEMk#t=13m44s"}},[_v("this video")]),_v(" for more ways to run Gradle tasks inside Intellij.")]),_v(" "),_c('p',[_v("Alternatively, you can run Gradle tasks using the command line (even if you are using Intellij). Follow the instructions in the "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Using the terminal")]),_v(" tab above.")]),_v(" "),_c('box',{attrs:{"type":"tip","seamless":""}},[_c('p',[_v("If the Gradle tasks don't appear in the Gradle window, click the 'refresh' button in the toolbar to reimport the Gradle project.")])]),_v(" "),_c('box',{attrs:{"type":"tip","seamless":""}},[_c('p',[_v("Intellij uses Gradle to run your application by default. If you would like to run the project in the normal way, go to "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("File")]),_v(" > "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Settings")]),_v(" and change the following settings:")]),_v(" "),_c('panel',{attrs:{"peek":"","no-close":"","no-switch":""},scopedSlots:_u([{key:"header",fn:function(){return [_c('p',[_v("Expand to see screenshot ...")])]},proxy:true}])},[_v(" "),_c('p',[_c('a',{attrs:{"href":"/guides/tutorials/images/gradle/intellijRunUsingGradle.png","target":"_self"}},[_c('img',{staticClass:"img-fluid",attrs:{"src":"/guides/tutorials/images/gradle/intellijRunUsingGradle.png","alt":"change Intellij settings to not use Gradle"}})])])])],1)],1),_v(" "),_c('tab',{scopedSlots:_u([{key:"header",fn:function(){return [_v("Using the terminal")]},proxy:true}])},[_v(" "),_c('p',[_v("You can open a terminal, navigate to the project root, and type the following command in the terminal.")]),_v(" "),_c('ul',[_c('li',[_v("On Windows: "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("gradlew …")]),_v("​ e.g. "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("gradlew clean test")])]),_v(" "),_c('li',[_v("On Mac/Linux: "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("./gradlew …")]),_v("​ e.g. "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("./gradlew clean test")])])])]),_v(" "),_c('p'),_v(" "),_c('h2',{attrs:{"id":"managing-plugins-and-dependencies"}},[_v("Managing plugins and dependencies"),_c('a',{staticClass:"fa fa-anchor",attrs:{"href":"#managing-plugins-and-dependencies","onclick":"event.stopPropagation()"}})]),_v(" "),_c('p',[_c('strong',[_v("Gradle functionality can be extended using plugins.")]),_v(" Here are some plugins commonly used in Java projects.")]),_v(" "),_c('p',[_v("More info on specific plugins:")]),_v(" "),_c('ul',[_c('li',[_c('a',{attrs:{"href":"https://docs.gradle.org/current/userguide/java_plugin.html#java_plugin"}},[_v("Java")]),_v(" -- a built-in plugin that adds Java compilation along with testing and bundling capabilities to a project."),_c('br'),_v(" "),_c('a',{attrs:{"href":"https://docs.gradle.org/current/userguide/application_plugin.html#application_plugin"}},[_v("Application")]),_v(" -- a built-in plugin for creating an executable JVM application.")]),_v(" "),_c('li',[_c('a',{attrs:{"href":"https://docs.gradle.org/current/userguide/checkstyle_plugin.html#checkstyle_plugin"}},[_v("Checkstyle")]),_v(" -- a built-in plugin for using Checkstyle in a project.")]),_v(" "),_c('li',[_c('a',{attrs:{"href":"https://plugins.gradle.org/plugin/com.github.johnrengelman.shadow"}},[_v("Shadow")]),_v(" -- a third-party plugin for creating "),_c('trigger',{attrs:{"trigger":"click","for":"modal:gradleTutorial-fatJar"}},[_v("fat/uber JARs")]),_v(".")],1)]),_v(" "),_c('modal',{attrs:{"large":"","id":"modal:gradleTutorial-fatJar"},scopedSlots:_u([{key:"header",fn:function(){return [_v("Fat/Uber JAR files")]},proxy:true}])},[_v(" "),_c('div',[_c('p',[_c('strong',[_v("A normal JAR file contains only the classes and resources that you created for your app.")]),_v(" If your app has "),_c('em',[_v("dependencies")]),_v(" (i.e., third party libraries that your app depends on), the JAR file will not work unless the person running the JAR file also has those dependencies in their computer. This is not ideal.")]),_v(" "),_c('p',[_c('strong',[_v("A "),_c('em',[_v("fat")]),_v(" JAR (aka "),_c('em',[_v("uber")]),_v(" JAR) file solves the above problem by including all the dependencies inside the JAR file")]),_v(" itself "),_c('span',{staticClass:"dimmed"},[_v("(which makes the JAR file bigger than usual, hence the term "),_c('em',[_v("fat")]),_v(")")]),_v(".")])])]),_v(" "),_c('p',[_v("The relevant lines for adding the above plugins to the "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("build.gradle")]),_v(" are given below:")]),_v(" "),_c('div',{staticClass:"code-block"},[_c('div',{staticClass:"code-block-heading"},[_c('span',[_v("build.gradle")])]),_c('div',{staticClass:"code-block-content"},[_c('pre',[_c('code',{pre:true,attrs:{"heading":"build.gradle","class":"hljs groovy"}},[_c('span',[_v("plugins {\n")]),_c('span',[_v(" id "),_c('span',{pre:true,attrs:{"class":"hljs-string"}},[_v("'java'")]),_v("\n")]),_c('span',[_v(" id "),_c('span',{pre:true,attrs:{"class":"hljs-string"}},[_v("'application'")]),_v("\n")]),_c('span',[_v(" id "),_c('span',{pre:true,attrs:{"class":"hljs-string"}},[_v("'checkstyle'")]),_v("\n")]),_c('span',[_v(" id "),_c('span',{pre:true,attrs:{"class":"hljs-string"}},[_v("'com.github.johnrengelman.shadow'")]),_v(" version "),_c('span',{pre:true,attrs:{"class":"hljs-string"}},[_v("'7.1.2'")]),_v("\n")]),_c('span',[_v("}\n")])]),_c('div',{staticClass:"function-btn-container"},[_c('button',{staticClass:"function-btn d-print-none",attrs:{"onclick":"copyCodeBlock(this)"}},[_v("\n "),_c('div',{staticClass:"function-btn-body"},[_v("\n \n"),_c('svg',{attrs:{"xmlns":"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","width":"18","height":"18","viewBox":"0 0 18 18","version":"1.1"}},[_v("\n "),_c('g',{attrs:{"id":"surface1"}},[_v("\n "),_c('path',{attrs:{"d":"M 11.273438 0 L 2.546875 0 C 1.746094 0 1.089844 0.613281 1.089844\n 1.363281 L 1.089844 10.910156 L 2.546875 10.910156 L 2.546875 1.363281 L 11.273438\n 1.363281 Z M 13.453125 2.726562 L 5.453125 2.726562 C 4.65625 2.726562 4 3.339844 4\n 4.089844 L 4 13.636719 C 4 14.386719 4.65625 15 5.453125 15 L 13.453125 15 C 14.253906\n 15 14.910156 14.386719 14.910156 13.636719 L 14.910156 4.089844 C 14.910156 3.339844\n 14.253906 2.726562 13.453125 2.726562 Z M 13.453125 13.636719 L 5.453125 13.636719 L\n 5.453125 4.089844 L 13.453125 4.089844 Z M 13.453125 13.636719 "}}),_v("\n ")]),_v("\n")]),_v("\n\n ")]),_v("\n ")])])])])]),_c('p',[_v("You can follow the links in the list above to find what tasks are provided by a plugin and how to configure it. For example, "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("run")]),_v(" is a task provided by the Application plugin, and you can set the "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("mainClassName")]),_v(" ("),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("mainClass")]),_v(" in some versions) property, to indicate which class should be used as the as the entry point of the application:")]),_v(" "),_c('div',{staticClass:"code-block"},[_c('div',{staticClass:"code-block-heading"},[_c('span',[_v("build.gradle")])]),_c('div',{staticClass:"code-block-content"},[_c('pre',[_c('code',{pre:true,attrs:{"heading":"build.gradle","class":"hljs groovy"}},[_c('span',[_v("application {\n")]),_c('span',[_v(" mainClass.set("),_c('span',{pre:true,attrs:{"class":"hljs-string"}},[_v("\"seedu.duke.Main\"")]),_v(")\n")]),_c('span',[_v("}\n")])]),_c('div',{staticClass:"function-btn-container"},[_c('button',{staticClass:"function-btn d-print-none",attrs:{"onclick":"copyCodeBlock(this)"}},[_v("\n "),_c('div',{staticClass:"function-btn-body"},[_v("\n \n"),_c('svg',{attrs:{"xmlns":"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","width":"18","height":"18","viewBox":"0 0 18 18","version":"1.1"}},[_v("\n "),_c('g',{attrs:{"id":"surface1"}},[_v("\n "),_c('path',{attrs:{"d":"M 11.273438 0 L 2.546875 0 C 1.746094 0 1.089844 0.613281 1.089844\n 1.363281 L 1.089844 10.910156 L 2.546875 10.910156 L 2.546875 1.363281 L 11.273438\n 1.363281 Z M 13.453125 2.726562 L 5.453125 2.726562 C 4.65625 2.726562 4 3.339844 4\n 4.089844 L 4 13.636719 C 4 14.386719 4.65625 15 5.453125 15 L 13.453125 15 C 14.253906\n 15 14.910156 14.386719 14.910156 13.636719 L 14.910156 4.089844 C 14.910156 3.339844\n 14.253906 2.726562 13.453125 2.726562 Z M 13.453125 13.636719 L 5.453125 13.636719 L\n 5.453125 4.089844 L 13.453125 4.089844 Z M 13.453125 13.636719 "}}),_v("\n ")]),_v("\n")]),_v("\n\n ")]),_v("\n ")])])])])]),_c('p',[_c('strong',[_v("Gradle can automate the management of dependencies to third-party libraries")]),_v(" too. You just need to add the dependency into the "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("build.gradle")]),_v(" file and Gradle will do the rest. For example, to add the Natty (a third-party library used for parsing natural language dates e.g., "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("today")]),_v("), you simply have to add the following line to the "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("dependencies")]),_v(" section of the "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("build.gradle")]),_v(" file.")]),_v(" "),_c('div',{staticClass:"code-block"},[_c('div',{staticClass:"code-block-heading"},[_c('span',[_v("build.gradle")])]),_c('div',{staticClass:"code-block-content"},[_c('pre',[_c('code',{pre:true,attrs:{"heading":"build.gradle","class":"hljs groovy"}},[_c('span',[_v("implementation "),_c('span',{pre:true,attrs:{"class":"hljs-attr"}},[_v("group:")]),_v(" "),_c('span',{pre:true,attrs:{"class":"hljs-string"}},[_v("'com.joestelmach'")]),_v(", "),_c('span',{pre:true,attrs:{"class":"hljs-attr"}},[_v("name:")]),_v(" "),_c('span',{pre:true,attrs:{"class":"hljs-string"}},[_v("'natty'")]),_v(", "),_c('span',{pre:true,attrs:{"class":"hljs-attr"}},[_v("version:")]),_v(" "),_c('span',{pre:true,attrs:{"class":"hljs-string"}},[_v("'0.13'")]),_v("\n")])]),_c('div',{staticClass:"function-btn-container"},[_c('button',{staticClass:"function-btn d-print-none",attrs:{"onclick":"copyCodeBlock(this)"}},[_v("\n "),_c('div',{staticClass:"function-btn-body"},[_v("\n \n"),_c('svg',{attrs:{"xmlns":"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","width":"18","height":"18","viewBox":"0 0 18 18","version":"1.1"}},[_v("\n "),_c('g',{attrs:{"id":"surface1"}},[_v("\n "),_c('path',{attrs:{"d":"M 11.273438 0 L 2.546875 0 C 1.746094 0 1.089844 0.613281 1.089844\n 1.363281 L 1.089844 10.910156 L 2.546875 10.910156 L 2.546875 1.363281 L 11.273438\n 1.363281 Z M 13.453125 2.726562 L 5.453125 2.726562 C 4.65625 2.726562 4 3.339844 4\n 4.089844 L 4 13.636719 C 4 14.386719 4.65625 15 5.453125 15 L 13.453125 15 C 14.253906\n 15 14.910156 14.386719 14.910156 13.636719 L 14.910156 4.089844 C 14.910156 3.339844\n 14.253906 2.726562 13.453125 2.726562 Z M 13.453125 13.636719 L 5.453125 13.636719 L\n 5.453125 4.089844 L 13.453125 4.089844 Z M 13.453125 13.636719 "}}),_v("\n ")]),_v("\n")]),_v("\n\n ")]),_v("\n ")])])])])]),_c('p',[_v("Tip: Most third-party libraries specify how to add it as a Gradle dependency ("),_c('a',{attrs:{"href":"https://mvnrepository.com/artifact/com.joestelmach/natty/0.13"}},[_v("example")]),_v(").")]),_v(" "),_c('p',[_c('strong',[_v("From where does Gradle download dependencies?")]),_v(" The public servers Gradle will search to find the specified dependencies are listed in the "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("build.gradle")]),_v(" file. e.g.,")]),_v(" "),_c('div',{staticClass:"code-block"},[_c('div',{staticClass:"code-block-heading"},[_c('span',[_v("build.gradle")])]),_c('div',{staticClass:"code-block-content"},[_c('pre',[_c('code',{pre:true,attrs:{"heading":"build.gradle","class":"hljs groovy"}},[_c('span',[_v("repositories {\n")]),_c('span',[_v(" mavenCentral()\n")]),_c('span',[_v(" maven { url "),_c('span',{pre:true,attrs:{"class":"hljs-string"}},[_v("'https://oss.sonatype.org/content/repositories/snapshots/'")]),_v(" }\n")]),_c('span',[_v("}\n")])]),_c('div',{staticClass:"function-btn-container"},[_c('button',{staticClass:"function-btn d-print-none",attrs:{"onclick":"copyCodeBlock(this)"}},[_v("\n "),_c('div',{staticClass:"function-btn-body"},[_v("\n \n"),_c('svg',{attrs:{"xmlns":"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","width":"18","height":"18","viewBox":"0 0 18 18","version":"1.1"}},[_v("\n "),_c('g',{attrs:{"id":"surface1"}},[_v("\n "),_c('path',{attrs:{"d":"M 11.273438 0 L 2.546875 0 C 1.746094 0 1.089844 0.613281 1.089844\n 1.363281 L 1.089844 10.910156 L 2.546875 10.910156 L 2.546875 1.363281 L 11.273438\n 1.363281 Z M 13.453125 2.726562 L 5.453125 2.726562 C 4.65625 2.726562 4 3.339844 4\n 4.089844 L 4 13.636719 C 4 14.386719 4.65625 15 5.453125 15 L 13.453125 15 C 14.253906\n 15 14.910156 14.386719 14.910156 13.636719 L 14.910156 4.089844 C 14.910156 3.339844\n 14.253906 2.726562 13.453125 2.726562 Z M 13.453125 13.636719 L 5.453125 13.636719 L\n 5.453125 4.089844 L 13.453125 4.089844 Z M 13.453125 13.636719 "}}),_v("\n ")]),_v("\n")]),_v("\n\n ")]),_v("\n ")])])])])]),_c('box',{attrs:{"type":"tip","id":"after-updating-build-file","seamless":""}},[_c('p',[_c('strong',[_v("After updating the "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("build.gradle")]),_v(" file,")])]),_v(" "),_c('ul',[_c('li',[_v("if you are using an IDE: Use the IDE UI to reload dependencies based on the updated file. For example, if using Intellij IDEA, you can click the "),_c('img',{attrs:{"src":"/guides/tutorials/images/gradle/RefreshGradleIcon.png"}}),_v(" icon in the Gradle tool window to reload the file."),_c('br'),_v("\nFor good measure, you can restart the IDE too.")]),_v(" "),_c('li',[_v("if not using an IDE: Run "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v(".\\gradlew clean build")]),_v(" to rebuild everything based on the updated file.")])])]),_v(" "),_c('h2',{attrs:{"id":"using-gradle-to-do-some-common-project-activities"}},[_v("Using Gradle to do some common project activities"),_c('a',{staticClass:"fa fa-anchor",attrs:{"href":"#using-gradle-to-do-some-common-project-activities","onclick":"event.stopPropagation()"}})]),_v(" "),_c('h3',{attrs:{"id":"running-the-application"}},[_v("Running the application"),_c('a',{staticClass:"fa fa-anchor",attrs:{"href":"#running-the-application","onclick":"event.stopPropagation()"}})]),_v(" "),_c('p',[_v("Run the "),_c('strong',[_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("run")])]),_v(" task to launch the main class of the application."),_c('br'),_v("\ne.g. "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("./gradlew run")])]),_v(" "),_c('h3',{attrs:{"id":"cleaning-the-project"}},[_v("Cleaning the project"),_c('a',{staticClass:"fa fa-anchor",attrs:{"href":"#cleaning-the-project","onclick":"event.stopPropagation()"}})]),_v(" "),_c('p',[_v("Run the "),_c('strong',[_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("clean")])]),_v(" to delete the files created during the previous build tasks (e.g. files in the "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("build")]),_v(" folder)."),_c('br'),_v("\ne.g. "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("./gradlew clean")])]),_v(" "),_c('box',{attrs:{"type":"tip","seamless":""}},[_c('p',[_c('strong',[_v("You can use "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("clean")]),_v(" to prevent Gradle from skipping tasks")]),_v(": 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 you want to force Gradle to run a task, you can combine that task with "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("clean")]),_v(" (e.g., "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("./gradlew clean shadowJar")]),_v("). Once the build files have been "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("clean")]),_v(" ed, Gradle has no way to determine if the output will be same as before, and it will have no choice but to execute the task.")])]),_v(" "),_c('h3',{attrs:{"id":"running-checkstyle"}},[_v("Running Checkstyle"),_c('a',{staticClass:"fa fa-anchor",attrs:{"href":"#running-checkstyle","onclick":"event.stopPropagation()"}})]),_v(" "),_c('p',[_v("tasks "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("checkstyleMain")]),_v(" and "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("checkstyleTest")]),_v(" check if the main code and test code complies with the Checkstyle rules, respectively. "),_c('br'),_v("\ne.g., "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("./gradlew checkstyleMain checkstyleTest")])]),_v(" "),_c('p',[_v("See our "),_c('a',{attrs:{"href":"/guides/tutorials/checkstyle.html"}},[_v("Checkstyle Tutorial")]),_v(" for more details.")]),_v(" "),_c('h3',{attrs:{"id":"running-tests"}},[_v("Running tests"),_c('a',{staticClass:"fa fa-anchor",attrs:{"href":"#running-tests","onclick":"event.stopPropagation()"}})]),_v(" "),_c('p',[_v("Run the "),_c('strong',[_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("test")])]),_v(" to run all tests and test-related tasks."),_c('br'),_v("\ne.g. "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("./gradlew test")])]),_v(" "),_c('p',[_v("See our "),_c('a',{attrs:{"href":"/guides/tutorials/junit.html"}},[_v("JUnit tutorial")]),_v(" to find how to use JUnit with Gradle.")]),_v(" "),_c('h3',{attrs:{"id":"creating-jar-files"}},[_v("Creating JAR files"),_c('a',{staticClass:"fa fa-anchor",attrs:{"href":"#creating-jar-files","onclick":"event.stopPropagation()"}})]),_v(" "),_c('p',[_v("Run the "),_c('strong',[_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("shadowJar")])]),_v(" task to create a fat JAR file of the application."),_c('br'),_v("\ne.g. "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("./gradlew clean shadowJar")])]),_v(" "),_c('p',[_v("See our "),_c('a',{attrs:{"href":"/guides/tutorials/jar.html"}},[_v("JAR tutorial")]),_v(" to find more about creating JAR files using Gradle.")]),_v(" "),_c('h3',{attrs:{"id":"compiling"}},[_v("Compiling"),_c('a',{staticClass:"fa fa-anchor",attrs:{"href":"#compiling","onclick":"event.stopPropagation()"}})]),_v(" "),_c('p',[_v("There is no need to run these Gradle tasks manually as they are called automatically by other relevant Gradle tasks.")]),_v(" "),_c('ul',[_c('li',[_c('strong',[_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("compileJava")])]),_v(": Checks whether the project has the required dependencies to compile and run the main program, and download any missing dependencies before compiling the classes.")]),_v(" "),_c('li',[_c('strong',[_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("compileTestJava")])]),_v(": Checks whether the project has the required dependencies to perform testing, and download any missing dependencies before compiling the test classes.")])]),_v(" "),_c('h3',{attrs:{"id":"enabling-assertions"}},[_v("Enabling assertions"),_c('a',{staticClass:"fa fa-anchor",attrs:{"href":"#enabling-assertions","onclick":"event.stopPropagation()"}})]),_v(" "),_c('p',[_v("To enable assertions when executing Java code, add the following to the "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("build.gradle")]),_v(" file.")]),_v(" "),_c('pre',[_c('code',{pre:true,attrs:{"class":"hljs groovy"}},[_c('span',[_v("run {\n")]),_c('span',[_v(" enableAssertions = "),_c('span',{pre:true,attrs:{"class":"hljs-literal"}},[_v("true")]),_v("\n")]),_c('span',[_v("}\n")])]),_c('div',{staticClass:"function-btn-container"},[_c('button',{staticClass:"function-btn d-print-none",attrs:{"onclick":"copyCodeBlock(this)"}},[_v("\n "),_c('div',{staticClass:"function-btn-body"},[_v("\n \n"),_c('svg',{attrs:{"xmlns":"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","width":"18","height":"18","viewBox":"0 0 18 18","version":"1.1"}},[_v("\n "),_c('g',{attrs:{"id":"surface1"}},[_v("\n "),_c('path',{attrs:{"d":"M 11.273438 0 L 2.546875 0 C 1.746094 0 1.089844 0.613281 1.089844\n 1.363281 L 1.089844 10.910156 L 2.546875 10.910156 L 2.546875 1.363281 L 11.273438\n 1.363281 Z M 13.453125 2.726562 L 5.453125 2.726562 C 4.65625 2.726562 4 3.339844 4\n 4.089844 L 4 13.636719 C 4 14.386719 4.65625 15 5.453125 15 L 13.453125 15 C 14.253906\n 15 14.910156 14.386719 14.910156 13.636719 L 14.910156 4.089844 C 14.910156 3.339844\n 14.253906 2.726562 13.453125 2.726562 Z M 13.453125 13.636719 L 5.453125 13.636719 L\n 5.453125 4.089844 L 13.453125 4.089844 Z M 13.453125 13.636719 "}}),_v("\n ")]),_v("\n")]),_v("\n\n ")]),_v("\n ")])])]),_v(" "),_c('h2',{attrs:{"id":"resources"}},[_v("Resources"),_c('a',{staticClass:"fa fa-anchor",attrs:{"href":"#resources","onclick":"event.stopPropagation()"}})]),_v(" "),_c('ul',[_c('li',[_c('a',{attrs:{"href":"https://docs.gradle.org/current/userguide/userguide.html"}},[_v("Official Gradle Documentation")])])]),_v(" "),_c('hr'),_v(" "),_c('p',[_c('strong',[_v("Authors:")])]),_v(" "),_c('ul',[_c('li',[_v("Initial Version: Jeffry Lum")])])],1)],1)],1),_c('p')],1),_v(" "),_c('overlay-source',{staticClass:"fixed-header-padding",attrs:{"id":"page-nav","tag-name":"nav","to":"page-nav"}},[_c('div',{staticClass:"nav-component slim-scroll"},[_c('overlay-source',{staticClass:"nav nav-pills flex-column my-0 small no-flex-wrap",attrs:{"id":"mb-page-nav","tag-name":"nav","to":"mb-page-nav"}},[_c('a',{pre:true,attrs:{"class":"nav-link py-1","href":"#gradle-tutorial"}},[_v("Gradle tutorial‎")]),_v(" "),_c('nav',{staticClass:"nav nav-pills flex-column my-0 nested no-flex-wrap"},[_c('a',{pre:true,attrs:{"class":"nav-link py-1","href":"#basics"}},[_v("Basics‎")]),_v(" "),_c('a',{pre:true,attrs:{"class":"nav-link py-1","href":"#adding-gradle-to-the-project"}},[_v("Adding Gradle to the project‎")]),_v(" "),_c('a',{pre:true,attrs:{"class":"nav-link py-1","href":"#running-gradle-tasks"}},[_v("Running Gradle tasks‎")]),_v(" "),_c('a',{pre:true,attrs:{"class":"nav-link py-1","href":"#managing-plugins-and-dependencies"}},[_v("Managing plugins and dependencies‎")]),_v(" "),_c('a',{pre:true,attrs:{"class":"nav-link py-1","href":"#using-gradle-to-do-some-common-project-activities"}},[_v("Using Gradle to do some common project activities‎")]),_v(" "),_c('nav',{staticClass:"nav nav-pills flex-column my-0 nested no-flex-wrap"},[_c('a',{pre:true,attrs:{"class":"nav-link py-1","href":"#running-the-application"}},[_v("Running the application‎")]),_v(" "),_c('a',{pre:true,attrs:{"class":"nav-link py-1","href":"#cleaning-the-project"}},[_v("Cleaning the project‎")]),_v(" "),_c('a',{pre:true,attrs:{"class":"nav-link py-1","href":"#running-checkstyle"}},[_v("Running Checkstyle‎")]),_v(" "),_c('a',{pre:true,attrs:{"class":"nav-link py-1","href":"#running-tests"}},[_v("Running tests‎")]),_v(" "),_c('a',{pre:true,attrs:{"class":"nav-link py-1","href":"#creating-jar-files"}},[_v("Creating JAR files‎")]),_v(" "),_c('a',{pre:true,attrs:{"class":"nav-link py-1","href":"#compiling"}},[_v("Compiling‎")]),_v(" "),_c('a',{pre:true,attrs:{"class":"nav-link py-1","href":"#enabling-assertions"}},[_v("Enabling assertions‎")])]),_v(" "),_c('a',{pre:true,attrs:{"class":"nav-link py-1","href":"#resources"}},[_v("Resources‎")])])])],1)]),_v(" "),_c('scroll-top-button')],1),_v(" "),_m(10)])} }; var pageVueStaticRenderFns = [function anonymous( ) { @@ -35,6 +35,6 @@ with(this){return _c('p',[_v("There are several ways of integrating Gradle into with(this){return _c('p',[_c('strong',[_c('strong',[_v("Scenario 1:")])]),_v(" You are setting up a project that already has Gradle wrapper files.")])} },function anonymous( ) { -with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Tue, 24 Sept 2024, 23:18:52 GMT+8]")])])])} +with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Thu, 26 Sept 2024, 17:41:12 GMT+8]")])])])} }]; \ No newline at end of file diff --git a/tutorials/intellijCodeStyle.html b/tutorials/intellijCodeStyle.html index 754a0a19..a244839f 100644 --- a/tutorials/intellijCodeStyle.html +++ b/tutorials/intellijCodeStyle.html @@ -15,7 +15,7 @@

    Guides for SE student projects »

    Intellij IDEA: Configuring the code style

    IntelliJ’s default style is mostly compliant with ours but it uses a different import order from ours but some tweaks may be needed.

    Legend: basic tweak | intermediate tweak | advanced tweak

    Tweak: switch-case style

    1. Go to FileSettings…​ (Windows/Linux), or IntelliJ IDEASettings…​ (macOS).
    2. Click on EditorCode styleJava (see the screenshot below).
    3. Click on the Wrapping and Braces tab and un-tick the Indent 'case' branches option (as shown in the screenshot above).

    Tweak: import order

    1. Go to FileSettings…​ (Windows/Linux), or IntelliJ IDEASettings…​ (macOS).
    2. Select EditorCode StyleJava.
    3. Click on the Imports tab to set the import order. -
      • For Class count to use import with '*' and Names count to use static import with '*': Set to 999 to prevent IntelliJ from contracting the import statements.
      • For Import Layout: The order is:

    Tweak: Auto-remove trailing spaces

    You can configure Intellij to automatically strip trailing white space in code lines, as follows:

    1. Go to Settings.
    2. On the left side of the dialog, click on Editor -> General.
    3. On the right side, scroll to the On Save section.
    4. Change Remove trailing spaces on: to Modified lines.

    More useful settings

    The tweaks given above are specific to code style. A few more useful settings (not related to the code style) can be found here.

    +
    • For Class count to use import with '*' and Names count to use static import with '*': Set to 999 to prevent IntelliJ from contracting the import statements.
    • For Import Layout: The order is:

    Tweak: Auto-remove trailing spaces

    You can configure Intellij to automatically strip trailing white space in code lines, as follows:

    1. Go to Settings.
    2. On the left side of the dialog, click on Editor -> General.
    3. On the right side, scroll to the On Save section.
    4. Change Remove trailing spaces on: to Modified lines.

    More useful settings

    The tweaks given above are specific to code style. A few more useful settings (not related to the code style) can be found here.

    diff --git a/tutorials/intellijCodeStyle.page-vue-render.js b/tutorials/intellijCodeStyle.page-vue-render.js index 927f3616..386b6087 100644 --- a/tutorials/intellijCodeStyle.page-vue-render.js +++ b/tutorials/intellijCodeStyle.page-vue-render.js @@ -8,6 +8,6 @@ with(this){return _c('div',{attrs:{"id":"app"}},[_c('header',{attrs:{"sticky":"" with(this){return _c('div',{staticClass:"fixed-header-padding",attrs:{"id":"content-wrapper"}},[_c('h1',{attrs:{"id":"guides-for-se-student-projects"}},[_c('span',{staticClass:"text-dark"},[_c('strong',[_c('strong',[_v("Guides for SE student projects »")])])]),_c('a',{staticClass:"fa fa-anchor",attrs:{"href":"#guides-for-se-student-projects","onclick":"event.stopPropagation()"}})]),_v(" "),_c('p'),_c('h1',{attrs:{"id":"intellij-idea-configuring-the-code-style"}},[_v("Intellij IDEA: Configuring the code style"),_c('a',{staticClass:"fa fa-anchor",attrs:{"href":"#intellij-idea-configuring-the-code-style","onclick":"event.stopPropagation()"}})]),_v(" "),_c('p',[_v("IntelliJ’s default style is mostly compliant with "),_c('a',{attrs:{"href":"/guides/conventions/java"}},[_v("ours")]),_v(" but it uses a different import order from ours but some tweaks may be needed.")]),_v(" "),_c('p',[_c('strong',[_v("Legend")]),_v(": "),_c('span',[_c('span',{staticClass:"badge rounded-pill bg-danger"},[_c('span',{staticClass:"far fa-star",attrs:{"aria-hidden":"true"}})])]),_v(" basic tweak | "),_c('span',[_c('span',{staticClass:"badge rounded-pill bg-warning text-white"},[_c('span',{staticClass:"far fa-star",attrs:{"aria-hidden":"true"}}),_c('span',{staticClass:"far fa-star",attrs:{"aria-hidden":"true"}})])]),_v(" intermediate tweak | "),_c('span',[_c('span',{staticClass:"badge rounded-pill bg-success"},[_c('span',{staticClass:"far fa-star",attrs:{"aria-hidden":"true"}}),_c('span',{staticClass:"far fa-star",attrs:{"aria-hidden":"true"}}),_c('span',{staticClass:"far fa-star",attrs:{"aria-hidden":"true"}})])]),_v(" advanced tweak")]),_v(" "),_c('h2',{attrs:{"id":"tweak-switch-case-style"}},[_v("Tweak: "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("switch-case")]),_v(" style "),_c('span',[_c('span',{staticClass:"badge rounded-pill bg-danger"},[_c('span',{staticClass:"far fa-star",attrs:{"aria-hidden":"true"}})])]),_c('a',{staticClass:"fa fa-anchor",attrs:{"href":"#tweak-switch-case-style","onclick":"event.stopPropagation()"}})]),_v(" "),_c('ol',[_c('li',[_v("Go to "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("File")]),_v(" → "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Settings…​")]),_v(" (Windows/Linux), or "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("IntelliJ IDEA")]),_v(" → "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Settings…​")]),_v(" (macOS).")]),_v(" "),_c('li',[_v("Click on "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Editor")]),_v(" → "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Code style")]),_v("→ "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Java")]),_v(" (see the screenshot below)."),_c('br'),_v(" "),_c('a',{attrs:{"href":"/guides/tutorials/images/intellij/codeStyle-switch.png","target":"_self"}},[_c('img',{staticClass:"img-fluid",attrs:{"src":"/guides/tutorials/images/intellij/codeStyle-switch.png","alt":""}})])]),_v(" "),_c('li',[_v("Click on the "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Wrapping and Braces")]),_v(" tab and un-tick the "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Indent 'case' branches")]),_v(" option (as shown in the screenshot above).")])]),_v(" "),_c('h2',{attrs:{"id":"tweak-import-order"}},[_v("Tweak: "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("import")]),_v(" order "),_c('span',[_c('span',{staticClass:"badge rounded-pill bg-warning text-white"},[_c('span',{staticClass:"far fa-star",attrs:{"aria-hidden":"true"}}),_c('span',{staticClass:"far fa-star",attrs:{"aria-hidden":"true"}})])]),_c('a',{staticClass:"fa fa-anchor",attrs:{"href":"#tweak-import-order","onclick":"event.stopPropagation()"}})]),_v(" "),_c('ol',[_c('li',[_v("Go to "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("File")]),_v(" → "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Settings…​")]),_v(" (Windows/Linux), or "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("IntelliJ IDEA")]),_v(" → "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Settings…​")]),_v(" (macOS).")]),_v(" "),_c('li',[_v("Select "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Editor")]),_v(" → "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Code Style")]),_v(" → "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Java")]),_v(".")]),_v(" "),_c('li',[_v("Click on the "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Imports")]),_v(" tab to set the import order.\n"),_c('ul',[_c('li',[_v("For "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Class count to use import with '*'")]),_v(" and "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Names count to use static import with '*'")]),_v(": Set to "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("999")]),_v(" to prevent IntelliJ from contracting the import statements.")]),_v(" "),_c('li',[_v("For "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Import Layout")]),_v(": The order is:"),_c('br'),_v(" "),_c('a',{attrs:{"href":"/guides/tutorials/images/intellij/importOrder.png","target":"_self"}},[_c('img',{staticClass:"img-fluid",attrs:{"src":"/guides/tutorials/images/intellij/importOrder.png","alt":""}})])])])])]),_v(" "),_c('h2',{attrs:{"id":"tweak-auto-remove-trailing-spaces"}},[_v("Tweak: Auto-remove trailing spaces "),_c('span',[_c('span',{staticClass:"badge rounded-pill bg-warning text-white"},[_c('span',{staticClass:"far fa-star",attrs:{"aria-hidden":"true"}}),_c('span',{staticClass:"far fa-star",attrs:{"aria-hidden":"true"}})])]),_c('a',{staticClass:"fa fa-anchor",attrs:{"href":"#tweak-auto-remove-trailing-spaces","onclick":"event.stopPropagation()"}})]),_v(" "),_c('p',[_v("You can configure Intellij to automatically strip trailing white space in code lines, as follows:")]),_v(" "),_c('ol',[_c('li',[_v("Go to "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Settings")]),_v(".")]),_v(" "),_c('li',[_v("On the left side of the dialog, click on "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Editor")]),_v(" -> "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("General")]),_v(".")]),_v(" "),_c('li',[_v("On the right side, scroll to the "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("On Save")]),_v(" section.")]),_v(" "),_c('li',[_v("Change "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Remove trailing spaces on:")]),_v(" to "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Modified lines")]),_v(".")])]),_v(" "),_c('h2',{attrs:{"id":"more-useful-settings"}},[_v("More useful settings "),_c('span',[_c('span',{staticClass:"badge rounded-pill bg-success"},[_c('span',{staticClass:"far fa-star",attrs:{"aria-hidden":"true"}}),_c('span',{staticClass:"far fa-star",attrs:{"aria-hidden":"true"}}),_c('span',{staticClass:"far fa-star",attrs:{"aria-hidden":"true"}})])]),_c('a',{staticClass:"fa fa-anchor",attrs:{"href":"#more-useful-settings","onclick":"event.stopPropagation()"}})]),_v(" "),_c('p',[_v("The tweaks given above are specific to code style. A few more useful settings (not related to the code style) can be found "),_c('a',{attrs:{"href":"/guides/tutorials/intellijUsefulSettings.html"}},[_v("here")]),_v(".")]),_c('p')])} },function anonymous( ) { -with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Tue, 24 Sept 2024, 23:18:52 GMT+8]")])])])} +with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Thu, 26 Sept 2024, 17:41:12 GMT+8]")])])])} }]; \ No newline at end of file diff --git a/tutorials/intellijDebugger.html b/tutorials/intellijDebugger.html index 209c20a5..ae075a6e 100644 --- a/tutorials/intellijDebugger.html +++ b/tutorials/intellijDebugger.html @@ -15,7 +15,7 @@

    Guides for SE student projects »

    Intellij IDEA: Using the debugger

    This tutorial covers basics of the Intellij IDEA's debugging features.

    • If you are new to using an IDE-based debugger, we recommend that you watch the following video (from LaunchCode) which gives a pretty good explanation of how to use the IntelliJ IDEA debugger.

      Debugging in IntelliJ


    • To recall how to use a specific feature, you can use the sections below.

    Setting breakpoints

    Purpose: A breakpoint is a line in the code at which the debugger will pause the execution.

    How: Click on the left gutter of the editor pane, at the line where you want to breakpoint. A red dot will appear to indicate the breakpoint.


    [image credit: Intelli]

    To remove the breakpoint, click the red dot again.

    Video segment 3.09 - 3.30 :

    More info from Intellij is here.

    Running the code in 'debugger mode'

    Purpose: To get Intellij to run the code in the debugger mode, so that the debugger can direct the execution flow as needed by the debugging.

    How: There are several ways. One of them is to click the icon in the gutter near the class with the main() method and select Debug.


    [image credit: Intelli]

    Video segment 3.53 - 4.00 :

    More info from Intellij is here.

    Examining the state of the suspended program

    Purpose: To examine variable values at a specific step of the execution.

    How: Use the Debugger tool window (the bottom part of the screenshot below). Ccurrent value of each variable is listed in the panel on the bottom right.


    [image credit: LaunchCode]

    Show execution point feature can be used to jump to the line of code that the debugger has stopped at (in case the line is not currently visible in the code editor):

    ShowExecutionPoint

    Video segment 4.41 - 6.06 :

    More info from Intellij is here.

    Stepping through code

    Purpose: Executes the current statement, and move to the next statement.

    How: Click the Step Over button in the debugger toolbar, as shown below.


    [image credit: se-edu]

    Video segment 7.30 - 7.55 :

    More info from Intellij is here.

    Stepping into a method

    Purpose: Suppose the current statement calls another method, and you are interested to see how the execution goes through that method. Here, you can step into that method.

    How: Click the Step Into button in the debugger toolbar, as shown below.


    [image credit: se-edu]

    Video segment 13.05 - 13.35 :

    When trying to step into a statement such as storage.saveAddressBook(model.getAddressBook()) which contains multiple method calls, Intellij will let you choose (by clicking) which one you want to step into.

    More info from Intellij is here.

    Stepping out of a method

    Purpose: Executes the remaining lines of code in the current method and returns to the caller.
    -Used when you've stepped into a method, stepped through some of it, and now want to return to the caller method without stepping through the remainder of the current method.

    How: Click the Step Out button in the debugger toolbar, as shown below.


    [image credit: LaunchCode]

    Video segment 13.45 - 13.55 :

    More info from Intellij is here.

    Setting a conditional breakpoint

    Purpose: To pause the execution at a certain breakpoint only when a certain condition is met e.g., to stop at a breakpoint only when the 100th iteration of a loop.

    How: Right-click on a breakpoint and enter a condition (e.g., i == 5)


    [image credit: LaunchCode]

    Video segment 15.20 - 16.45 :

    Evaluate expression

    Purpose: Allows you to compute the value of an expression at a specific point during execution, enabling dynamic inspection of variables and data structures.
    e.g., while debugging, you want to find the result of expressions truncate(myVariable * 2) based on the current value myVariable

    How: Enter it in the Evaluate expression field in the Variables pane (shown below) and press Enter.


    [image credit: Tom Gregory Tech]

    More info from Intellij is here.

    Set an exception breakpoint

    Purpose: To pause execution whenever a specified exception is thrown, regardless of where it occurs in your code, making it easier to identify and diagnose issues.

    How: Choose Run > View Breakpoints from the main menu, and use the icon to add an exception breakpoint, as shown below.


    [image credit: Tom Gregory Tech]

    More info from Intellij is here.


    Authors:

    +Used when you've stepped into a method, stepped through some of it, and now want to return to the caller method without stepping through the remainder of the current method.

    How: Click the Step Out button in the debugger toolbar, as shown below.


    [image credit: LaunchCode]

    Video segment 13.45 - 13.55 :

    More info from Intellij is here.

    Setting a conditional breakpoint

    Purpose: To pause the execution at a certain breakpoint only when a certain condition is met e.g., to stop at a breakpoint only when the 100th iteration of a loop.

    How: Right-click on a breakpoint and enter a condition (e.g., i == 5)


    [image credit: LaunchCode]

    Video segment 15.20 - 16.45 :

    Evaluate expression

    Purpose: Allows you to compute the value of an expression at a specific point during execution, enabling dynamic inspection of variables and data structures.
    e.g., while debugging, you want to find the result of expressions truncate(myVariable * 2) based on the current value myVariable

    How: Enter it in the Evaluate expression field in the Variables pane (shown below) and press Enter.


    [image credit: Tom Gregory Tech]

    More info from Intellij is here.

    Set an exception breakpoint

    Purpose: To pause execution whenever a specified exception is thrown, regardless of where it occurs in your code, making it easier to identify and diagnose issues.

    How: Choose Run > View Breakpoints from the main menu, and use the icon to add an exception breakpoint, as shown below.


    [image credit: Tom Gregory Tech]

    More info from Intellij is here.


    Authors:

    diff --git a/tutorials/intellijDebugger.page-vue-render.js b/tutorials/intellijDebugger.page-vue-render.js index fb947cfc..14522424 100644 --- a/tutorials/intellijDebugger.page-vue-render.js +++ b/tutorials/intellijDebugger.page-vue-render.js @@ -131,6 +131,6 @@ with(this){return _c('p',[_c('strong',[_v("Authors:")])])} with(this){return _c('ul',[_c('li',[_v("Initial Version: "),_c('a',{attrs:{"href":"https://github.com/ruishanteo"}},[_v("@ruishanteo")])])])} },function anonymous( ) { -with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Tue, 24 Sept 2024, 23:18:52 GMT+8]")])])])} +with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Thu, 26 Sept 2024, 17:41:12 GMT+8]")])])])} }]; \ No newline at end of file diff --git a/tutorials/intellijImportGradleProject.html b/tutorials/intellijImportGradleProject.html index 331b919e..bf1f0f40 100644 --- a/tutorials/intellijImportGradleProject.html +++ b/tutorials/intellijImportGradleProject.html @@ -17,9 +17,8 @@

    Guides for SE student projects »

    Intellij IDEA: Importing a Gradle project

    If the project comes with Gradle support, you will see a build.gradle file in your project root.

    IntelliJ IDEA has the Gradle plugin installed by default. If you have disabled it, go to FileSettingsPlugins to re-enable it.
    If your project involves GUI programming, similarly ensure the JavaFX plugin has not been disabled.

    1. Open Intellij.
    2. If you are in the welcome screen, Click Open. Otherwise, click File -> Open.
      i. Select the project directory, and click OK.
      -ii. If there are any further prompts, accept the defaults but do ensure that the selected version of Gradle JVM matches the JDK being used for the project.
    3. Confirm the correct Java version is being used for Gradle, as follows:
      -(a) Confirm the project JDK is set to the one you are supposed to use for the project, as explained here.
      -(b) Confirm the correct JVM is used for Gradle, as given in the panel below:

    Intellij: Setting the JVM for Gradle

    Go to File -> Settings and ensure the Gradle JVM is set as Project SDK ..., so that Gradle will use the same JDK used by the project.

    Also take note of the Build and run using: and Run tests using: settings. They are useful if you want to control whether you want Intellij to use Gradle to build/run/test your project.


    1. After the importing of the project is complete (which could take a few minutes), you will see the Gradle Toolbar in the IDEA interface e.g., look for the elephant icon (on Windows, this appears on the right-edge of the IDE window) and click it.
      Gradle icon

    +ii. If there are any further prompts, accept the defaults but do ensure that the selected version of Gradle JVM matches the JDK being used for the project.
  • Confirm the correct Java version is being used for Gradle, as follows:
  • (a) Confirm the project JDK is set to the one you are supposed to use for the project, as explained here.
    +(b) Confirm the correct JVM is used for Gradle, as given in the panel below:

    Intellij: Setting the JVM for Gradle

    Go to File -> Settings and ensure the Gradle JVM is set as Project SDK ..., so that Gradle will use the same JDK used by the project.

    Also take note of the Build and run using: and Run tests using: settings. They are useful if you want to control whether you want Intellij to use Gradle to build/run/test your project.


    1. After the importing of the project is complete (which could take a few minutes), you will see the Gradle Toolbar in the IDEA interface e.g., look for the elephant icon (on Windows, this appears on the right-edge of the IDE window) and click it.
      Gradle icon

    diff --git a/tutorials/intellijImportGradleProject.page-vue-render.js b/tutorials/intellijImportGradleProject.page-vue-render.js index b8fb639e..c4478688 100644 --- a/tutorials/intellijImportGradleProject.page-vue-render.js +++ b/tutorials/intellijImportGradleProject.page-vue-render.js @@ -1,7 +1,7 @@ var pageVueRenderFn = function anonymous( ) { -with(this){return _c('div',{attrs:{"id":"app"}},[_c('header',{attrs:{"sticky":""}},[_c('navbar',{attrs:{"type":"dark"},scopedSlots:_u([{key:"brand",fn:function(){return [_c('a',{staticClass:"navbar-brand",attrs:{"href":"https://se-education.org","title":"SE-EDU"}},[_c('span',[_c('span',{staticClass:"fas fa-chevron-circle-left",attrs:{"aria-hidden":"true"}}),_v(" "),_c('strong',[_c('strong',[_v("SE-EDU")])])])])]},proxy:true},{key:"right",fn:function(){return [_c('li',{staticClass:"nav-link"},[_c('form',{staticClass:"navbar-form"},[_c('searchbar',{attrs:{"data":searchData,"placeholder":"Search this site","on-hit":searchCallback,"menu-align-right":""}})],1)])]},proxy:true}])},[_v(" "),_c('li',[_c('a',{staticClass:"nav-link",attrs:{"href":"/guides/index.html"}},[_c('span',[_c('strong',[_v("Home")])])])]),_v(" "),_c('li',[_c('a',{staticClass:"nav-link",attrs:{"href":"/guides/about.html"}},[_c('span',[_c('strong',[_v("About")])])])]),_v(" "),_c('li',[_c('a',{staticClass:"nav-link",attrs:{"href":"https://github.com/se-edu/guides"}},[_c('span',[_c('span',{staticClass:"fab fa-github",attrs:{"aria-hidden":"true"}})])])])])],1),_v(" "),_c('div',{attrs:{"id":"flex-body"}},[_c('div',{staticClass:"fixed-header-padding",attrs:{"id":"content-wrapper"}},[_m(0),_v(" "),_c('p'),_m(1),_v(" "),_c('div',{attrs:{"id":"importing-gradle-project"}},[_c('box',{attrs:{"type":"tip","seamless":""}},[_c('p',[_v("If the project comes with Gradle support, you will see a "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("build.gradle")]),_v(" file in your project root.")])]),_v(" "),_c('box',{attrs:{"type":"warning","seamless":""}},[_c('p',[_v("IntelliJ IDEA has the Gradle plugin installed by default. If you have disabled it, go to "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("File")]),_v(" → "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Settings")]),_v(" → "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Plugins")]),_v(" to re-enable it."),_c('br'),_v("\nIf your project involves GUI programming, similarly ensure the JavaFX plugin has not been disabled.")])]),_v(" "),_m(2),_v(" "),_c('div',{staticClass:"indented-level2"},[_c('panel',{attrs:{"peek":""},scopedSlots:_u([{key:"header",fn:function(){return [_c('p',[_v("Intellij: Setting the JVM for Gradle")])]},proxy:true}])},[_v(" "),_c('p',[_v("Go to "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("File")]),_v(" -> "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Settings")]),_v(" and ensure the "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Gradle JVM")]),_v(" is set as "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Project SDK ...")]),_v(", so that Gradle will use the same JDK used by the project.")]),_v(" "),_c('pic',{attrs:{"src":"/guides/tutorials/images/gradle/intellijSetGradleJvm.png"}}),_v(" "),_c('p',[_v("Also take note of the "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Build and run using:")]),_v(" and "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Run tests using:")]),_v(" settings. They are useful if you want to control whether you want Intellij to use Gradle to build/run/test your project.")])],1)],1),_v(" "),_m(3)],1),_c('p')]),_v(" "),_c('overlay-source',{staticClass:"fixed-header-padding",attrs:{"id":"page-nav","tag-name":"nav","to":"page-nav"}},[_c('div',{staticClass:"nav-component slim-scroll"})]),_v(" "),_c('scroll-top-button')],1),_v(" "),_m(4)])} +with(this){return _c('div',{attrs:{"id":"app"}},[_c('header',{attrs:{"sticky":""}},[_c('navbar',{attrs:{"type":"dark"},scopedSlots:_u([{key:"brand",fn:function(){return [_c('a',{staticClass:"navbar-brand",attrs:{"href":"https://se-education.org","title":"SE-EDU"}},[_c('span',[_c('span',{staticClass:"fas fa-chevron-circle-left",attrs:{"aria-hidden":"true"}}),_v(" "),_c('strong',[_c('strong',[_v("SE-EDU")])])])])]},proxy:true},{key:"right",fn:function(){return [_c('li',{staticClass:"nav-link"},[_c('form',{staticClass:"navbar-form"},[_c('searchbar',{attrs:{"data":searchData,"placeholder":"Search this site","on-hit":searchCallback,"menu-align-right":""}})],1)])]},proxy:true}])},[_v(" "),_c('li',[_c('a',{staticClass:"nav-link",attrs:{"href":"/guides/index.html"}},[_c('span',[_c('strong',[_v("Home")])])])]),_v(" "),_c('li',[_c('a',{staticClass:"nav-link",attrs:{"href":"/guides/about.html"}},[_c('span',[_c('strong',[_v("About")])])])]),_v(" "),_c('li',[_c('a',{staticClass:"nav-link",attrs:{"href":"https://github.com/se-edu/guides"}},[_c('span',[_c('span',{staticClass:"fab fa-github",attrs:{"aria-hidden":"true"}})])])])])],1),_v(" "),_c('div',{attrs:{"id":"flex-body"}},[_c('div',{staticClass:"fixed-header-padding",attrs:{"id":"content-wrapper"}},[_m(0),_v(" "),_c('p'),_m(1),_v(" "),_c('div',{attrs:{"id":"importing-gradle-project"}},[_c('box',{attrs:{"type":"tip","seamless":""}},[_c('p',[_v("If the project comes with Gradle support, you will see a "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("build.gradle")]),_v(" file in your project root.")])]),_v(" "),_c('box',{attrs:{"type":"warning","seamless":""}},[_c('p',[_v("IntelliJ IDEA has the Gradle plugin installed by default. If you have disabled it, go to "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("File")]),_v(" → "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Settings")]),_v(" → "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Plugins")]),_v(" to re-enable it."),_c('br'),_v("\nIf your project involves GUI programming, similarly ensure the JavaFX plugin has not been disabled.")])]),_v(" "),_m(2),_v(" "),_c('div',{staticClass:"indented-level1",attrs:{"id":"configure-intellij-sdk"}},[_m(3),_v(" "),_c('div',{staticClass:"indented-level1"},[_c('panel',{attrs:{"peek":""},scopedSlots:_u([{key:"header",fn:function(){return [_c('p',[_v("Intellij: Setting the JVM for Gradle")])]},proxy:true}])},[_v(" "),_c('p',[_v("Go to "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("File")]),_v(" -> "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Settings")]),_v(" and ensure the "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Gradle JVM")]),_v(" is set as "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Project SDK ...")]),_v(", so that Gradle will use the same JDK used by the project.")]),_v(" "),_c('pic',{attrs:{"src":"/guides/tutorials/images/gradle/intellijSetGradleJvm.png"}}),_v(" "),_c('p',[_v("Also take note of the "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Build and run using:")]),_v(" and "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Run tests using:")]),_v(" settings. They are useful if you want to control whether you want Intellij to use Gradle to build/run/test your project.")])],1)],1)]),_v(" "),_m(4)],1),_c('p')]),_v(" "),_c('overlay-source',{staticClass:"fixed-header-padding",attrs:{"id":"page-nav","tag-name":"nav","to":"page-nav"}},[_c('div',{staticClass:"nav-component slim-scroll"})]),_v(" "),_c('scroll-top-button')],1),_v(" "),_m(5)])} }; var pageVueStaticRenderFns = [function anonymous( ) { @@ -11,12 +11,15 @@ with(this){return _c('h1',{attrs:{"id":"guides-for-se-student-projects"}},[_c('s with(this){return _c('h1',{attrs:{"id":"intellij-idea-importing-a-gradle-project"}},[_v("Intellij IDEA: Importing a Gradle project"),_c('a',{staticClass:"fa fa-anchor",attrs:{"href":"#intellij-idea-importing-a-gradle-project","onclick":"event.stopPropagation()"}})])} },function anonymous( ) { -with(this){return _c('ol',[_c('li',[_v("Open Intellij.")]),_v(" "),_c('li',[_v("If you are in the welcome screen, Click "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Open")]),_v(". Otherwise, click "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("File")]),_v(" -> "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Open")]),_v("."),_c('br'),_v("\ni. Select the project directory, and click "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("OK")]),_v("."),_c('br'),_v("\nii. If there are any further prompts, accept the defaults but do ensure that the selected version of "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Gradle JVM")]),_v(" matches the JDK being used for the project.")]),_v(" "),_c('li',[_v("Confirm the correct Java version is being used for Gradle, as follows:"),_c('br'),_v("\n(a) Confirm the project JDK is set to the one you are supposed to use for the project, as explained "),_c('a',{attrs:{"href":"https://www.jetbrains.com/help/idea/sdk.html#set-up-jdk"}},[_v("here")]),_v("."),_c('br'),_v("\n(b) Confirm the correct JVM is used for Gradle, as given in the panel below:")])])} +with(this){return _c('ol',[_c('li',[_v("Open Intellij.")]),_v(" "),_c('li',[_v("If you are in the welcome screen, Click "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Open")]),_v(". Otherwise, click "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("File")]),_v(" -> "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Open")]),_v("."),_c('br'),_v("\ni. Select the project directory, and click "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("OK")]),_v("."),_c('br'),_v("\nii. If there are any further prompts, accept the defaults but do ensure that the selected version of "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Gradle JVM")]),_v(" matches the JDK being used for the project.")]),_v(" "),_c('li',[_v("Confirm the correct Java version is being used for Gradle, as follows:")])])} +},function anonymous( +) { +with(this){return _c('p',[_v("(a) Confirm the project JDK is set to the one you are supposed to use for the project, as explained "),_c('a',{attrs:{"href":"https://www.jetbrains.com/help/idea/sdk.html#set-up-jdk"}},[_v("here")]),_v("."),_c('br'),_v("\n(b) Confirm the correct JVM is used for Gradle, as given in the panel below:")])} },function anonymous( ) { with(this){return _c('ol',{attrs:{"start":"4"}},[_c('li',[_v("After the importing of the project is complete (which could take a few minutes), you will see the "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Gradle Toolbar")]),_v(" in the IDEA interface "),_c('span',{staticClass:"dimmed"},[_v("e.g., look for the elephant icon (on Windows, this appears on the right-edge of the IDE window) and click it")]),_v("."),_c('br'),_v(" "),_c('a',{attrs:{"href":"/guides/tutorials/images/gradle/GradleIcon.png","target":"_self"}},[_c('img',{staticClass:"img-fluid",attrs:{"src":"/guides/tutorials/images/gradle/GradleIcon.png","alt":"Gradle icon"}})])])])} },function anonymous( ) { -with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Tue, 24 Sept 2024, 23:18:52 GMT+8]")])])])} +with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Thu, 26 Sept 2024, 17:41:12 GMT+8]")])])])} }]; \ No newline at end of file diff --git a/tutorials/intellijJdk.html b/tutorials/intellijJdk.html index c2dfc130..eb9cfbf9 100644 --- a/tutorials/intellijJdk.html +++ b/tutorials/intellijJdk.html @@ -4,7 +4,7 @@ - Intellij IDEA: Configuring the JDK + Intellij IDEA: Configuring the JDK @@ -14,7 +14,8 @@

    Guides for SE student projects »

    Intellij IDEA: Configuring the JDK

    Please refer to Intellij's own documentation here.

    +

    Guides for SE student projects »

    Intellij IDEA: Configuring the JDK

    Note: step (b) is needed only if your project is using Gradle (i.e., if there is a build.gradle file in the project root folder).

    (a) Confirm the project JDK is set to the one you are supposed to use for the project, as explained here.
    +(b) Confirm the correct JVM is used for Gradle, as given in the panel below:

    Intellij: Setting the JVM for Gradle

    Go to File -> Settings and ensure the Gradle JVM is set as Project SDK ..., so that Gradle will use the same JDK used by the project.

    Also take note of the Build and run using: and Run tests using: settings. They are useful if you want to control whether you want Intellij to use Gradle to build/run/test your project.


    diff --git a/tutorials/intellijJdk.page-vue-render.js b/tutorials/intellijJdk.page-vue-render.js index 811583fa..5bdcfe63 100644 --- a/tutorials/intellijJdk.page-vue-render.js +++ b/tutorials/intellijJdk.page-vue-render.js @@ -1,13 +1,19 @@ var pageVueRenderFn = function anonymous( ) { -with(this){return _c('div',{attrs:{"id":"app"}},[_c('header',{attrs:{"sticky":""}},[_c('navbar',{attrs:{"type":"dark"},scopedSlots:_u([{key:"brand",fn:function(){return [_c('a',{staticClass:"navbar-brand",attrs:{"href":"https://se-education.org","title":"SE-EDU"}},[_c('span',[_c('span',{staticClass:"fas fa-chevron-circle-left",attrs:{"aria-hidden":"true"}}),_v(" "),_c('strong',[_c('strong',[_v("SE-EDU")])])])])]},proxy:true},{key:"right",fn:function(){return [_c('li',{staticClass:"nav-link"},[_c('form',{staticClass:"navbar-form"},[_c('searchbar',{attrs:{"data":searchData,"placeholder":"Search this site","on-hit":searchCallback,"menu-align-right":""}})],1)])]},proxy:true}])},[_v(" "),_c('li',[_c('a',{staticClass:"nav-link",attrs:{"href":"/guides/index.html"}},[_c('span',[_c('strong',[_v("Home")])])])]),_v(" "),_c('li',[_c('a',{staticClass:"nav-link",attrs:{"href":"/guides/about.html"}},[_c('span',[_c('strong',[_v("About")])])])]),_v(" "),_c('li',[_c('a',{staticClass:"nav-link",attrs:{"href":"https://github.com/se-edu/guides"}},[_c('span',[_c('span',{staticClass:"fab fa-github",attrs:{"aria-hidden":"true"}})])])])])],1),_v(" "),_c('div',{attrs:{"id":"flex-body"}},[_m(0),_v(" "),_c('overlay-source',{staticClass:"fixed-header-padding",attrs:{"id":"page-nav","tag-name":"nav","to":"page-nav"}},[_c('div',{staticClass:"nav-component slim-scroll"})]),_v(" "),_c('scroll-top-button')],1),_v(" "),_m(1)])} +with(this){return _c('div',{attrs:{"id":"app"}},[_c('header',{attrs:{"sticky":""}},[_c('navbar',{attrs:{"type":"dark"},scopedSlots:_u([{key:"brand",fn:function(){return [_c('a',{staticClass:"navbar-brand",attrs:{"href":"https://se-education.org","title":"SE-EDU"}},[_c('span',[_c('span',{staticClass:"fas fa-chevron-circle-left",attrs:{"aria-hidden":"true"}}),_v(" "),_c('strong',[_c('strong',[_v("SE-EDU")])])])])]},proxy:true},{key:"right",fn:function(){return [_c('li',{staticClass:"nav-link"},[_c('form',{staticClass:"navbar-form"},[_c('searchbar',{attrs:{"data":searchData,"placeholder":"Search this site","on-hit":searchCallback,"menu-align-right":""}})],1)])]},proxy:true}])},[_v(" "),_c('li',[_c('a',{staticClass:"nav-link",attrs:{"href":"/guides/index.html"}},[_c('span',[_c('strong',[_v("Home")])])])]),_v(" "),_c('li',[_c('a',{staticClass:"nav-link",attrs:{"href":"/guides/about.html"}},[_c('span',[_c('strong',[_v("About")])])])]),_v(" "),_c('li',[_c('a',{staticClass:"nav-link",attrs:{"href":"https://github.com/se-edu/guides"}},[_c('span',[_c('span',{staticClass:"fab fa-github",attrs:{"aria-hidden":"true"}})])])])])],1),_v(" "),_c('div',{attrs:{"id":"flex-body"}},[_c('div',{staticClass:"fixed-header-padding",attrs:{"id":"content-wrapper"}},[_m(0),_v(" "),_c('p'),_m(1),_v(" "),_c('box',{attrs:{"type":"info","seamless":""}},[_c('p',[_v("Note: step (b) is needed only if your project is using Gradle (i.e., if there is a "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("build.gradle")]),_v(" file in the project root folder).")])]),_v(" "),_c('div',[_m(2),_v(" "),_c('div',{staticClass:"indented-level1"},[_c('panel',{attrs:{"peek":""},scopedSlots:_u([{key:"header",fn:function(){return [_c('p',[_v("Intellij: Setting the JVM for Gradle")])]},proxy:true}])},[_v(" "),_c('p',[_v("Go to "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("File")]),_v(" -> "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Settings")]),_v(" and ensure the "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Gradle JVM")]),_v(" is set as "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Project SDK ...")]),_v(", so that Gradle will use the same JDK used by the project.")]),_v(" "),_c('pic',{attrs:{"src":"/guides/tutorials/images/gradle/intellijSetGradleJvm.png"}}),_v(" "),_c('p',[_v("Also take note of the "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Build and run using:")]),_v(" and "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Run tests using:")]),_v(" settings. They are useful if you want to control whether you want Intellij to use Gradle to build/run/test your project.")])],1)],1)]),_c('p')],1),_v(" "),_c('overlay-source',{staticClass:"fixed-header-padding",attrs:{"id":"page-nav","tag-name":"nav","to":"page-nav"}},[_c('div',{staticClass:"nav-component slim-scroll"})]),_v(" "),_c('scroll-top-button')],1),_v(" "),_m(3)])} }; var pageVueStaticRenderFns = [function anonymous( ) { -with(this){return _c('div',{staticClass:"fixed-header-padding",attrs:{"id":"content-wrapper"}},[_c('h1',{attrs:{"id":"guides-for-se-student-projects"}},[_c('span',{staticClass:"text-dark"},[_c('strong',[_c('strong',[_v("Guides for SE student projects »")])])]),_c('a',{staticClass:"fa fa-anchor",attrs:{"href":"#guides-for-se-student-projects","onclick":"event.stopPropagation()"}})]),_v(" "),_c('p'),_c('h1',{attrs:{"id":"intellij-idea-configuring-the-jdk"}},[_v("Intellij IDEA: Configuring the JDK"),_c('a',{staticClass:"fa fa-anchor",attrs:{"href":"#intellij-idea-configuring-the-jdk","onclick":"event.stopPropagation()"}})]),_v(" "),_c('p',[_v("Please refer to Intellij's own documentation "),_c('a',{attrs:{"href":"https://www.jetbrains.com/help/idea/sdk.html#set-up-jdk"}},[_v("here")]),_v(".")]),_c('p')])} +with(this){return _c('h1',{attrs:{"id":"guides-for-se-student-projects"}},[_c('span',{staticClass:"text-dark"},[_c('strong',[_c('strong',[_v("Guides for SE student projects »")])])]),_c('a',{staticClass:"fa fa-anchor",attrs:{"href":"#guides-for-se-student-projects","onclick":"event.stopPropagation()"}})])} },function anonymous( ) { -with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Tue, 24 Sept 2024, 23:18:52 GMT+8]")])])])} +with(this){return _c('h1',{attrs:{"id":"intellij-idea-configuring-the-jdk"}},[_v("Intellij IDEA: Configuring the JDK"),_c('a',{staticClass:"fa fa-anchor",attrs:{"href":"#intellij-idea-configuring-the-jdk","onclick":"event.stopPropagation()"}})])} +},function anonymous( +) { +with(this){return _c('p',[_v("(a) Confirm the project JDK is set to the one you are supposed to use for the project, as explained "),_c('a',{attrs:{"href":"https://www.jetbrains.com/help/idea/sdk.html#set-up-jdk"}},[_v("here")]),_v("."),_c('br'),_v("\n(b) Confirm the correct JVM is used for Gradle, as given in the panel below:")])} +},function anonymous( +) { +with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Thu, 26 Sept 2024, 17:41:12 GMT+8]")])])])} }]; \ No newline at end of file diff --git a/tutorials/intellijUsefulSettings.html b/tutorials/intellijUsefulSettings.html index fc576dde..ac1711d3 100644 --- a/tutorials/intellijUsefulSettings.html +++ b/tutorials/intellijUsefulSettings.html @@ -15,7 +15,7 @@

    Guides for SE student projects »

    Intellij IDEA: Useful settings

    Enabling assertions

    This tweak does not apply if you use Gradle to run code even within Intellij. In that case, refer to 'Enabling assertions' sections of the Gradle tutorial.

    1. Choose RunEdit Configurations....
    2. Select the run configuration of interest.
    3. Click on Modify options link and choose Add VM options
    4. Add -ea to the VM options box. -

    Enabling soft wrapping

    While it is common to enforce a maximum line length for code written in some languages (typically, for code made up of statements such as Java), it is also common not to enforce such a limit for source content that contain paragraph-like structures (e.g., Markdown, HTML). In such cases, you'll need to scroll the editor window horizontally to read the content, which can be a frustrating experience. Here's an example (notice how the text continues beyond the visible area of the editor window and you need to use the horizontal scrolling to see the hidden part):

    Luckily, you can use the 'soft wrap' feature of Intellij to get the editor window to put line breaks in the content so that horizontal scrolling is no longer required. Here is how the same code from the above example looks after enabling the soft-wraps feature (notice how the whole text is visible now, due to the soft line breaks added by the editor):

    Read this to find how to enable soft wraps.

    +

    Enabling soft wrapping

    While it is common to enforce a maximum line length for code written in some languages (typically, for code made up of statements such as Java), it is also common not to enforce such a limit for source content that contain paragraph-like structures (e.g., Markdown, HTML). In such cases, you'll need to scroll the editor window horizontally to read the content, which can be a frustrating experience. Here's an example (notice how the text continues beyond the visible area of the editor window and you need to use the horizontal scrolling to see the hidden part):

    Luckily, you can use the 'soft wrap' feature of Intellij to get the editor window to put line breaks in the content so that horizontal scrolling is no longer required. Here is how the same code from the above example looks after enabling the soft-wraps feature (notice how the whole text is visible now, due to the soft line breaks added by the editor):

    Read this to find how to enable soft wraps.

    diff --git a/tutorials/intellijUsefulSettings.page-vue-render.js b/tutorials/intellijUsefulSettings.page-vue-render.js index b44669f1..f98c32b4 100644 --- a/tutorials/intellijUsefulSettings.page-vue-render.js +++ b/tutorials/intellijUsefulSettings.page-vue-render.js @@ -26,6 +26,6 @@ with(this){return _c('p',[_v("While it is common to enforce a maximum line lengt with(this){return _c('p',[_v("Read "),_c('a',{attrs:{"href":"https://www.jetbrains.com/idea/guide/tips/enable-soft-wrap/"}},[_v("this")]),_v(" to find how to enable soft wraps.")])} },function anonymous( ) { -with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Tue, 24 Sept 2024, 23:18:52 GMT+8]")])])])} +with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Thu, 26 Sept 2024, 17:41:12 GMT+8]")])])])} }]; \ No newline at end of file diff --git a/tutorials/jar.html b/tutorials/jar.html index e00a4027..58890f4a 100644 --- a/tutorials/jar.html +++ b/tutorials/jar.html @@ -72,7 +72,7 @@ -

    If you are using JavaFX, see the panel below to find what else you need to add to the build.gradle to pack JavaFX libraries into the generated JAR file.


    Creating a JAR file in Intellij - A video by Artur Spirin:

    If your app uses third-party libraries, you are recommended to create a fat JAR file using Gradle instead.

    Although JUnit is a third-party library, you need not package it into a fat JAR file because JUnit is used only in the test code, not in the application code.

    But if you use JavaFX, you need to package the JavaFX libraries into a fat JAR file.


    Resources

    +

    If you are using JavaFX, see the panel below to find what else you need to add to the build.gradle to pack JavaFX libraries into the generated JAR file.


    Creating a JAR file in Intellij - A video by Artur Spirin:

    If your app uses third-party libraries, you are recommended to create a fat JAR file using Gradle instead.

    Although JUnit is a third-party library, you need not package it into a fat JAR file because JUnit is used only in the test code, not in the application code.

    But if you use JavaFX, you need to package the JavaFX libraries into a fat JAR file.


    Resources

    diff --git a/tutorials/jar.page-vue-render.js b/tutorials/jar.page-vue-render.js index 1d5e697c..773a7e21 100644 --- a/tutorials/jar.page-vue-render.js +++ b/tutorials/jar.page-vue-render.js @@ -44,6 +44,6 @@ with(this){return _c('h2',{attrs:{"id":"resources"}},[_v("Resources"),_c('a',{st with(this){return _c('ul',[_c('li',[_c('a',{attrs:{"href":"https://docs.oracle.com/javase/tutorial/deployment/jar/basicsindex.html"}},[_v("Oracle's tutorial on JAR files")])]),_v(" "),_c('li',[_c('a',{attrs:{"href":"https://plugins.gradle.org/plugin/com.github.johnrengelman.shadow"}},[_v("Gradle documentation for the Shadow plugin")])]),_v(" "),_c('li',[_c('a',{attrs:{"href":"https://imperceptiblethoughts.com/shadow/introduction/"}},[_v("Shadow plugin homepage")])])])} },function anonymous( ) { -with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Tue, 24 Sept 2024, 23:18:52 GMT+8]")])])])} +with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Thu, 26 Sept 2024, 17:41:12 GMT+8]")])])])} }]; \ No newline at end of file diff --git a/tutorials/javaFx.html b/tutorials/javaFx.html index 9750ddaf..406321d3 100644 --- a/tutorials/javaFx.html +++ b/tutorials/javaFx.html @@ -14,7 +14,7 @@
    + diff --git a/tutorials/javaFx.page-vue-render.js b/tutorials/javaFx.page-vue-render.js index b5d86eda..8ea7edad 100644 --- a/tutorials/javaFx.page-vue-render.js +++ b/tutorials/javaFx.page-vue-render.js @@ -8,6 +8,6 @@ with(this){return _c('div',{attrs:{"id":"app"}},[_c('header',{attrs:{"sticky":"" with(this){return _c('div',{staticClass:"fixed-header-padding",attrs:{"id":"content-wrapper"}},[_c('h1',{attrs:{"id":"guides-for-se-student-projects"}},[_c('span',{staticClass:"text-dark"},[_c('strong',[_c('strong',[_v("Guides for SE student projects »")])])]),_c('a',{staticClass:"fa fa-anchor",attrs:{"href":"#guides-for-se-student-projects","onclick":"event.stopPropagation()"}})]),_v(" "),_c('p'),_c('h1',{attrs:{"id":"javafx-tutorial"}},[_v("JavaFX tutorial"),_c('a',{staticClass:"fa fa-anchor",attrs:{"href":"#javafx-tutorial","onclick":"event.stopPropagation()"}})]),_v(" "),_c('ul',[_c('li',[_c('a',{attrs:{"href":"/guides/tutorials/javaFxPart1.html"}},[_v("Part 1: Introduction")])]),_v(" "),_c('li',[_c('a',{attrs:{"href":"/guides/tutorials/javaFxPart2.html"}},[_v("Part 2: Creating a GUI for Duke")])]),_v(" "),_c('li',[_c('a',{attrs:{"href":"/guides/tutorials/javaFxPart3.html"}},[_v("Part 3: Interacting with the user")])]),_v(" "),_c('li',[_c('a',{attrs:{"href":"/guides/tutorials/javaFxPart4.html"}},[_v("Part 4: Using FXML")])]),_v(" "),_c('li',[_c('a',{attrs:{"href":"/guides/tutorials/javaFxPart5.html"}},[_v("Part 5: Tweaking the GUI")])])]),_c('p')])} },function anonymous( ) { -with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Tue, 24 Sept 2024, 23:18:52 GMT+8]")])])])} +with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Thu, 26 Sept 2024, 17:41:12 GMT+8]")])])])} }]; \ No newline at end of file diff --git a/tutorials/javaFxPart1.html b/tutorials/javaFxPart1.html index 12554bc4..41de7455 100644 --- a/tutorials/javaFxPart1.html +++ b/tutorials/javaFxPart1.html @@ -164,7 +164,7 @@ -

    This approach enables JavaFX to create the Application instance using the newly defined no-argument constructor, while preserving the functionality of the existing constructor.

    Now, run the application (e.g., run ./gradlew run command in the terminal) and you should see something like this:

    Hello World

    The following warning issued by Java runtime can be ignored. This warning appears when you use a later JavaFX version (e.g., 17) with a JDK version that doesn't support the modules feature yet (e.g., Java 11).

    WARNING: Unsupported JavaFX configuration: classes were loaded from 'unnamed module @...

    Similarly, the warning about the different versions (if any) can be ignored as well.

    WARNING: Loading FXML document with JavaFX API of version ___ by JavaFX runtime of version ___

    Congratulations! You have created your first GUI application!

    ToC | What's next? JavaFX tutorial part 2 - Creating a GUI for Duke


    Authors:

    • Initial Version: Jeffry Lum

    +

    This approach enables JavaFX to create the Application instance using the newly defined no-argument constructor, while preserving the functionality of the existing constructor.

    Now, run the application (e.g., run ./gradlew run command in the terminal) and you should see something like this:

    Hello World

    The following warning issued by Java runtime can be ignored. This warning appears when you use a later JavaFX version (e.g., 17) with a JDK version that doesn't support the modules feature yet (e.g., Java 11).

    WARNING: Unsupported JavaFX configuration: classes were loaded from 'unnamed module @...

    Similarly, the warning about the different versions (if any) can be ignored as well.

    WARNING: Loading FXML document with JavaFX API of version ___ by JavaFX runtime of version ___

    Congratulations! You have created your first GUI application!

    ToC | What's next? JavaFX tutorial part 2 - Creating a GUI for Duke


    Authors:

    • Initial Version: Jeffry Lum

    diff --git a/tutorials/javaFxPart1.page-vue-render.js b/tutorials/javaFxPart1.page-vue-render.js index e0d2684c..b56fab15 100644 --- a/tutorials/javaFxPart1.page-vue-render.js +++ b/tutorials/javaFxPart1.page-vue-render.js @@ -86,6 +86,6 @@ with(this){return _c('p',[_c('strong',[_v("Authors:")])])} with(this){return _c('ul',[_c('li',[_v("Initial Version: Jeffry Lum")])])} },function anonymous( ) { -with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Tue, 24 Sept 2024, 23:18:52 GMT+8]")])])])} +with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Thu, 26 Sept 2024, 17:41:12 GMT+8]")])])])} }]; \ No newline at end of file diff --git a/tutorials/javaFxPart2.html b/tutorials/javaFxPart2.html index ed9438e1..99868d72 100644 --- a/tutorials/javaFxPart2.html +++ b/tutorials/javaFxPart2.html @@ -227,7 +227,7 @@ -

    Run the application again. It should now look like this:

    Previous | ToC | What's next? JavaFX tutorial part 3 - Interacting with the user


    Authors:

    • Initial Version: Jeffry Lum

    +

    Run the application again. It should now look like this:

    Previous | ToC | What's next? JavaFX tutorial part 3 - Interacting with the user


    Authors:

    • Initial Version: Jeffry Lum

    diff --git a/tutorials/javaFxPart2.page-vue-render.js b/tutorials/javaFxPart2.page-vue-render.js index 9ba01d84..ced5ba35 100644 --- a/tutorials/javaFxPart2.page-vue-render.js +++ b/tutorials/javaFxPart2.page-vue-render.js @@ -104,6 +104,6 @@ with(this){return _c('p',[_c('strong',[_v("Authors:")])])} with(this){return _c('ul',[_c('li',[_v("Initial Version: Jeffry Lum")])])} },function anonymous( ) { -with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Tue, 24 Sept 2024, 23:18:52 GMT+8]")])])])} +with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Thu, 26 Sept 2024, 17:41:12 GMT+8]")])])])} }]; \ No newline at end of file diff --git a/tutorials/javaFxPart3.html b/tutorials/javaFxPart3.html index 21d8274a..16bb05a2 100644 --- a/tutorials/javaFxPart3.html +++ b/tutorials/javaFxPart3.html @@ -263,7 +263,7 @@

    Run the application and play around with it.

    Congratulations! -You have successfully implemented a fully functional GUI for Duke! But there's more. Continue to the next section to find out.

    Previous | ToC | What's next? JavaFX tutorial part 4 - Using FXML


    Authors:

    • Initial Version: Jeffry Lum

    +You have successfully implemented a fully functional GUI for Duke! But there's more. Continue to the next section to find out.

    Previous | ToC | What's next? JavaFX tutorial part 4 - Using FXML


    Authors:

    • Initial Version: Jeffry Lum

    diff --git a/tutorials/javaFxPart3.page-vue-render.js b/tutorials/javaFxPart3.page-vue-render.js index b2fe5b97..b056e366 100644 --- a/tutorials/javaFxPart3.page-vue-render.js +++ b/tutorials/javaFxPart3.page-vue-render.js @@ -110,6 +110,6 @@ with(this){return _c('p',[_c('strong',[_v("Authors:")])])} with(this){return _c('ul',[_c('li',[_v("Initial Version: Jeffry Lum")])])} },function anonymous( ) { -with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Tue, 24 Sept 2024, 23:18:52 GMT+8]")])])])} +with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Thu, 26 Sept 2024, 17:41:12 GMT+8]")])])])} }]; \ No newline at end of file diff --git a/tutorials/javaFxPart4.html b/tutorials/javaFxPart4.html index 3214cba4..9a26435d 100644 --- a/tutorials/javaFxPart4.html +++ b/tutorials/javaFxPart4.html @@ -371,7 +371,7 @@ -

    More about fx:root on the documentation Introduction to FXML | JavaFX 2.2.

    Previous | ToC | What's next? JavaFX tutorial part 5 - Tweaking the GUI


    Authors:

    • Initial Version: Jeffry Lum

    +

    More about fx:root on the documentation Introduction to FXML | JavaFX 2.2.

    Previous | ToC | What's next? JavaFX tutorial part 5 - Tweaking the GUI


    Authors:

    • Initial Version: Jeffry Lum

    diff --git a/tutorials/javaFxPart4.page-vue-render.js b/tutorials/javaFxPart4.page-vue-render.js index 0039b8df..ea9e8505 100644 --- a/tutorials/javaFxPart4.page-vue-render.js +++ b/tutorials/javaFxPart4.page-vue-render.js @@ -113,6 +113,6 @@ with(this){return _c('p',[_c('strong',[_v("Authors:")])])} with(this){return _c('ul',[_c('li',[_v("Initial Version: Jeffry Lum")])])} },function anonymous( ) { -with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Tue, 24 Sept 2024, 23:18:52 GMT+8]")])])])} +with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Thu, 26 Sept 2024, 17:41:12 GMT+8]")])])])} }]; \ No newline at end of file diff --git a/tutorials/javaFxPart5.html b/tutorials/javaFxPart5.html index b753621a..eca5b31e 100644 --- a/tutorials/javaFxPart5.html +++ b/tutorials/javaFxPart5.html @@ -1045,7 +1045,7 @@ -

    Image Opacity Demo

    Other things to consider

    Here are other things you can do with your app to make it more personalized:

    Previous | ToC


    Authors:

    • Initial Version: Debbie Hii (@flexibo)

    +

    Image Opacity Demo

    Other things to consider

    Here are other things you can do with your app to make it more personalized:

    Previous | ToC


    Authors:

    • Initial Version: Debbie Hii (@flexibo)

    diff --git a/tutorials/javaFxPart5.page-vue-render.js b/tutorials/javaFxPart5.page-vue-render.js index f9dd0974..ce09d5c7 100644 --- a/tutorials/javaFxPart5.page-vue-render.js +++ b/tutorials/javaFxPart5.page-vue-render.js @@ -548,6 +548,6 @@ with(this){return _c('p',[_c('strong',[_v("Authors:")])])} with(this){return _c('ul',[_c('li',[_v("Initial Version: Debbie Hii (@flexibo)")])])} },function anonymous( ) { -with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Tue, 24 Sept 2024, 23:18:52 GMT+8]")])])])} +with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Thu, 26 Sept 2024, 17:41:12 GMT+8]")])])])} }]; \ No newline at end of file diff --git a/tutorials/javaInstallationMac.html b/tutorials/javaInstallationMac.html index b4bb4f3a..859fbf5f 100644 --- a/tutorials/javaInstallationMac.html +++ b/tutorials/javaInstallationMac.html @@ -185,7 +185,7 @@ -

    Authors:

    +

    Authors:

    diff --git a/tutorials/javaInstallationMac.page-vue-render.js b/tutorials/javaInstallationMac.page-vue-render.js index e5e893af..69529132 100644 --- a/tutorials/javaInstallationMac.page-vue-render.js +++ b/tutorials/javaInstallationMac.page-vue-render.js @@ -71,6 +71,6 @@ with(this){return _c('p',[_c('strong',[_v("Authors:")])])} with(this){return _c('ul',[_c('li',[_v("Initial Version: Jay Hong ("),_c('a',{attrs:{"href":"https://github.com/hjungwoo01"}},[_v("@hjungwoo01")]),_v(")")])])} },function anonymous( ) { -with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Tue, 24 Sept 2024, 23:18:52 GMT+8]")])])])} +with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Thu, 26 Sept 2024, 17:41:12 GMT+8]")])])])} }]; \ No newline at end of file diff --git a/tutorials/javaInstallationWindows.html b/tutorials/javaInstallationWindows.html index 4e9cd2de..842f974b 100644 --- a/tutorials/javaInstallationWindows.html +++ b/tutorials/javaInstallationWindows.html @@ -71,7 +71,7 @@ -

    Authors:

    +

    Authors:

    diff --git a/tutorials/javaInstallationWindows.page-vue-render.js b/tutorials/javaInstallationWindows.page-vue-render.js index ad0d3769..eacda358 100644 --- a/tutorials/javaInstallationWindows.page-vue-render.js +++ b/tutorials/javaInstallationWindows.page-vue-render.js @@ -59,6 +59,6 @@ with(this){return _c('p',[_c('strong',[_v("Authors:")])])} with(this){return _c('ul',[_c('li',[_v("Initial Version: Ryan Chiang ("),_c('a',{attrs:{"href":"https://github.com/macareonie"}},[_v("@macareonie")]),_v(")")])])} },function anonymous( ) { -with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Tue, 24 Sept 2024, 23:18:52 GMT+8]")])])])} +with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Thu, 26 Sept 2024, 17:41:12 GMT+8]")])])])} }]; \ No newline at end of file diff --git a/tutorials/jekyll.html b/tutorials/jekyll.html index 129b920d..c830a05a 100644 --- a/tutorials/jekyll.html +++ b/tutorials/jekyll.html @@ -17,7 +17,7 @@

    Guides for SE student projects »

    Using Jekyll for project documentation

    Jekyll is a popular tool for generating static websites from markdown-like text.

    Given below are some information useful for when you want to update documentation in a project that uses Jekyll.

    Setting up GitHub Pages for Jekyll

    As GitHub has native support for Jekyll, it can convert your documentation into HTML and deploy it on the github.io URL of your project.

    Do the following to set up the GitHub Pages website of your project:

    1. Go to your repo's settings tab.
    2. Click   Pages  on the menu on the left edge of page.
    3. Set the Source as:  Deploy from a branch branch master branch and /docs folder (assuming project documentation is in that folder) and click  Save .

    The project website will be available at https://{your_org}.github.io/{your_repo} the next time the master branch is updated. Example: https://myorg.github.io/myrepo

    Updating documents

    Jekyll uses kramdown (a superset of Markdown) for writing content. You can use Intellij (or any other text editor) to update the relevant .md files.

    Recommendation: Limit your content to Markdown and GFMD syntax only i.e., avoid kramdown-specific syntax that are not compatible with Markdown/GFMD

    Recommendation: Enable soft-wrapping in your code editor for *.md files. For example, as explained in Intellij IDEA: Useful settings guide.

    • Previewing changes locally: There are several ways to preview changes locally.
      • Option 1 -- Intellij preview: Intellij supports previewing Markdown files, as explained here. While the preview shown by Intellij is somewhat rudimentary, it is good enough for most cases.
      • Option 2 -- Run Jekyll locally: You can set up Jekyll locally and run it to see the exact way the update affects the final outcome.
    • Previewing changes on GitHub:
      • Option 1 -- GitHub preview: You can see a basic preview of the page by navigating to the corresponding .md source file in GitHub.
      • Option 2 -- Use Netlify PR preview: You can set up Netlify to show previews of PRs (to learn how, read the Using Netlify guide). This method shows a preview of the exact way the update affects the final outcome.

    Site-wide settings

    • Typically, the _config.yml file specifies project-specific site-wide settings.
      -An example is the title property, which defines the title of your site, usually the name of your project.

    • The files in docs/_include and docs/_layouts control the template of the pages; the files in docs/_sass control the style of the pages.

      Caution: Modifying these files requires some knowledge and experience with Jekyll. You should only modify them (at your own risk) if you need greater control over the site’s layout.

    +An example is the title property, which defines the title of your site, usually the name of your project.

  • The files in docs/_include and docs/_layouts control the template of the pages; the files in docs/_sass control the style of the pages.

    Caution: Modifying these files requires some knowledge and experience with Jekyll. You should only modify them (at your own risk) if you need greater control over the site’s layout.

  • diff --git a/tutorials/jekyll.page-vue-render.js b/tutorials/jekyll.page-vue-render.js index 4c3fda24..477c926d 100644 --- a/tutorials/jekyll.page-vue-render.js +++ b/tutorials/jekyll.page-vue-render.js @@ -47,6 +47,6 @@ with(this){return _c('li',[_c('p',[_v("Typically, the "),_c('code',{pre:true,att with(this){return _c('p',[_v("The files in "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("docs/_include")]),_v(" and "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("docs/_layouts")]),_v(" control the template of the pages; the files in "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("docs/_sass")]),_v(" control the style of the pages.")])} },function anonymous( ) { -with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Tue, 24 Sept 2024, 23:18:52 GMT+8]")])])])} +with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Thu, 26 Sept 2024, 17:41:12 GMT+8]")])])])} }]; \ No newline at end of file diff --git a/tutorials/junit.html b/tutorials/junit.html index de7a189c..1b22f565 100644 --- a/tutorials/junit.html +++ b/tutorials/junit.html @@ -110,7 +110,7 @@ -

    3. Run tests, either using the Intellij UI (preferred -- this makes debugging failed test cases easier) or using Gradle itself, as explained in the section below.

    Running tests

    In Intellij IDEA:

    • To run a specific JUnit test class (e.g., src/test/java/seedu/DukeTest.java), right-click on the test class, and choose Run {classname}.

    If the above doesn't work, you may want to go to File > Settings and change theRun tests using: setting to Intellij IDEA (instead of Gradle), as shown below:

    Expand to see screenshot ...

    change Intellij settings to not use Gradle


    • To run all tests in a folder (e.g., src/test/java folder), right-click on the folder, and choose Run Tests in '...'.
    • Other supported IDEs (e.g., Eclipse, NetBeans, VS Code, etc.) have similar mechanisms.

    Using Gradle::

    • To run all tests in the project, run the Gradle task test (more info on running Gradle tasks)
    • [If using Intellij UI to run the test task] The location of the test task in the Gradle task hierarchy is Tasks -> verification -> test (see screenshot below).

    Other ways:

    Writing useful JUnit tests

    After you are able to run JUnit tests successfully using a dummy test class such as the above, you can add more tests and test classes as necessary.

    To learn how to write useful JUnit test cases, refer this section of our SE book. For a quick overview of more advance JUnit features, refer this section.

    Resources

    +

    3. Run tests, either using the Intellij UI (preferred -- this makes debugging failed test cases easier) or using Gradle itself, as explained in the section below.

    Running tests

    In Intellij IDEA:

    • To run a specific JUnit test class (e.g., src/test/java/seedu/DukeTest.java), right-click on the test class, and choose Run {classname}.

    If the above doesn't work, you may want to go to File > Settings and change theRun tests using: setting to Intellij IDEA (instead of Gradle), as shown below:

    Expand to see screenshot ...

    change Intellij settings to not use Gradle


    • To run all tests in a folder (e.g., src/test/java folder), right-click on the folder, and choose Run Tests in '...'.
    • Other supported IDEs (e.g., Eclipse, NetBeans, VS Code, etc.) have similar mechanisms.

    Using Gradle::

    • To run all tests in the project, run the Gradle task test (more info on running Gradle tasks)
    • [If using Intellij UI to run the test task] The location of the test task in the Gradle task hierarchy is Tasks -> verification -> test (see screenshot below).

    Other ways:

    Writing useful JUnit tests

    After you are able to run JUnit tests successfully using a dummy test class such as the above, you can add more tests and test classes as necessary.

    To learn how to write useful JUnit test cases, refer this section of our SE book. For a quick overview of more advance JUnit features, refer this section.

    Resources

    diff --git a/tutorials/junit.page-vue-render.js b/tutorials/junit.page-vue-render.js index 71c5215b..725cea75 100644 --- a/tutorials/junit.page-vue-render.js +++ b/tutorials/junit.page-vue-render.js @@ -95,6 +95,6 @@ with(this){return _c('h2',{attrs:{"id":"resources"}},[_v("Resources"),_c('a',{st with(this){return _c('ul',[_c('li',[_c('a',{attrs:{"href":"https://junit.org/junit5/docs/current/user-guide/"}},[_v("JUnit 5 User Guide")])]),_v(" "),_c('li',[_c('a',{attrs:{"href":"https://docs.gradle.org/current/userguide/java_testing.html#using_junit5"}},[_v("Gradle documentation for JUnit")])])])} },function anonymous( ) { -with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Tue, 24 Sept 2024, 23:18:52 GMT+8]")])])])} +with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Thu, 26 Sept 2024, 17:41:12 GMT+8]")])])])} }]; \ No newline at end of file diff --git a/tutorials/markbind-forked-sites.html b/tutorials/markbind-forked-sites.html index 7fceea4c..84e42517 100644 --- a/tutorials/markbind-forked-sites.html +++ b/tutorials/markbind-forked-sites.html @@ -42,7 +42,7 @@

    Updating documents

    MarkBind is a superset of Markdown. Refer the MarkBind UG: Authoring Contents for more details on the syntax. Given below is the recommended workflow for any non-trivial changes to this docs site.

    1. Install MarkBind (as described in the section above), if you haven't done so already.
    2. Open a terminal and navigate to the [project root]/docs folder.
    3. Run the npm run serve command. That will open the generated website in your default browser in a live preview mode.
    4. In the browser, navigate to the page you want to preview.
    5. Edit the source files (usually, *.md files). When you save the file, the live preview will update to reflect the new contents (after a few seconds).

    While live preview can pick up most changes, it may not be able to pick up certain changes (e.g., changes to files in the _markbind folder or changes to nunjucks macros). Furthermore, some syntax errors in your code can cause the live preview to crash. In those cases, just stop the server (e.g., Ctrl+C on Windows) and start it again.

    Recommendation: Enable soft-wrapping in your code editor for *.md files. For example, as explained in Intellij IDEA: Useful settings guide.

    Generating a Table of Content for a page: As MarkBind pages automatically generate a page navigation menu (which appears on the top right edge of the page), there is no need to manually insert a ToC into a page.
    -Furthermore, when saving the page as a PDF, you can make the page navigation menu appear as a ToC in the generated PDF, by inserting <page-nav-print /> in the page where you want the ToC to appear.

    Working with UML diagrams

    MarkBind has built-in support for PlantUML diagrams. See the this page of the MarkBind User Guide to find how to use PlantUML with MarkBind.

    Also see se-edu/guides Using PlantUML for useful info on using PlantUML in a project such as AB3.

    +Furthermore, when saving the page as a PDF, you can make the page navigation menu appear as a ToC in the generated PDF, by inserting <page-nav-print /> in the page where you want the ToC to appear.

    Working with UML diagrams

    MarkBind has built-in support for PlantUML diagrams. See the this page of the MarkBind User Guide to find how to use PlantUML with MarkBind.

    Also see se-edu/guides Using PlantUML for useful info on using PlantUML in a project such as AB3.

    diff --git a/tutorials/markbind-forked-sites.page-vue-render.js b/tutorials/markbind-forked-sites.page-vue-render.js index 4425f38d..bbc75629 100644 --- a/tutorials/markbind-forked-sites.page-vue-render.js +++ b/tutorials/markbind-forked-sites.page-vue-render.js @@ -86,6 +86,6 @@ with(this){return _c('p',[_c('strong',[_v("MarkBind has built-in support for Pla with(this){return _c('p',[_v("Also see "),_c('a',{attrs:{"href":"https://se-education.org/guides/tutorials/plantUml.html"}},[_c('em',[_v("se-edu/guides "),_c('strong',[_v("Using PlantUML")])])]),_v(" for useful info on using PlantUML in a project such as AB3.")])} },function anonymous( ) { -with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Tue, 24 Sept 2024, 23:18:52 GMT+8]")])])])} +with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Thu, 26 Sept 2024, 17:41:12 GMT+8]")])])])} }]; \ No newline at end of file diff --git a/tutorials/markbind.html b/tutorials/markbind.html index f804894b..0cbbbd49 100644 --- a/tutorials/markbind.html +++ b/tutorials/markbind.html @@ -14,7 +14,7 @@

    Guides for SE student projects »

    Using MarkBind for project documentation

    If you are working with a forked repo that is using MarkBind already, refer to this guide instead.

    MarkBind is a tool for generating static websites from markdown-like text, particularly suitable for text-heavy websites such as software project documentation.

    Given below are some information useful for when you want to update documentation in a project that uses MarkBind.

    Installation

    Updating documents

    MarkBind is a superset of Markdown. Refer the MarkBind user guide for more details.

    First, start the live preview: Unless it is a trivial change, you would want to see how your change to the documentation source files will reflect in the generated website. You can use the MarkBind live preview mode to preview the generated website as you update the source file. To start the live preview mode,

    1. Open a command prompt.
    2. Navigate to the the documentation root (in most projects, the documentation root is [project root]/docs -- if you are not sure, look for the folder containing the site.json file).
    3. Run the markbind serve command. That will open the generated website in your default browser.
    4. In the browser, navigate to the page you want to modify.

    Next, edit the files you want:

    1. Edit the source files (usually, .md files).
    2. When you save the file, the live preview will update to reflect the new contents (after a few seconds).

    While live preview can pick up most changes, it may not be able to pick up certain changes (e.g., changes to files in the _markbind folder or changes to nunjucks macros). Furthermore, some syntax errors in your code can cause the live preview to crash. In those cases, just stop the server (Ctrl+C on Windows) and start it again.

    Automating PR previews, deployments

    Project admins can,

    • set up Netlify to give a preview of how a PR can affect the generated website. More info here.
    • set up Travis to automatically generate and deploy the project website when new code is pushed. More info here

    +

    Guides for SE student projects »

    Using MarkBind for project documentation

    If you are working with a forked repo that is using MarkBind already, refer to this guide instead.

    MarkBind is a tool for generating static websites from markdown-like text, particularly suitable for text-heavy websites such as software project documentation.

    Given below are some information useful for when you want to update documentation in a project that uses MarkBind.

    Installation

    Updating documents

    MarkBind is a superset of Markdown. Refer the MarkBind user guide for more details.

    First, start the live preview: Unless it is a trivial change, you would want to see how your change to the documentation source files will reflect in the generated website. You can use the MarkBind live preview mode to preview the generated website as you update the source file. To start the live preview mode,

    1. Open a command prompt.
    2. Navigate to the the documentation root (in most projects, the documentation root is [project root]/docs -- if you are not sure, look for the folder containing the site.json file).
    3. Run the markbind serve command. That will open the generated website in your default browser.
    4. In the browser, navigate to the page you want to modify.

    Next, edit the files you want:

    1. Edit the source files (usually, .md files).
    2. When you save the file, the live preview will update to reflect the new contents (after a few seconds).

    While live preview can pick up most changes, it may not be able to pick up certain changes (e.g., changes to files in the _markbind folder or changes to nunjucks macros). Furthermore, some syntax errors in your code can cause the live preview to crash. In those cases, just stop the server (Ctrl+C on Windows) and start it again.

    Automating PR previews, deployments

    Project admins can,

    • set up Netlify to give a preview of how a PR can affect the generated website. More info here.
    • set up Travis to automatically generate and deploy the project website when new code is pushed. More info here

    diff --git a/tutorials/markbind.page-vue-render.js b/tutorials/markbind.page-vue-render.js index de61c582..573c31ab 100644 --- a/tutorials/markbind.page-vue-render.js +++ b/tutorials/markbind.page-vue-render.js @@ -41,6 +41,6 @@ with(this){return _c('h2',{attrs:{"id":"automating-pr-previews-deployments"}},[_ with(this){return _c('ul',[_c('li',[_v("set up Netlify to give a preview of how a PR can affect the generated website. More info "),_c('a',{attrs:{"href":"https://markbind.org/userGuide/deployingTheSite.html#deploying-to-netlify"}},[_v("here")]),_v(".")]),_v(" "),_c('li',[_v("set up Travis to automatically generate and deploy the project website when new code is pushed. More info "),_c('a',{attrs:{"href":"https://markbind.org/userGuide/deployingTheSite.html#deploying-to-github-pages"}},[_v("here")])])])} },function anonymous( ) { -with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Tue, 24 Sept 2024, 23:18:52 GMT+8]")])])])} +with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Thu, 26 Sept 2024, 17:41:12 GMT+8]")])])])} }]; \ No newline at end of file diff --git a/tutorials/netlify.html b/tutorials/netlify.html index 0bd36366..4befde31 100644 --- a/tutorials/netlify.html +++ b/tutorials/netlify.html @@ -16,7 +16,7 @@ Search this site

    Guides for SE student projects »

    Using Netlify

    Netlify is an automated hosting platform for deploying websites. Its deploy previews feature is particularly useful for .

    The sections below explains how to use Netlify in a project.

    Caution: Netlify allows only 300 free build minutes per month. They use an unsavory practice of letting you exceed the limit silently and then sending you an invoice for the extra use. You will not be able to use Netlify again unless you pay (or get them to cancel the charge). Therefore, we caution you to use Netlify (if at all) during times you update documentation and only if you want to use Netlify Deploy Previews to help review such PRs.

    Setting up

    1. Go to https://www.netlify.com/ and click Sign Up. Next, click GITHUB SIGN IN, enter your GitHub account details and authorize netlify.

    2. After logging in, click New site from Git.

    3. You will then be brought to the setup page. Click GitHub to link your repository to Netlify.

      • Depending on whether you are the owner of the repository, you can either grant or request access to Netlify so that it can access your repository and build your documentation.
        Grant or request access
      • After granting or requesting access to your repository, click Authorize netlify.
    4. Pick your repository from the list.

    5. Fill out the details as follows and then click Deploy site.

      • Branch to deploy: select master branch
      • If using Jekyll for project documentation:
        • Build command: cd docs && bundle install && bundle exec jekyll build
        • Publish directory: docs/_site
      • If using MarkBind for project documentation: -
        • Build Command: cd docs && npm i markbind-cli -g && markbind build --baseUrl
        • Publish directory: docs/_site

      For both Jekyll and MarkBind, omit the cd docs && and docs/ from the build command and the publish directory respectively if the documentation is in the root (i.e., not inside the docs folder).

    6. Once Netlify has completed building your project, you can now:

      • View your main branch’s deployed documentation on the site name given by Netlify (customizable as shown below).
        Temporary site name
      • Preview the updated documentation whenever a pull request is made by clicking the Details hyperlink next to the Netlify test status.
        Netlify details link

    Changing the site name

    If you don’t like the site name given by Netlify, you can change it as follows:

    1. Click on Settings.

    2. Then click Change site name and fill in your desired site name.
      Change site name

    +
    • Build Command: cd docs && npm i markbind-cli -g && markbind build --baseUrl
    • Publish directory: docs/_site

    For both Jekyll and MarkBind, omit the cd docs && and docs/ from the build command and the publish directory respectively if the documentation is in the root (i.e., not inside the docs folder).

  • Once Netlify has completed building your project, you can now:

    • View your main branch’s deployed documentation on the site name given by Netlify (customizable as shown below).
      Temporary site name
    • Preview the updated documentation whenever a pull request is made by clicking the Details hyperlink next to the Netlify test status.
      Netlify details link
  • Changing the site name

    If you don’t like the site name given by Netlify, you can change it as follows:

    1. Click on Settings.

    2. Then click Change site name and fill in your desired site name.
      Change site name

    diff --git a/tutorials/netlify.page-vue-render.js b/tutorials/netlify.page-vue-render.js index 223077e4..731aac96 100644 --- a/tutorials/netlify.page-vue-render.js +++ b/tutorials/netlify.page-vue-render.js @@ -47,6 +47,6 @@ with(this){return _c('h2',{attrs:{"id":"changing-the-site-name"}},[_v("Changing with(this){return _c('ol',[_c('li',[_c('p',[_v("Click on "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Settings")]),_v(".")])]),_v(" "),_c('li',[_c('p',[_v("Then click "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Change site name")]),_v(" and fill in your desired site name."),_c('br'),_v(" "),_c('a',{attrs:{"href":"/guides/tutorials/images/netlify/change_site_name.png","target":"_self"}},[_c('img',{staticClass:"img-fluid",attrs:{"src":"/guides/tutorials/images/netlify/change_site_name.png","alt":"Change site name"}})])])])])} },function anonymous( ) { -with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Tue, 24 Sept 2024, 23:18:52 GMT+8]")])])])} +with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Thu, 26 Sept 2024, 17:41:12 GMT+8]")])])])} }]; \ No newline at end of file diff --git a/tutorials/plantUml.html b/tutorials/plantUml.html index 0243ce8b..b50f3080 100644 --- a/tutorials/plantUml.html +++ b/tutorials/plantUml.html @@ -311,7 +311,7 @@

    Authors:

    • Initial Version: Jeffry Lum
    • Contributors: -
      • MUHAMMAD FIKRI BIN ABDUL KALAM (@mfjkri): added the part on SD reference frames

    +
    • MUHAMMAD FIKRI BIN ABDUL KALAM (@mfjkri): added the part on SD reference frames

    diff --git a/tutorials/plantUml.page-vue-render.js b/tutorials/plantUml.page-vue-render.js index 703ecae6..b06d1be4 100644 --- a/tutorials/plantUml.page-vue-render.js +++ b/tutorials/plantUml.page-vue-render.js @@ -134,6 +134,6 @@ with(this){return _c('p',[_c('strong',[_v("Authors:")])])} with(this){return _c('ul',[_c('li',[_v("Initial Version: Jeffry Lum")]),_v(" "),_c('li',[_v("Contributors:\n"),_c('ul',[_c('li',[_v("MUHAMMAD FIKRI BIN ABDUL KALAM (@mfjkri): added the part on SD reference frames")])])])])} },function anonymous( ) { -with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Tue, 24 Sept 2024, 23:18:52 GMT+8]")])])])} +with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Thu, 26 Sept 2024, 17:41:12 GMT+8]")])])])} }]; \ No newline at end of file diff --git a/tutorials/savingPdf.html b/tutorials/savingPdf.html index 3872ede6..fdf1b337 100644 --- a/tutorials/savingPdf.html +++ b/tutorials/savingPdf.html @@ -31,7 +31,7 @@ -

    +

    diff --git a/tutorials/savingPdf.page-vue-render.js b/tutorials/savingPdf.page-vue-render.js index a62bd64b..52d04bc4 100644 --- a/tutorials/savingPdf.page-vue-render.js +++ b/tutorials/savingPdf.page-vue-render.js @@ -17,6 +17,6 @@ with(this){return _c('p',[_c('strong',[_v("Use Chrome ("),_c('mark',[_c('span',{ with(this){return _c('ol',[_c('li',[_c('p',[_v("Go to your generated documentation site on GitHub using Chrome.")])]),_v(" "),_c('li',[_c('p',[_v("Within Chrome, click on the "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Print")]),_v(" option in Chrome’s menu.")])]),_v(" "),_c('li',[_c('p',[_v("Set the destination to "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Save as PDF")]),_v(", then click "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("Save")]),_v(" to save a copy of the file in PDF format."),_c('br'),_v(" "),_c('mark',[_v("For best results, use the settings indicated in the screenshot below.")])]),_v(" "),_c('p',[_c('a',{attrs:{"href":"/guides/tutorials/images/chrome_save_as_pdf.png","target":"_self"}},[_c('img',{staticClass:"img-fluid",attrs:{"src":"/guides/tutorials/images/chrome_save_as_pdf.png","alt":"Saving documentation as PDF files in Chrome"}})])])])])} },function anonymous( ) { -with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Tue, 24 Sept 2024, 23:18:52 GMT+8]")])])])} +with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Thu, 26 Sept 2024, 17:41:12 GMT+8]")])])])} }]; \ No newline at end of file diff --git a/tutorials/sourcetree.html b/tutorials/sourcetree.html index 90404bfe..af0fb79c 100644 --- a/tutorials/sourcetree.html +++ b/tutorials/sourcetree.html @@ -21,7 +21,7 @@ If a Browser Window pops up and asks you to log in to GitHub and to authorize Sourcetree accessing your GitHub account, do so.
  • Now, your Sourcetree should be able to push code to a GitHub repo that you have write permission to.
  • Option 3:

    1. Open the Windows Credential Manager.
    2. For each credential related to GitHub (if the name mentions GitHub) in Web Credentials or Windows Credentials categories,
      (a) edit it and replace the password field with a GitHub PAT.
      (b) If the above didn't work, delete those credential altogether and try Option 1 or 2 again.

    On a Mac

    Given below are two options for connecting Sourcetree with your GitHub account. Both requires creating a Personal Access Token (PAT) at some point. When you do crete a PAT, we recommend that you tick both repo and workflow checkboxes.

    • Option 1: Try the stepts given in this YouTube guide from Nick Graham:

    Caching GitHub credentials

    If you are prompted to enter GitHub credentials everytime you connect to GitHub using Sourcetree, you can cache GitHub credentials by following the guide given here (recommended: use the Git Credentials Manager option, not the GitHub CLI option).

    +It gives two methods. Recommended to try method 2 first.

    Caching GitHub credentials

    If you are prompted to enter GitHub credentials everytime you connect to GitHub using Sourcetree, you can cache GitHub credentials by following the guide given here (recommended: use the Git Credentials Manager option, not the GitHub CLI option).

    diff --git a/tutorials/sourcetree.page-vue-render.js b/tutorials/sourcetree.page-vue-render.js index 46367a65..0d124d76 100644 --- a/tutorials/sourcetree.page-vue-render.js +++ b/tutorials/sourcetree.page-vue-render.js @@ -65,6 +65,6 @@ with(this){return _c('ul',[_c('li',[_c('p',[_c('strong',[_v("Option 1:")]),_v(" with(this){return _c('ul',[_c('li',[_c('strong',[_v("Option 2:")]),_v(" If the above doesn't work, try this guide (from Medium): "),_c('a',{attrs:{"href":"https://medium.com/geekculture/using-personal-access-token-in-sourcetree-to-connect-to-github-3702a29554d3"}},[_v("Using Sourcetree to connect to GitHub without password")]),_v("."),_c('br'),_v("\nIt gives two methods. Recommended to try method 2 first.")])])} },function anonymous( ) { -with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Tue, 24 Sept 2024, 23:18:52 GMT+8]")])])])} +with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Thu, 26 Sept 2024, 17:41:12 GMT+8]")])])])} }]; \ No newline at end of file diff --git a/tutorials/textUiTesting.html b/tutorials/textUiTesting.html index c4c098fc..8c0fc3f5 100644 --- a/tutorials/textUiTesting.html +++ b/tutorials/textUiTesting.html @@ -102,7 +102,7 @@

  • Update the javac and java commands in the script to match the name/location of your main class.
    -If you are using packages, the two commands need to take the packages into account too.

  • Add an input.txt containing the input commands.

  • Add an EXPECTED.txt to the same folder, containing the expected output.

  • Run the .bat/.sh file to execute the test.

    • If the actual output matches the EXPECTED.TXT, the test passes.
    • If the actual output differs from the EXPECTED.TXT, the script will report a failure.
  • Updating tests as the program evolves

    The purpose of testing as explained in the previous section is to confirm there are no . However, we often update the behavior of the program intentionally e.g., enhance an existing feature. Let's look at how to update our test set up in those cases.

    Option 1: This is the ideal but more tedious approach.

    1. Determine how the expected behavior should change due to your update to the code.
    2. Update the EXPECTED.TXT file accordingly.
    3. Run the test to confirm the actual behavior is same as the updated expected behavior.

    Option 2: This is a more practical shortcut.

    1. Run the test as per normal after updating the code. The test will fail because the new program behavior is different from the one given in the EXPECTED.TXT.
    2. Use a diff tool to compare the ACTUAL.TXT against the EXPECTED.TXT.
      Intellij IDEA can compare two files. There are stand-alone tools for comparing files too e.g., WinDiff, WinMerge
    3. Confirm the differences indicate the behavior has changed as you intended. If the differences are not as intended, your code is buggy; fix the code and repeat from step 1.
    4. Copy over the content of the ACTUAL.TXT to EXPECTED.TXT i.e., we accept that the current actual behavior should be the new expected behavior. Rerun the test to confirm that it passes this time.

    Troubleshooting

    • Problem: The ACTUAL.TXT and EXPECTED.TXT looks exactly the same but the test fails.
      Explanation: The likely cause that the line endings are different (not visible to the naked eye) because the two files were created in two different operating systems.
      Solution: You can use the dos2unix utility (available in git-bash and *nix operating systems) to convert a file to Unix format.

    Authors:

    • Initial Version: based on se-edu/addressbook-level2, adapted by Jeffry Lum

    +If you are using packages, the two commands need to take the packages into account too.

  • Add an input.txt containing the input commands.

  • Add an EXPECTED.txt to the same folder, containing the expected output.

  • Run the .bat/.sh file to execute the test.

    • If the actual output matches the EXPECTED.TXT, the test passes.
    • If the actual output differs from the EXPECTED.TXT, the script will report a failure.
  • Updating tests as the program evolves

    The purpose of testing as explained in the previous section is to confirm there are no . However, we often update the behavior of the program intentionally e.g., enhance an existing feature. Let's look at how to update our test set up in those cases.

    Option 1: This is the ideal but more tedious approach.

    1. Determine how the expected behavior should change due to your update to the code.
    2. Update the EXPECTED.TXT file accordingly.
    3. Run the test to confirm the actual behavior is same as the updated expected behavior.

    Option 2: This is a more practical shortcut.

    1. Run the test as per normal after updating the code. The test will fail because the new program behavior is different from the one given in the EXPECTED.TXT.
    2. Use a diff tool to compare the ACTUAL.TXT against the EXPECTED.TXT.
      Intellij IDEA can compare two files. There are stand-alone tools for comparing files too e.g., WinDiff, WinMerge
    3. Confirm the differences indicate the behavior has changed as you intended. If the differences are not as intended, your code is buggy; fix the code and repeat from step 1.
    4. Copy over the content of the ACTUAL.TXT to EXPECTED.TXT i.e., we accept that the current actual behavior should be the new expected behavior. Rerun the test to confirm that it passes this time.

    Troubleshooting

    • Problem: The ACTUAL.TXT and EXPECTED.TXT looks exactly the same but the test fails.
      Explanation: The likely cause that the line endings are different (not visible to the naked eye) because the two files were created in two different operating systems.
      Solution: You can use the dos2unix utility (available in git-bash and *nix operating systems) to convert a file to Unix format.

    Authors:

    • Initial Version: based on se-edu/addressbook-level2, adapted by Jeffry Lum

    diff --git a/tutorials/textUiTesting.page-vue-render.js b/tutorials/textUiTesting.page-vue-render.js index e3bb889d..b2dee389 100644 --- a/tutorials/textUiTesting.page-vue-render.js +++ b/tutorials/textUiTesting.page-vue-render.js @@ -62,6 +62,6 @@ with(this){return _c('p',[_c('strong',[_v("Authors:")])])} with(this){return _c('ul',[_c('li',[_v("Initial Version: based on se-edu/addressbook-level2, adapted by Jeffry Lum")])])} },function anonymous( ) { -with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Tue, 24 Sept 2024, 23:18:52 GMT+8]")])])])} +with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Thu, 26 Sept 2024, 17:41:12 GMT+8]")])])])} }]; \ No newline at end of file diff --git a/tutorials/vscode.html b/tutorials/vscode.html index 2ee593bb..d4df2854 100644 --- a/tutorials/vscode.html +++ b/tutorials/vscode.html @@ -14,7 +14,7 @@

    Guides for SE student projects »

    VS Code - Community Resources

    This page contains 'community resources' contributed by students.

    Coming soon ...

    +

    Guides for SE student projects »

    VS Code - Community Resources

    This page contains 'community resources' contributed by students.

    Coming soon ...

    diff --git a/tutorials/vscode.page-vue-render.js b/tutorials/vscode.page-vue-render.js index 12a9b07d..964e3f7d 100644 --- a/tutorials/vscode.page-vue-render.js +++ b/tutorials/vscode.page-vue-render.js @@ -11,6 +11,6 @@ with(this){return _c('h1',{attrs:{"id":"guides-for-se-student-projects"}},[_c('s with(this){return _c('h1',{attrs:{"id":"vs-code-community-resources"}},[_v("VS Code - Community Resources"),_c('a',{staticClass:"fa fa-anchor",attrs:{"href":"#vs-code-community-resources","onclick":"event.stopPropagation()"}})])} },function anonymous( ) { -with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Tue, 24 Sept 2024, 23:18:52 GMT+8]")])])])} +with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("[Powered by "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.5.3")]),_v(" on Thu, 26 Sept 2024, 17:41:12 GMT+8]")])])])} }]; \ No newline at end of file