Gradle Effective Implementation Guide

A must-read for Java developers, this book will bring you bang up to date in the techniques of build automation using Gradle. A fully hands-on approach makes learning natural and entertaining.

Gradle Effective Implementation Guide

Starting
Hubert Klein Ikkink

A must-read for Java developers, this book will bring you bang up to date in the techniques of build automation using Gradle. A fully hands-on approach makes learning natural and entertaining.
$10.00
$44.99
RRP $26.99
RRP $44.99
eBook
Print + eBook
$12.99 p/month

Get Access

Get Unlimited Access to every Packt eBook and Video course

Enjoy full and instant access to over 3000 books and videos – you’ll find everything you need to stay ahead of the curve and make sure you can always get the job done.

+ Collection
Free Sample

Book Details

ISBN 139781849518109
Paperback382 pages

About This Book

  • Learn the best of Gradle
  • Work easily with multi-projects
  • Apply Gradle to your Java, Scala and Groovy projects

Who This Book Is For

If you are a Java developer who wants to automate compiling, packaging and deploying your application this book is for you.

Table of Contents

Chapter 1: Starting with Gradle
Introducing Gradle
Getting started
Writing our first build script
Default Gradle tasks
Task name abbreviation
Executing multiple tasks
Command-line options
Understanding the Gradle user interface
Summary
Chapter 2: Creating Gradle Build Scripts
Writing a build script
Defining tasks
Build scripts are Groovy code
Defining dependencies between tasks
Setting default tasks
Organizing tasks
Adding tasks in other ways
Accessing tasks as project properties
Adding additional properties to tasks
Avoiding common pitfalls
Skipping tasks
Summary
Chapter 3: Working with Gradle Build Scripts
Working with files
Project properties
Using logging
Using the Gradle wrapper
Summary
Chapter 4: Using Gradle for Java Projects
Using plugins
Getting started
Using the Java plugin
Working with source sets
Working with properties
Creating documentation
Assembling archives
Summary
Chapter 5: Dependency Management
Dependency configuration
Repositories
Defining dependencies
Summary
Chapter 6: Testing, Building, and Publishing Artifacts
Testing
Running Java applications
Publishing artifacts
Packaging Java Enterprise Edition applications
Summary
Chapter 7: Multi-project Builds
Working with multi-project builds
Working with Java multi-project builds
Using the Jetty plugin
Summary
Chapter 8: Mixed Languages
Using the Groovy plugin
Using the Scala plugin
Summary
Chapter 9: Maintaining Code Quality
Using the Checkstyle plugin
Using the PMD plugin
Using the FindBugs plugin
Using the JDepend plugin
Using the CodeNarc plugin
Using the Sonar plugin
Summary
Chapter 10: Writing Custom Tasks and Plugins
Creating a custom task
Creating a task in the project source directory
Creating a task in a standalone project
Creating a custom plugin
Creating a plugin in the project source directory
Creating a plugin in a standalone project
Summary
Chapter 11: Using Gradle with Continuous Integration
Creating a sample project
Using Jenkins
Using JetBrains TeamCity
Using Atlassian Bamboo
Summary
Chapter 12: IDE Support
Using the Eclipse plugin
Using the IntelliJ IDEA plugin
Running Gradle in Eclipse
Running Gradle in IntelliJ IDEA
Summary

What You Will Learn

  • Create Gradle build scripts from clear examples
  • Write build logic with the Gradle build language
  • Compile, test and check your Java, Scala and Groovy applications
  • Write your own custom tasks and plugins
  • Use Gradle on continous integrations servers Jenkins, TeamCity and Bamboo
  • Integrate Gradle with Eclipse and IntelliJ IDEA

In Detail

Gradle is the next generation in build automation. It uses convention-over-configuration to provide good defaults, but is also flexible enough to be usable in every situation you encounter in daily development. Build logic is described with a powerful DSL and empowers developers to create reusable and maintainable build logic.

"Gradle Effective Implementation Guide" is a great introduction and reference for using Gradle.  The Gradle build language is explained with hands on code and practical applications. You learn how to apply Gradle in your Java, Scala or Groovy projects, integrate with your favorite IDE and how to integrate with well-known continuous integration servers.

Start with the foundations and work your way through hands on examples to build your knowledge of Gradle to skyscraper heights. You will quickly learn the basics of Gradle, how to write tasks, work with files and how to use write build scripts using the Groovy DSL. Then as you develop you will be shown how to use Gradle for Java projects. Compile, package, test and deploy your applications with ease. When you’ve mastered the simple, move on to the sublime and integrate your code with continuous integration servers and IDEs. By the end of the "Gradle Effective Implementation Guide" you will be able to use Gradle in your daily development. Writing tasks, applying plugins and creating build logic will be second nature.

Authors

Table of Contents

Chapter 1: Starting with Gradle
Introducing Gradle
Getting started
Writing our first build script
Default Gradle tasks
Task name abbreviation
Executing multiple tasks
Command-line options
Understanding the Gradle user interface
Summary
Chapter 2: Creating Gradle Build Scripts
Writing a build script
Defining tasks
Build scripts are Groovy code
Defining dependencies between tasks
Setting default tasks
Organizing tasks
Adding tasks in other ways
Accessing tasks as project properties
Adding additional properties to tasks
Avoiding common pitfalls
Skipping tasks
Summary
Chapter 3: Working with Gradle Build Scripts
Working with files
Project properties
Using logging
Using the Gradle wrapper
Summary
Chapter 4: Using Gradle for Java Projects
Using plugins
Getting started
Using the Java plugin
Working with source sets
Working with properties
Creating documentation
Assembling archives
Summary
Chapter 5: Dependency Management
Dependency configuration
Repositories
Defining dependencies
Summary
Chapter 6: Testing, Building, and Publishing Artifacts
Testing
Running Java applications
Publishing artifacts
Packaging Java Enterprise Edition applications
Summary
Chapter 7: Multi-project Builds
Working with multi-project builds
Working with Java multi-project builds
Using the Jetty plugin
Summary
Chapter 8: Mixed Languages
Using the Groovy plugin
Using the Scala plugin
Summary
Chapter 9: Maintaining Code Quality
Using the Checkstyle plugin
Using the PMD plugin
Using the FindBugs plugin
Using the JDepend plugin
Using the CodeNarc plugin
Using the Sonar plugin
Summary
Chapter 10: Writing Custom Tasks and Plugins
Creating a custom task
Creating a task in the project source directory
Creating a task in a standalone project
Creating a custom plugin
Creating a plugin in the project source directory
Creating a plugin in a standalone project
Summary
Chapter 11: Using Gradle with Continuous Integration
Creating a sample project
Using Jenkins
Using JetBrains TeamCity
Using Atlassian Bamboo
Summary
Chapter 12: IDE Support
Using the Eclipse plugin
Using the IntelliJ IDEA plugin
Running Gradle in Eclipse
Running Gradle in IntelliJ IDEA
Summary

Book Details

ISBN 139781849518109
Paperback382 pages
Read More

Recommended for You