Book Image

Gradle Essentials

By : Abhinandan Maheshwari
Book Image

Gradle Essentials

By: Abhinandan Maheshwari

Overview of this book

Gradle is an advanced and modern build automation tool. It inherits the best elements of the past generation of build tools, but it also differs and innovates to bring terseness, elegance, simplicity, and the flexibility to build. Right from installing Gradle and writing your first build file to creating a fully-fledged multi-module project build, this book will guide you through its topics in a step-by-step fashion. You will get your hands dirty with a simple Java project built with Gradle and go on to build web applications that are run with Jetty or Tomcat. We take a unique approach towards explaining the DSL using the Gradle API, which makes the DSL more accessible and intuitive. All in all, this book is a concise guide to help you decipher the Gradle build files, covering the essential topics that are most useful in real-world projects. With every chapter, you will learn a new topic and be able to readily implement your build files.
Table of Contents (17 chapters)
Gradle Essentials
Credits
About the Authors
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Chapter 7. Testing and Reporting with Gradle

In this chapter, we will cover four different topics: testing with TestNG, integration testing, code coverage with JaCoCo, and code analysis with Sonar. In Chapter 2, Building Java Projects, we already discussed unit testing with JUnit. In this chapter, we'll cover another widely used testing tool, TestNG. Code coverage and code quality are the other two important aspects in test-driven development (TDD). In today's agile development process, developers need continuous feedback on the code developed by them. Code quality tools help us to achieve this goal. Often, these tools are integrated with the Continuous Integration (CI) systems so that these reports are created on a daily basis (may be even after each commit), shared among different teams, and even be persisted for future analysis. In this chapter, we will be focusing only on the Gradle aspects of different tools. We will mainly cover different Gradle plugins that support these features...