Introducing Gradle

Book description

This concise book is a quick-start primer on the Gradle build automation tool. It provides a general introduction to Gradle, including how to set it up and the basics of Groovy, the language used for creating Gradle build files. The book also provides practical guides to writing tasks and actions and to understanding the build life cycle. Furthermore, it takes you step-by-step through the creation and use of a custom plugin.

After reading and using Introducing Gradle, you will have an understanding of Gradle’s dependency management and how single and multi-projects are structured and configured. It also teaches you how to use Gradle for publishing artifacts to local and Nexus remote repositories. Finally, the book covers Jenkins support for Gradle.

Table of contents

  1. Cover
  2. Title
  3. Copyright
  4. Contents at a Glance
  5. Contents
  6. About the Authors
  7. About the Technical Reviewer
  8. Acknowledgments
  9. Introduction
  10. Chapter 1: Getting Started
    1. Declarative Dependency Management
    2. Declarative Builds
    3. Build by Convention
    4. Incremental Builds
    5. Gradle Wrapper
    6. Plugins
    7. Open Source
    8. Gradle Alternatives
      1. Ant + Ivy
      2. Maven
    9. Summary
  11. Chapter 2: Setting Up Gradle
    1. Installation Prerequisites
      1. Setting Up Java
      2. Downloading Gradle
    2. Installing Gradle
      1. Installing on Windows
      2. Testing the Installation
      3. Installing on Mac OS X
      4. Setting Gradle’s JVM Options
      5. Gradle Distribution
    3. Hello World Gradle Script
    4. Getting Help
    5. Gradle GUI
    6. IDE Support
    7. Summary
  12. Chapter 3: Groovy Language Primer
    1. Installing Groovy
    2. Running Groovy
    3. Basic Groovy Language Features
      1. Groovy Syntax
      2. Comments
      3. Data Types
      4. Closures
    4. Summary
  13. Chapter 4: Understanding Gradle Builds
    1. Projects
    2. Tasks
      1. Creating Tasks
      2. Task Dependencies
      3. Skipping Tasks
      4. Gradle Task Types
    3. Build Lifecycle
    4. Summary
  14. Chapter 5: Projects and Plugins
    1. Introducing Plugins
    2. Java Projects
      1. Using the Java Plugin
      2. Jar Task
      3. Generating Javadoc
      4. Configuring the Default Layout
      5. Creating Web Projects
      6. War Task
    3. Writing a Custom Plugin
      1. Creating a Java Plugin
      2. Creating a Groovy Plugin
      3. Creating a Stand-Alone Project Plugin
    4. Summary
  15. Chapter 6: Dependency Management
    1. Declarative Dependency Management
    2. Dependency Configuration
      1. Working with Dependencies
      2. External Module Dependencies
      3. File Dependencies
      4. Project Dependencies
    3. Resolving Dependency Conflicts
    4. Repositories
    5. Uber JAR Creation
    6. Summary
  16. Chapter 7: Multi-Project Builds
    1. Multi-Project Structure
      1. Sample Project
      2. Flat Layout
      3. Multi-Project vs. Single-Project Builds
    2. Project Configuration
    3. Project Dependencies
    4. Subproject Build Files
    5. Summary
  17. Chapter 8: Publishing Artifacts
    1. Publishing to a Local Repository
    2. Publishing to a Maven Repository
      1. Installing Nexus
      2. The Build Configuration
    3. Dealing with Additional Artifacts
    4. Installing to a Gradle Cache
      1. Use a File Repository
      2. Use a Local Maven Repository
      3. Use a Central Repository
    5. Summary
  18. Chapter 9: Continuous Integration
    1. Continuous Integration Flow
    2. Sample Project
      1. Installing Jenkins
      2. Configuring Jenkins
      3. Creating the Build Job
      4. Running the Build Job
    3. Archiving Artifacts
    4. Publishing Test Results
    5. Summary
  19. Index

Product information

  • Title: Introducing Gradle
  • Author(s):
  • Release date: December 2015
  • Publisher(s): Apress
  • ISBN: 9781484210314