Gradle
Gradle is a powerful, open-source build automation tool primarily used for Java, Kotlin, and Android development.
It’s designed to automate the entire software development lifecycle, handling tasks like compiling, packaging, testing, and deploying applications.
- Gradle excels at managing complex projects and offers features like build scans for performance analysis and a configuration cache for faster builds.
- Gradle’s build scripts are written in Groovy or Kotlin DSL, allowing for highly customized build logic.
Table of Contents
Installation
Gradle can be installed via various methods, including downloading binaries or using package managers like SDKMAN!
Dependency Configurations
Every dependency declared for a Gradle project applies to a specific scope.
reference from official doc here
What’s the difference between implementation, api and compile in Gradle? Reference article here
- compile is old way
- “implementation” dependency in your module, it will appear only as runtimeClasspath dependency in customer modules.
- “api” dependency in your module, it will appear as both runtimeClasspath and compileClasspath in consumer modules.
What is the new replacement keyword for deprecated keywords in new gradle?
- compile with
implementation(if you don’t need transitivity) orapi(if you need transitivity) - testCompile with
testImplementation - debugCompile with
debugImplementation - androidTestCompile with
androidTestImplementation compileOnlyis still valid.- It was added in 3.0 to replace provided and not compile.
providedintroduced when Gradle didn’t have a configuration name for that use-case and named it after Maven’s provided scope.
buildscript
How to download javadocs and sources for jar using Gradle 2.0?
Reference article here