Gradle Fundamentals
Fundamentals of Gradle:
- Gradle helps compiling, Testing and Packaging your application with just one command
- How Does Gradle know how to build your application?
On a high level, You will
have to describe:
- What type of application you are trying to build - Example- Java
- Libraries your application depends on i.e. it's Dependencies
- Any other Configuration specific to application such as Special Compile or Testing options
In Gradle you provide all this information in the Build Script file i.e. the build.gradle file
- Project: Project is a container for everything that gradle knows about your application
Each Gradle Project contains a build script (build
script), gradle wrappers, .gitignore file and settings.gradle file
- Build Scripts: Contains tasks
- Tasks: The build.gradle file contains number of tasks each with a specific job to do Eg., Task 1 to Compile, Task2 to Test and Task3 to Package your java classes into jar file
- Plugins: When you apply a Plugin to the
build file, it adds tasks to the project where each task is used to
achieve a particular outcome.
Example, Adding a java plugin will add tasks to
Compile, Test and Package java code.
Comments
Post a Comment