본문 바로가기

Gradle

Developer(s)

Hans Dockter, Adam Murdoch, Szczepan Faber, Peter Niederwieser, Luke Daley, Rene Gröschke, Daz DeBoer, Steve Appling

Initial release

2007 (12 years ago)

Stable release

version : 5.4.1

April 26, 2019 (1 month ago)

Preview release

version : 5.4 RC1

April 10, 2019 (46 days ago)

Repository

github.com/gradle/gradle

Written in

JavaGroovyKotlin

Type

Build tool

License

Apache License 2.0

Website

gradle.org


Gradle is a dependency management and a build automation tool which was built upon the concepts of Ant and Maven.


Why?

 Gradle is a build automation system that is fully open source and uses the concepts you see on Apache Maven and Apache AntBut, it's not using XML files, unlike Ant or Maven.

 Over time, developers became more and more interested in having and working with a domain specific language – which, simply put, would allow them to solve problems in a specific domain using a language tailored for that particular domain.

 Gradle is using a DSL based on Groovy. This led to smaller configuration files with less clutter since the language was specifically designed to solve specific domain problems. Gradle’s configuration file is by convention called build.gradle.

 

 

What?

Gradle is an open-source build automation tool focused on performance and flexibility. It uses domain-specific language(DSL) based on the programming language Groovy, differentiating it from Apache Maven, which uses XML for its project configuration. It also determines the order of tasks run by using a directed acyclic graph("DAG").

 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 build tree are up to date; any task dependent only on those parts does not need to be re-executed.

 Gradle is an advanced general purpose build management system based on Groovy and Kotlin. Gradle supports the automatic download and configuration of dependencies or other libraries. It supports Maven and Ivy repositories for retrieving these dependencies. This allows reusing the artifacts of existing build systems.

 

 

Pros

● Highly customizable

   - Modeled in a way that is customizable and extensible in the most fundamental ways.
● Fast

  - Completes tasks quickly by reusing outputs from previous executions, processing only inputs that changed, and executing tasks in parallel.
● Powerful

  - The official build tool for Android, and comes with support for many popular languages and technologies.

● Gives you conventions but still gives you power to override them easily

● Build files are less verbose as they are written in groovy

● It provides very nice DSL for writing build tasks

● Has lot of good plugins and vibrant ecosystem

 

 

How to work?

 Examples of Gradle task graphs

 

 

Concepts

● A general-purpose build tool

  - Gradle allows you to build any software, because it makes few assumptions about

what you’re trying to build or how it should be done.

● The core model is based on tasks

   - Gradle models its builds as Directed Acyclic Graphs (DAGs) of tasks (units of work).

● Several fixed build phases

   1. Initialization

     - Sets up the environment for the build and determine which projects will take part in it.

   2. Configuration

     - Constructs and configures the task graph for the build and then determines which tasks need to run and in which order, based on the task the user wants to run.

   3. Execution

     - Runs the tasks selected at the end of the configuration phase.

● Extensible in more ways than one

   - Custom task types

   - Custom task actions

   - Extra properties on projects and tasks

   - Custom conventions

   - A custom model

● Build scripts operate against an API

   - It’s easy to view Gradle’s build scripts as executable code, because that’s what they are.

 

Example Java

Example Ant

refer to Link)

● Gradle Build Tool
https://gradle.org/
● Gradle - Wikipedia
https://en.wikipedia.org/wiki/Gradle
● Gradle - 위키백과
https://ko.wikipedia.org/wiki/Gradle
● Gradle vs. Maven -DZone Java
https://dzone.com/articles/gradle-vs-maven
● Differnece between Gradle and Maven?
https://stackoverflow.com/questions/18072456/difference-between-gradle-and-maven
● What is Gradle?
https://www.quora.com/What-is-Gradle
● What is Gradle?
https://docs.gradle.org/current/userguide/what_is_gradle.html
● Gradle User Manual
https://docs.gradle.org/current/userguide/userguide.html
● The Gradle build system - Tutorial
https://www.vogella.com/tutorials/Gradle/article.html#what-is-the-gradle-build-system

● [java] Gradle 익히는 방법
https://blog.naver.com/writer0713/221386351377
● 운영 자동화#1 - 빌드 자동화 by Gradle
https://medium.com/@goinhacker/%EC%9A%B4%EC%98%81-%EC%9E%90%EB%8F%99%ED%99%94-1-%EB%B9%8C%EB%93%9C-%EC%9E%90%EB%8F%99%ED%99%94-by-gradle-7630c0993d09
● gradle [권남]
http://kwonnam.pe.kr/wiki/gradle
● [Build Tool] ANT / MAVEN / GRADLE 비교
https://blog.naver.com/jeeyun617/220612514231

'Theory > Build Tool' 카테고리의 다른 글

Ant vs Maven vs Gradle (Comparison)  (0) 2019.05.03
Maven  (0) 2019.05.01
Ant  (0) 2019.04.30