Our Inventory Management Program for Team Software Project
We utilize the Gradle build system for our project. The benefit of using Gradle is the only prerequisite needed is Java. No other tools need to be manually installed by the user before using Gradle. Upon running Gradle for the first time, some files will need to be downloaded. This should be a one time only thing, or whenever the Gradle Wrapper version is updated.
- Clone the repo and open a Command Prompt/Terminal window in the root directory
- Run the following command
- Windows:
gradlew.bat build
- macOS/Linux:
./gradlew build
- Windows:
- Upon completion, the JAR file should be in
/build/libs
.
We utilize JUnit for our unit tests. The tests are located in the src/test/java
directory. Gradle will automatically run the tests when the build
command is
run. However, if you would like to run the tests independently of building the
program, you may do the following:
- Clone the repo and open a Command Prompt/Terminal window in the root directory
- Run the following command
- Windows:
gradlew.bat test
- macOS/Linux:
./gradlew test
- Windows:
Any failed tests will be output to the console. Otherwise, all the tests passed.
Gradle facilitates the creation of the project files for various IDEs, such as Eclipse and IntelliJ IDEA. NetBeans is also supported, however we have not had experience with it, so Google will be your friend if you want to use NetBeans.
Later versions of Eclipse come with Gradle support out of the box. If you do not see the Gradle options mentioned below, you can install the Buildship Gradle Integration plugin from the Eclipse Marketplace, or use the CLI method below.
As a note: Eclipse doesn't have support to import the project from Git, as it expects the project files to already exist. You will need to clone the repo externally first.
- Clone the repo and open Eclipse (The location of the workspace should not matter).
- Choose File -> Import...
- Under Gradle, choose Gradle Project.
- Choose the root folder of the project for the Project root directory.
- Click Finish and let Eclipse set everything up.
The project should now be setup, and you should now have support to run Gradle tasks from Eclipse itself.
If you're more versed in command-line, or your version of Eclipse doesn't have native support for Gradle, you can use Gradle to generate the project files and import the project into Eclipse.
- Clone the repo and open a Command Prompt/Terminal window in the root directory
- Run the following command
- Windows:
gradlew.bat eclipse
- macOS/Linux:
./gradlew eclipse
- Windows:
- After Gradle is done, close the window and open Eclipse (The location of the workspace should not matter)
- Choose File -> Import...
- Under General, choose Existing Projects into Workspace
- In Select root directory, browse to the root directory of the project
- With the project selected in the Projects window, click Finish.
The project should now be setup. To run Gradle tasks, you will need to use the CLI.
Most modern versions of IntelliJ should come with Gradle support out of the box. If you do not see the Gradle options mentioned below, you can use the CLI method below.
- Open IntelliJ
- From the home screen, choose Check out from Version Control -> Git
- Paste in the URL to the repo and click Clone
- After cloning, IntelliJ should automatically detect the
build.gradle
file. Choose Yes to import it. - The default settings should be sufficient, but change to your liking. Afterwards, choose OK.
After IntelliJ finishes, the project should be imported for use, and you should now have support to run Gradle tasks from IntelliJ itself.
If you're more versed in command-line, or your version of IntelliJ doesn't have native support for Gradle, you can use Gradle to generate the project files and open the project in IntelliJ.
- Clone the repo and open a Command Prompt/Terminal window in the root directory
- Run the following command
- Windows:
gradlew.bat idea
- macOS/Linux:
./gradlew idea
- Windows:
- After Gradle is done, close the window and open IntelliJ
- From the home screen, choose Open
- Navigate to the root directory of the project, and choose the
.ipr
file.
After IntelliJ finishes, the project should be imported for use. To run Gradle tasks, you will need to use the CLI.