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:

  1. What type of application you are trying to build - Example- Java
  2. Libraries your application depends on i.e. it's Dependencies
  3. 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


  1. 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


  1. Build Scripts: Contains tasks
  2. 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

  1. 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

Popular posts from this blog

Jenkins CICD in One Page

Why do we need a build tool?

Deutsche Bank Interview Questions - 2024