left-icon

Gradle Succinctly®
by José Roberto Olivas Mendoza

Previous
Chapter

of
A
A
A

CHAPTER 1

Introduction

Introduction


What is Gradle?

Gradle is an open-source build automation system that was conceived upon a Groovy-based[1] domain-specific language[2] (DSL). Gradle was designed for multi-project builds, which can grow to be quite large. It supports incremental builds by intelligently determining which parts of the project are up-to-date, so that any task dependent upon those parts will not be re-executed.

The initial release of Gradle was published in 2007, and the project is considered to have active development status. The current stable release (at the time of writing) was published in March of 2016.

Gradle is being heralded as more than a build tool, but also as a means for automating the compilation, test, and release process. Qualified by its developers as a quantum leap for building technology in the Java world, some of Gradle’s features are:

  • Declarative builds and build-by-convention: Based on a rich, extensible Domain Specific Language (DSL) based on Groovy, Gradle provides declarative language elements that the user can assemble as desired. Those elements also provide build-by-convention support for Java, Groovy, OSGi, Web, and Scala projects. The declarative language is extensible, allowing you to add new language elements or enhance the existing ones.
  • Language for dependency-based programming: The declarative language lies on top of a general purpose task graph. It provides utmost flexibility to adapt Gradle to specific or unique development needs.
  • Custom-structured builds: Gradle allows you to apply common design principles to a build. For example, it’s very easy to compose a build from reusable pieces of build logic, creating a well-structured and easily maintained build.
  • Multiproject builds: Gradle allows users to model project relationships in a multi-project according to the user’s layout. Also, it provides partial builds, so that when a single subproject is built, Gradle takes care of building all subprojects that subproject depends on. The user can choose to rebuild the subprojects that depend on a specific subproject.
  • Groovy: Build scripts are written in Groovy. This is intended to orientate Gradle to be used as a language, not as a framework.
  • Free and open source: Gradle is an open-source project, licensed under the ASL (Apache Software License), which can be viewed here.

Why are scripts written in Groovy?

Since Gradle’s main focus is Java projects, the team members for those projects are very familiar with Java. Gradle developers thought that a build script should be as transparent as possible to all team members. They didn’t use Java because its limitations prevent a nice, expressive, and powerful build language.

Groovy was chosen because it provides the greatest transparency for Java people. Its base syntax is the same, as well as its type system and other things. Thus, every Gradle build file is an executable Groovy script. For Gradle beginners, being aware that they’re writing Groovy code is not needed. But when your needs become more sophisticated, the power of the Groovy language may become very important. In that way, Gradle’s Groovy-based build files allow the users to do general-purpose programming tasks in their build file, offering control flow and execution of nonstandard tasks within the build process.

About domain-specific build languages

At some point, every developer who has been maintaining a complex build wants to write a little bit of code for a build file. Sometimes, the unlimited ability to code a build according to the user-desired way can result in a catastrophe of maintainability. Although Gradle build files are Groovy scripts, Gradle itself intends to present the user not with mere Groovy, but with a domain-specific language (DSL) oriented to the task of building code. So a new Gradle user could learn this language with no previous knowledge about Groovy, and use Gradle effectively. This DSL describes the build using idioms appropriate for performing the task of building software, and not necessarily for general-purpose programming. In this way, Gradle gently nudges the user toward using the idioms of its DSL first, even when general-purpose coding is always available.

About Gradle Inc.

Gradle Inc. is a Silicon Valley startup that develops, distributes, and supports the Gradle open-source project. Its mission statement is “to transform how software is built and shipped.” Also, it claims to exist “to end once-and-for-all the worst things about big software and restore the reason the user got into coding in the first place.”

Besides supporting Gradle, the company offers services related to Gradle, build automation, and continuous integration pipelines. According to its website, some of these services are:

  • Build migration: Create a seamless build migration to Gradle and replicate custom build functionality, including Ant or Maven scripts.
  • CD optimization: Leverage Gradle to automate your continuous delivery pipeline and best practices.
  • Performance tuning: Improve build performance and developer productivity.
  • Standardization: Get help to centralize your Gradle build infrastructure.
  • Build review: Review your current Gradle build infrastructure with a core developer, and get recommendations on improvements.
  • Integration: Integrate Gradle with your existing tools and platforms.
  • Plugin development: Identify opportunities to leverage Gradle plugins to put in place a manageable build infrastructure.

Chapter summary

Gradle is an open-source build automation system that is conceived upon a Groovy-based domain-specific-language (DSL). Gradle was first released in 2007, and the project is considered to have an active development status. This e-book uses release 2.12, published on March 14, 2016.

Gradle is being heralded as a build tool, and also a tool for automating the compilation, test, and release process. Gradle’s main focus is Java projects, and for that reason its developers chose Groovy because it provides the greatest transparency for Java people. Its base syntax is the same, as well as its type system and other things.

Although Gradle build files are Groovy scripts, Gradle itself intends to present the user not with mere Groovy, but with a domain-specific language (DSL) specifically oriented to the task of building code. So a new Gradle user could learn this language with no previous knowledge of Groovy, and use Gradle effectively.

Gradle Inc. is a Silicon Valley startup that develops, distributes, and supports Gradle. It offers services around Gradle, build automation, and continuous integration pipelines.

Scroll To Top
Disclaimer
DISCLAIMER: Web reader is currently in beta. Please report any issues through our support system. PDF and Kindle format files are also available for download.

Previous

Next



You are one step away from downloading ebooks from the Succinctly® series premier collection!
A confirmation has been sent to your email address. Please check and confirm your email subscription to complete the download.