Gradle Tutorial
Selected Reading
- Gradle - Discussion
- Gradle - Useful Resources
- Gradle - Quick Guide
- Gradle – Eclipse Integration
- Gradle – Deployment
- Gradle – Multi-Project Build
- Gradle – Testing
- Gradle – Build a Groovy Project
- Gradle – Build a JAVA Project
- Gradle – Running a Build
- Gradle – Plugins
- Gradle – Dependency Management
- Gradle – Tasks
- Gradle – Build Script
- Gradle – Installation
- Gradle – Overview
- Gradle – Home
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Gradle – Build a Groovy Project
Gradle - Build a Groovy Project
This chapter explains how to compile and execute a Groovy project using build.gradle file.
The Groovy Plug-in
The Groovy plug-in for Gradle extends the Java plug-in and provides tasks for Groovy programs. You can use the following pne for applying groovy plugin.
apply plugin: groovy
Copy the following code into build.gradle file. The complete build script file is as follows −
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
Default Project Layout
The Groovy plugin assumes a certain setup of your Groovy project.
src/main/groovy contains the Groovy source code
src/test/groovy contains the Groovy tests
src/main/java contains the Java source code
src/test/java contains the Java tests
Check the respective directory where build.gradle file places for build folder.
Advertisements