This guide will walk you through the process of setting up your homework repository and importing it into Eclipse.

<aside> <img src="/icons/video-camera_gray.svg" alt="/icons/video-camera_gray.svg" width="40px" /> You can watch a video demonstrating this process from lab. Go to the Canvas website, click on the “Zoom” link, switch to the “Cloud Recording” tab, and look for the video from 08/23.

</aside>

TABLE OF CONTENTS


One-Time Setup

Before you begin, you need to make sure to go through the other setup guides first:

You may also want to complete the Importing Eclipse Projects from GitHub with the lecture code before trying to setup your first homework assignment.

Per-Bundle Setup

For every homework bundle, you will need to repeat these steps:

  1. Setup your GitHub repository as follows:

    1. Go to the Homework category and click on the appropriate bundle. For example, go to the Homework 1 assignment first homework bundle of the semester.

    2. Click the GitHub Classroom invitation link and follow the instructions. This process will create a private GitHub repository with the homework starter code that only you, the teacher assistants, and the instructor can access:

      Screenshot 2024-01-26 at 11.47.56 AM.png

      <aside> <img src="/icons/info-alternate_gray.svg" alt="/icons/info-alternate_gray.svg" width="40px" /> If this is your first time using GitHub Classroom, you will be prompted to select your USF username from the list. This makes sure we can associate your GitHub username with your grades in Canvas. You only need to complete this step once.

      </aside>

  2. Setup your Eclipse project. See the Importing Eclipse Projects from GitHub guide for detailed steps.

  3. Once imported, check the “Package Explorer” view for the following things:

    1. The name of the homework should show up as the root folder, followed by the name of your homework repository. If you do not see the name of the homework, there is an issue with your Eclipse setup.
    2. You should find the homework code in the src/main/java folder and the test code in the src/test/java folder.
    3. The “JRE System Library” should show JavaSE-21 next to it.

    For example, for Homework 1, your package explorer should look like:

    Screenshot 2024-01-26 at 11.58.59 AM.png

    If you are seeing something different, you might be in the wrong “perspective” in Eclipse. Go to the ”Window” menu option in the top menubar, choose “Perspective” and “Open Perspective” to select the “Java (default)” perspective (not the “Git” or “Java Browsing” perspectives):

    Screenshot 2024-01-26 at 12.13.45 PM.png

  4. Verify you can run the JUnit tests on Eclipse locally. The tests will be in the src » test » java subfolder. Choose any test file, right-click, and select “Run As” » “JUnit Test” from the menu.

    If you are prompted for a test to run, choose the top-level option and click the “OK” button. It should look similar to (but with different names as):

    Untitled

    That should open up the “JUnit” view automatically, which will look similar to this:

    Eclipse screenshot of the “JUnit” view.

    Eclipse screenshot of the “JUnit” view.

    These are the tests you will need to pass for the homework bundle. Most of the tests will fail until you begin addressing the TODO comments in the code.

  5. Commit and push changes to GitHub. In Eclipse, make a minor change and commit and push that change to GitHub.

    I recommend placing the Git Staging View somewhere on your Eclipse layout to make this process more convenient. You can access that view via the “Window” » “Show View” » “Other…” option in the menu. Open the “Git” folder to find the “Git Staging View” option to add it to your layout:

    Untitled

    Make sure to drag files from the “Unstaged” to the “Staged” box and add a commit message. Sometimes, you need to click the “Refresh” button in the upper right corner of the view to update. For example:

    Untitled.png

    Click “Commit and Push” to make a checkpoint and push that checkpoint to GitHub. If you click “Commit” you only make a local checkpoint on your system.

  6. Verify the Autograder GitHub Action ran properly.

    1. Visit your repository on GitHub. Click the “Actions” tab to view all of the runs. There should be a run with the same name as your last commit.

    2. Make sure the action finishes running then scroll down in the “Summary” view to see the “Annotations” section:

      Screenshot 2024-01-26 at 12.24.53 PM.png

      The annotations will report the which homework tests are failing, which should be all of them when you first import the homework code.