Tutorial to help understand the basics of Gradle. Compile, pack, and execute a simple program using Gradle as the buildscript.
Generates a jar file that can be executed. The expected output is an array
of each string provided. Configures the sourceSets
and jar
tasks provided
by the java plugin.
Supports the StringUtils library now being used in the program. Defines where the dependecy can be found, and which version to use. Unpacks the dependency to be available to the jar.
Creates three custom tasks.
- hello - simply print messages. Used to demonstrate the phases of a task.
- runJar - executes the jar file. Used to demonstrate task dependencies.
- run - executes the compiled classes. Used as an alternative to the above.
This tutorial was heavily based on another tutorial that can be found here. I highly suggest watching the three part series.
The original intent of this project was in conjuction with a presentation that can be found here.