Gradle Effective Implementation Guide
eBook - ePub

Gradle Effective Implementation Guide

  1. 382 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Gradle Effective Implementation Guide

Book details
Book preview
Table of contents
Citations

About This Book

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.

Approach

Written in Packt's tutorial format the hands on examples and real life applications that will guide you through Gradle and give you the knowledge to use it every day.

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.

Frequently asked questions

Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Yes, you can access Gradle Effective Implementation Guide by Hubert Klein Ikkink in PDF and/or ePUB format, as well as other popular books in Computer Science & Programming. We have over one million books available in our catalogue for you to explore.

Information

Year
2012
ISBN
9781849518109
Edition
1

Gradle Effective Implementation Guide


Table of Contents

Gradle Effective Implementation Guide
Credits
About the Author
Acknowledgement
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers and more
Why Subscribe?
Free Access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Starting with Gradle
Introducing Gradle
Declarative builds and convention over configuration
Support for Ant tasks and Maven repositories
Incremental builds
Multi-project builds
Gradle wrapper
Free and open source
Getting started
Installing Gradle
Writing our first build script
Default Gradle tasks
Task name abbreviation
Executing multiple tasks
Command-line options
Logging options
Changing the build file and directory
Running tasks without execution
Gradle daemon
Profiling
Understanding the Gradle user interface
Task Tree
Favorites
Command Line
Setup
Summary
2. Creating Gradle Build Scripts
Writing a build script
Defining tasks
Defining actions with the Action interface
Build scripts are Groovy code
Defining dependencies between tasks
Defining dependencies via tasks
Defining dependencies via closures
Setting default tasks
Organizing tasks
Adding a description to tasks
Grouping tasks together
Adding tasks in other ways
Using task rules
Accessing tasks as project properties
Adding additional properties to tasks
Avoiding common pitfalls
Skipping tasks
Using onlyIf predicates
Skipping tasks by throwing StopExecutionException
Enabling and disabling tasks
Skipping from the command line
Skipping tasks that are up-to-date
Summary
3. Working with Gradle Build Scripts
Working with files
Locating files
Using file collections
Working with file trees
Copying files
Renaming files
Filtering files
Archiving files
Project properties
Defining custom properties in script
Passing properties via the command line
Defining properties via system properties
Adding properties via environment variables
Defining properties using an external file
Using logging
Controlling output
Using the Gradle wrapper
Creating wrapper scripts
Customizing the Gradle wrapper
Summary
4. Using Gradle for Java Projects
Using plugins
Getting started
Using the Java plugin
Working with source sets
Creating a new source set
Custom configuration
Working with properties
Creating documentation
Assembling archives
Summary
5. Dependency Management
Dependency configuration
Repositories
Adding Maven repositories
Adding Ivy repositories
Adding a local directory repository
Defining dependencies
Using external module dependencies
Using project dependencies
Using file dependencies
Using client module dependencies
Using Gradle and Groovy dependencies
Accessing configuration dependencies
Setting dynamic versions
Resolving version conflicts
Adding optional ANT tasks
Using dependency configurations as files
Summary
6. Testing, Building, and Publishing Artifacts
Testing
Using TestNG for testing
Configuring the test process
Determining tests
Logging test output
Generating test reports
Running Java applications
Running an application from a project
Running an application as task
Running an application with the application plugin
Creating a distributable application archive
Publishing artifacts
Uploading to a Maven repository
Multiple artifacts
Signing artifacts
Publishing signature files
Configuring conditional signing
Packaging Java Enterprise Edition applications
Creating a WAR file
Using the War plugin
Creating an EAR file
Using the Ear plugin
Summary
7. Multi-project Builds
Working with multi-project builds
Executing tasks by project path
Using a flat layout
Defining projects
Filtering projects
Defining task dependencies between projects
Defining configuration dependencies
Working with Java multi-project builds
Using partial builds
Using the Jetty plugin
Summary
8. Mixed Languages
Using the Groovy plugin
Creating documentation with the Groovy plugin
Using the Scala plugin
Creating documentation with the Scala plugin
Summary
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
10. Writing Custom Tasks and Plugins
Creating a custom task
Creating a custom task in the build file
Using incremental build support
Creating a task in the project source directory
Writing tests
Creating a task in a standalone project
Creating a custom plugin
Creating a plugin in the build file
Creating a plugin in the project source directory
Testing a plugin
Creating a plugin in a standalone project
Summary
11. Using Gradle with Continuous Integration
Creating a sample project
Using Jenkins
Adding the Gradle plugin
Configuring Jenkins job
Running the job
Configuring artifacts and test results
Adding Gradle versions
Using JetBrains TeamCity
Creating a project
Running the project
Using Atlassian Bamboo
Defi...

Table of contents

  1. Gradle Effective Implementation Guide