This chapter explains how to compile and execute a Groovy project using build.gradle file.
The Groovy plug-in for Gradle extends the Java plug-in and provides tasks for Groovy programs. You can use the following line for applying groovy plugin.
apply plugin: 'groovy'
The complete build script file is as follows. Copy the following code into build.gradle file.
apply plugin: 'groovy' repositories { mavenCentral() } dependencies { compile 'org.codehaus.groovy:groovy-all:2.4.5' testCompile 'junit:junit:4.12' }
You can use the following command to execute the build script.
gradle build
The Groovy plugin assumes a certain setup of your Groovy project.
Check the respective directory where build.gradle file places for build folder.