abhaga22 / CS2340

1 stars 0 forks source link

M2: Build Files (Version Control) #2

Open abhaga22 opened 7 years ago

abhaga22 commented 7 years ago

Each individual team member will create a build file using gradle that will allow you to perform key tasks to build the application. Name your file with your gtid.gradle for instance: gburdell3.gradle Store your file in the repository,

To run gradle with your file (build.gradle is the default if no file specified) use the -b option, for example: gradle -bgburdell3.gradle

First, each team member should install Gradle onto their machine. Instructions are in the gradle manual at: external link: http://www.gradle.org/

The manual and documentation on the gradle site covers most of the features of gradle. For this lab, we will only be using the most basic of Gradle features and the Java plugin.

You will need to create an executable jar for the project. To do that, you will need to create a manifest. If you are unfamiliar with manifests, then see the official tutorial at: external link: http://docs.oracle.com/javase/tutorial/deployment/jar/

The application you are building also uses packages. You will need to understand how to use packages, as all professional Java projects use them extensively. Again, if you unfamiliar with packages, see the official tutorial at: external link: http://docs.oracle.com/javase/tutorial/java/package/index.html

Your build file should support the following tasks:

compileJava - compiles and builds the project compileTest - compiles the unit tests for the project javadoc - creates the html documentation for the project clean - removes all the files created by this project jar - creates the executable jar file for this project

The jar task should be the default if no task is designated when running gradle. Otherwise, gradle will execute the task you request, for example: gradle compileJava will compile your java project.

thekellychen commented 7 years ago

Troubleshooting Some common problems: