CSE 331 Software Design & Implementation Spring 2019 Section 2 Development Tools UW CSE 331 Spring 2019 1
Administrivia HW1 done! HW2 due next Tuesday. HW3 out today, deadline upcoming. Everyone should have a GitLab repo (cse331-19sp-netid) Any questions? UW CSE 331 Spring 2019 2
Preparing for homework 3 We will transition to programming assignments as of HW3 Section today will cover the necessary development tools IDE: IntelliJ Version control: Git Build system: Gradle We ll wrap up with a demo of the development workflow UW CSE 331 Spring 2019 3
Course resources We can t cover everything in an hour Read documentation: cs.uw.edu/331 à Resources tab Version Control (Git) Reference Working at Home Assignment Submission Editing, Compiling, Running, and Testing Java Programs The resources page is a treasure trove of helpful information! UW CSE 331 Spring 2019 4
Warning: You must use JDK 11+ Must use JDK version 11 or later Be sure that s what you have installed! Download links in Resources webpage An out-of-date JDK can lead to very confusing bugs No fun for either of us! UW CSE 331 Spring 2019 5
IntelliJ The officially supported editor for this course A modern IDE, commonly used in industry IDE = Integrated Development Environment Auto completion Version-control (git) integration Debugger integration and an assortment of other fun features Necessary functionality covered in course documentation Editing, Compiling, Running, and Testing Java Programs UW CSE 331 Spring 2019 6
Version control Also called source control, revision control System to track changes in a project codebase Unit of change ~ lines inserted/deleted across some files Essential for managing software projects Maintain a history of code changes Revert to an older project state Merge changes from multiple sources We ll use git and GitLab in this course, but alternatives exist Subversion, Mercurial, CVS Email, dropbox, thumbdrives (don t even think of doing this!) UW CSE 331 Spring 2019 7
Version control concepts A repository ( repo ) stores a project s official codebase Lives on a server accessible to all project developers Not modified directly Each developer clones her own working copy of the repo Makes a local copy of the codebase, on your laptop/computer You modify these files directly, with your IDE or text editor Each developer commits changes to her working copy Saves a commit to version control history Affects only the local working copy Must synchronize with remote repo to share commits each way UW CSE 331 Spring 2019 8
Essential git commands git add path/to/file Tells git which changed files you want to save Can list multiple files or git add multiple times git commit m fixed some bugs Saves add ed files in local version control history Give a brief message summarizing changes git push Sends local commits to the repository (on GitLab) git pull Synchronizes working copy to match repository UW CSE 331 Spring 2019 9
Diagram of git usage course staff student UW CSE 331 Spring 2019 10
Your GitLab repository We ll push starter code to your repo for each homework After HW3, you ll get it with a git pull Commit and push your code as you do the assignment Recommended process: edit, test, pull, commit, push Submit homework N by creating a tag hwn-final Check that you ve committed and pushed all your work! Do not attach a message with the tag Example: hw3-final for HW3 Without a tag, your homework might not be graded! UW CSE 331 Spring 2019 11
Getting started with your repo 1. Install git for your platform Install Apple Xcode with dev tools (macos) Download installer from git-scm.com (Windows) 2. Configure SSH access to your GitLab account a. Generate an RSA key pair: ssh-keygen -o t rsa -b 4096 -C GitLab b. Copy the generated public key pbcopy < ~/.ssh/id_rsa.pub cat ~/.ssh/id_rsa.pub clip (macos) (Windows) c. Paste that to your GitLab account, under Settings à SSH Keys 3. Clone your repo as a new project in IntelliJ UW CSE 331 Spring 2019 12
Best practices when using git Add/commit/push your code early and often!! You really, really don t want to deal with merge conflicts Best to pull before you commit Keep your repo up-to-date as much as possible Do not rename files and folders that we gave you That will mess up our grading process It would be a silly reason to lose points! Use this repo just for homework UW CSE 331 Spring 2019 13
Demo of development workflow UW CSE 331 Spring 2019 17