For this project, you need to install Gradle
The project checklist can be found here
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.
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.
To run you have two options: Run the .class
files or run the JAR.
flag -d or --debug
flag -Winit or --InitializedWarning
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()
.
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()
.
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
).