This document provides an overview of the Gradle build tool. It discusses Gradle's advantages over other build tools like Apache Ant, Apache Maven, and Apache Ivy. Key features of Gradle highlighted include its use of the Groovy language for build scripts, flexible and customizable builds, support for multi-project builds, caching, and integration with other tools. The document also provides examples of using Gradle for tasks like custom tasks, testing, plugins, and deployments.
2. About author
• Works in IT since 2000
• 11 year of Java SE/EE experience
• Regular speaker at Java conferences
• Author of “Development of Java applications” and
“Main errors in Java programming ”books
• Founder of http://it-simulator.com
• 3 years of Gradle usage
19. Issue #1. XML
• Large and complex files are hard to understand
• Hierarchical structure limits the expressiveness
of the format
• Good format for the data and complex for the flow
20. Hans Dockter
• Founder of Gradle and Gradleware
• 13 years of experience as a software developer,
team leader, architect, trainer, and mentor
• Previously worked at Jboss and founded Jboss-IDE
• Holds a Diploma in Physics with a minor in Computer
Science
• Admirer of domain-driven-design
21. Slogan
• Make the impossible possible
• Make the possible easy
• Make the easy elegant
22. Solution #1. Groovy
• An agile and dynamic language for the Java
Virtual Machine
• Makes modern programming features available to
Java developers with almost-zero learning curve
• Provides the ability to statically type
check and statically compile your code for
robustness and performance
• Share base syntax, type system, packages
hierarchy with Java
• Every Gradle build file is Groovy script
35. Custom task
• Writes audit information at the end of the build
• Audit information includes project name and build
timestamp
• Audit files are located in the separate folder
39. Cache everything
• Remote metadata and artifacts
• Transitive dependency resolution
• Build execution plan
• Plugin inputs and outputs
• Test results
40. Daemon
• Improves startup and execution time of Gradle
• Initial Gradle command forks daemon process
• Subsequent Gradle commands reuse the build
daemon
• If daemon is currently busy then new daemon
process is started on-demand
• Useful for small tasks execution
• Expires after 3 hours of idle time
44. Plugin
• Add tasks to the project
• Pre-configure added tasks with useful defaults
• Add dependency configurations to the project
• Add new properties and methods to existing type
via extensions
58. Maven converter
• maven2Gradle is obsolete now
• Build init plugin converts:
o POM settings
o Dependencies
o Properties
o Java compiler settings
o Single- and multi-project settings
o Packaging of sources and tests
67. Caching
• Gradle caches all compiles scripts by default
• Compiled scripts are put into .gradle folder
• Gradle uses compiled version if the script hasn’t
changed
• --recompile-scripts option discards cache
68. Wrapper
• Preferred way of starting a Gradle build
• Gradle will be automatically downloaded via
wrapper
• Includes shell script
• Useful for CI tasks