There is a walkthrough video of these steps, but it is for an older version of Java and tests. The process, however, is the same!
The project is broken into two separate GitHub repositories and Eclipse projects:
SearchEngine: This is where you will place your project code. You will have your own private version of this project. The initial template includes some configuration files and a skeleton
Driver.javaclass. The repo will be named
[username]is your GitHub username (not your USF username).
SearchEngineTest: This is where the project tests files and expected output files are located. Everyone shares the same read-only repository. It will start with the Project 1 test files first and will be updated throughout the semester with new test files for the other projects. The repo will be named
You will reuse these same repositories for all of the projects.
When we verify the functionality and review the design of your project, we will only checkout the SearchEngine repository each time. This helps avoid having to re-copy the large test files over and over again.
Create and Import Projects
Below is a quick summary of the one-time setup needed for the project:
Visit the Project Setup assignment in Canvas and click the GitHub Classroom link. This will setup a private repository named
usernameis your GitHub username. You will use this same repository the entire semester for all of the projects.
Import the repository as a Java Project in Eclipse. See the Importing Eclipse Projects from GitHub guide for steps. This will create a “SearchEngine” project in Eclipse where you will add your own code for the project.
project-testsrepository at https://github.com/usf-cs272-spring2023/project-tests as a Java Project in Eclipse. This will create a “SearchEngineTests” project in Eclipse where you will find all of the test code and data files.
These two projects must be located in the same parent directory! For example
cs272_github/project-testsshare the same parent directory
If there are compile issues, right-click the “SearchEngine” project in your “Package Explorer” view, go to the “Maven” menu, and select “Update Project…” from the submenu. Make sure “SearchEngine” is selected and click the “OK” button.
After importing into Eclipse, the “Package Explorer” view should look similar to this:
Important files or directories are highlighted in blue. (Your view may not have this highlighting.) You may also be missing the
actual folder until your project is producing output files.
Once setup, you do not need to go through these steps again.
Once you have everything imported into Eclipse, try these steps to verify everything is setup correctly:
Verify you can run the
BuildCountTests.javaset of tests in the “SearchEngineTests” project in Eclipse.
Verify you can make, commit, and push changes to
Driver.javain the “SearchEngine” project in Eclipse.
Create your first release. Click the “Releases” heading (usually on the right side) in GitHub and click the “Draft a new release” button. Enter
v1.0.0as the tag version, optionally click the “This is a pre-release” checkbox, and leave the other fields unchanged:
There is an example release in the
In practice, we use releases and semantic versioning to deploy of software to its users. In this class, we will use releases and semantic versioning to (1) determine which project (and at what stage) you are submitting, and (2) make sure you have experience working with both of these practices before graduating. These are discussed further in the Project Testing guide.
Go to the “Actions” tab and make sure the “Project Release” workflow ran for the
v1.0.0release. There is an example run in the
project-templaterepository. It should fail, since you don’t have any code yet.
If you are able to complete all of the above, you should be ready to start your project! More about releases and the workflow output can be found in the Project Testing guide.
Here is the folder structure for the project and its tests:
├── SearchEngine (project-username) │ ├── pom.xml (should not need modification) │ ├── src/main/java/edu/usfca/cs272 │ │ ├── Driver.java (modify as needed) │ │ └── (add other *.java files here) │ └── src/main/resources │ └── log4j2.xml (optional) └── SearchEngineTest (project-tests) |── pom.xml (should not need modification) ├── src/test/java/edu/usfca/cs272 │ ├── BuildCountTests.java │ └── (other test files here) ├── expected │ ├── index │ │ └── (expected index-*.json files) │ └── (other directories for future projects) ├── input │ ├── text │ │ └── (text files to use as input) │ └── (other directories for future projects) └── actual └── (output files generated by your code)
If you run a test from the SearchEngineTest project, the output files will appear in the SearchEngineTest project even though your code is in the SearchEngine project.
If you run the
main method via a Runtime Configuration in Eclipse from the SearchEngine project, then your output files will appear in the SearchEngine project.