COMP - Project 1

For this project, you need to install Gradle

Checkpoint checklist

The project checklist can be found here

Project setup

Copy your .jjt file to the javacc folder. If you change any of the classes generated by jjtree or javacc, you also need to copy them to the javacc folder.

Copy your source files to the src folder, and your JUnit test files to the test folder.

Compile

To compile the program, run gradle build. This will compile your classes to classes/main/java and copy the JAR file to the root directory. The JAR file will have the same name as the repository folder.

Run

To run you have two options: Run the .class files or run the JAR.

Debug mode

flag -d or --debug

Treat non-initialized variables as a warning

flag -Winit or --InitializedWarning

Run .class

To run the .class files, do the following:

java -cp "./build/classes/java/main/" <class_name> <arguments>

Where <class_name> is the name of the class you want to run and <arguments> are the arguments to be passed to main().

Run .jar

To run the JAR, do the following command:

java -jar <jar filename> <arguments>

Where <jar filename> is the name of the JAR file that has been copied to the root folder, and <arguments> are the arguments to be passed to main().

Test

To test the program, run gradle test. This will execute the build, and run the JUnit tests in the test folder. If you want to see output printed during the tests, use the flag -i (i.e., gradle test -i).