https://github.com/autonomousapps/gradle-glossary
Glossary of Gradle terms both common and uncommon
https://github.com/autonomousapps/gradle-glossary
Last synced: 7 months ago
JSON representation
Glossary of Gradle terms both common and uncommon
- Host: GitHub
- URL: https://github.com/autonomousapps/gradle-glossary
- Owner: autonomousapps
- License: mit
- Created: 2021-11-07T03:52:46.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2024-03-04T20:54:31.000Z (almost 2 years ago)
- Last Synced: 2025-06-17T03:02:51.279Z (7 months ago)
- Homepage:
- Size: 28.3 KB
- Stars: 126
- Watchers: 7
- Forks: 5
- Open Issues: 2
-
Metadata Files:
- Readme: README.asciidoc
- Contributing: CONTRIBUTING
- License: LICENSE
Awesome Lists containing this project
README
== Glossary of Gradle terms
[[artifact]]
=== Artifact
'Artifact' is usually used in the context of publishing to designate a file whose name has a 'classifier' and 'extension'. Two artifacts in a <> cannot have the same classifier and extension.
Confusingly, when used in the context of <>, an artifactId refers to a list of the above artifacts. For an example, the `okhttp` artifactId contains jar, sources and javadocs artifacts.
[[build]]
=== Build
A 'build' is the aggregate of the atomic pieces of work performed by Gradle. A build is made up of <> and those projects have a collection of <>. A build usually has an outcome of SUCCESS or FAILURE. You can run a build using the `gradle` or `gradlew` commands.
[[build-script]]
=== Build script
A `build.gradle` script. The existence of a build script, along with an entry in the
<> (other than for the root build script, which requires no entry),
is what defines a Gradle <>.
[[configuration]]
=== Configuration
A https://docs.gradle.org/current/dsl/org.gradle.api.artifacts.Configuration.html[Configuration], at
the most basic level, is a bucket of dependencies. The most common configurations, which most people
would have seen, are `api` and `implementation`. A great place to learn more about configurations
is the documentation for the https://docs.gradle.org/current/userguide/java_library_plugin.html[java-library]
plugin.
While the usage as a bucket of dependencies is the most common for Gradle users, configurations can
also https://docs.gradle.org/current/userguide/declaring_dependencies.html#sec:resolvable-consumable-configs[be used in other ways]
by plugin authors:
- as a https://docs.gradle.org/current/javadoc/org/gradle/api/file/FileCollection.html[FileCollection]
as an input to tasks (e.g. `runtimeClasspath`).
- as an outgoing https://docs.gradle.org/current/userguide/variant_model.html#understanding-variant-selection[variant]
to be later https://docs.gradle.org/current/userguide/publishing_customization.html#sec:publishing-custom-components[published]
(e.g. `apiElements`)
The word "configuration" is one of the most overloaded in the Gradle world.
See also <>.
[[configuration-phase]]
=== Configuration phase
A Gradle build is composed of two primary phases, the configuration phase (not to be confused with
<> instances) and the <>. The configuration phase
happens first and is single-threaded.
[[convention-plugin]]
=== Convention plugin
A <> built on top of an <>, and which applies common
_conventions_ to the build script that uses the plugin.
See also https://developer.squareup.com/blog/herding-elephants/[Herding elephants: Wrangling a 3,500-module Gradle project].
[[ecosystem-plugin]]
=== Ecosystem plugin
A <> responsible for building a language, such as Java (`java` and `java-library`), Groovy,
Scala, Android, Kotlin, etc. Many plugins are maintained by <> itself, and are
part of the Gradle distribution.
[[execution-phase]]
=== Execution phase
The second primary phase of a Gradle build, the execution phase happens after the
<> is complete. This is where all <> actions are
executed. This phase has multiple levels of parallelism.
[[gradle]]
=== Gradle
https://gradle.org/[Gradle] is the open-source build system developed and maintained by https://gradle.com/[Gradle, Inc.],
a for-profit company.
[[init-script]]
=== Init script
An init, or https://docs.gradle.org/current/userguide/init_scripts.html[initialization script], is
backed by an instance of the https://docs.gradle.org/current/javadoc/org/gradle/api/invocation/Gradle.html[`Gradle` type].
See also <>.
[[maven-build-tool]]
=== Maven (build tool)
https://maven.apache.org/[Maven] is a build tool like Gradle but using a more declarative syntax based on XML.
For publishing dependencies, Maven uses the <>.
[[maven-publication-format]]
=== Maven (publication format)
The Maven publication format is the format used by most of the JVM ecosystem to publish and consume binary dependencies.
Each dependency is identified by a `"$group:$artifact:$version` string called "Maven coordinates". These dependencies
can then be consumed by accessing files (by HTTP or on the local filesystem) at `$root/$group/$version/`. For an example, the files for `com.squareup.okhttp3:okhttp:4.9.3` are available at https://repo.maven.apache.org/maven2/com/squareup/okhttp3/okhttp/4.9.3/
While originally made for the <>, Gradle also supports the Maven publication format. In order to provide
more flexibility, Gradle also introduced https://docs.gradle.org/current/userguide/publishing_gradle_module_metadata.html[Gradle module metadata]
to provide more information about the dependencies than a regular https://maven.apache.org/guides/introduction/introduction-to-the-pom.html[pom file]
[[maven-central]]
=== MavenCentral
https://search.maven.org/[MavenCentral] is the main repository that hosts <>. It is operated by a
company named https://www.sonatype.com/[Sonatype] and is the default repository for a lot of the ecosystem.
Other repositories exists like (now defunct) https://jfrog.com/blog/into-the-sunset-bintray-jcenter-gocenter-and-chartcenter/[jcenter] or the https://maven.google.com/web/index.html[Google Maven repository].
[[module]]
=== Module
An informal term for a <>, but more common than the formal term. A module is a
source code-containing directory, more or less independent of other modules in the same multi-module
(or multi-project) project.
This is one of the other very heavily overloaded terms in the Gradle world. See also <>.
[[plugin]]
=== Plugin
Gradle is built on a plugin system. Gradle itself is primarily composed of infrastructure, such as
a sophisticated dependency resolution engine, common to all project types. The rest of its
functionality comes from plugins, including "core" plugins distributed with <> itself,
third-party plugins, and <> in a given build.
There are three _kinds_ of plugin, based on the context in which they are applied:
. Project plugins that implement `Plugin`, applied in <>.
. Settings plugins that implement `Plugin`, applied in <>.
. Init (Gradle) plugins that implement `Plugin`, applied in <>.
Plugins may be _implemented_ as so-called binary plugins (that is, by explicitly implementing one of the
specific generic interfaces described above), or as <>.
This distinction is merely an implementation detail.
cf. <>.
[[precompiled-script-plugin]]
=== Precompiled script plugin
Equivalent to a <>, but written such that it looks like a build script,
https://docs.gradle.org/current/userguide/custom_plugins.html#sec:precompiled_plugins[precompiled script plugins]
can be written in Groovy or Kotlin by applying the `'groovy-gradle-plugin'` or `kotlin-dsl` plugin,
respectively.
[[project]]
=== Project
Often referred to as a "module", every Gradle project is backed by a
https://docs.gradle.org/current/javadoc/org/gradle/api/Project.html[Project] instance, hence the name.
The most common type of <> is a project plugin. Most Gradle projects are composed of many
projects (sometimes called "subprojects").
[[publication]]
=== Publication
A Gradle https://docs.gradle.org/current/javadoc/org/gradle/api/publish/Publication.html[Publication] is a list of
<>, and possibly associated metadata. Most of the times, you will deal with https://docs.gradle.org/current/dsl/org.gradle.api.publish.maven.MavenPublication.html[MavenPublications] to publish in the
<> with the https://docs.gradle.org/current/userguide/publishing_maven.html[`maven-publish`] plugin
[[script-plugin]]
=== Script plugin
A gradle script that can be applied to other gradle scripts, including <>,
<>, and <>. Can be written in Groovy or
Kotlin, and are applied to other scripts via
https://docs.gradle.org/current/javadoc/org/gradle/api/plugins/PluginAware.html#apply-java.util.Map-[PluginAware.apply].
For example, `apply from: 'complicated_thing.gradle'`. Depending on the type of script they are
applied to, they're backed by either a <> instance, a <> instance,
or a <> instance.
[[settings-script]]
=== Settings script
A `settings.gradle` script. A https://docs.gradle.org/current/javadoc/org/gradle/api/initialization/Settings.html[settings script]
has a large number of responsibilities, but one of the most important is declaring the set of <>
that are part of the build, via `include ':project1'` and so on.
[[software-component]]
=== SoftwareComponent
A https://docs.gradle.org/current/javadoc/org/gradle/api/component/SoftwareComponent.html[SoftwareComponent] is a list of artifacts
built by Gradle. It's a relatively recent API used to connect <> and <>. Most of the times, you will
use already existing components such as `java` or the https://proandroiddev.com/android-library-distribution-with-maven-publish-28ac59b8ecb8[android ones]
to configure your maven publications. If you're a plugin author, you will most likely deal with https://docs.gradle.org/current/javadoc/org/gradle/api/component/AdhocComponentWithVariants.html[AdhocComponentWithVariants]
[[task]]
=== Task
Each <> is made up of one or more tasks. Each task ought to be atomic (but often isn't), with inputs and outputs. Gradle executes tasks to perform its work. Task examples include: compiling source code, creating artifacts (such as jars or apks), generating Javadoc, running static analysis (e.g. lint), deleting temporary files, or publishing to a repository, etc. When a https://docs.gradle.org/current/userguide/more_about_tasks.html[Gradle task] is asked to run we can see the outcome of the task. This will be one of EXECUTED, SKIPPED, FAILED, FROM-CACHE, UP-TO-DATE, NO-SOURCE or _blank_ (meaning executed).