From the course: Learning Gradle

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Challenge: Define and execute a task

Challenge: Define and execute a task

From the course: Learning Gradle

Start my 1-month free trial

Challenge: Define and execute a task

(upbeat music) - [Instructor] In this chapter we learned how to create and to execute tasks. It is time to write tasks of our own. For this challenge, I want you to implement an archiving task, named Tar text files, that creates a TAR file. The contents of the archive should only include the files with the file extension .txt. Text files should be stored in the directory texts inside of the archive. During the process of copying the files into the archive, we'll want to rename the file extension of the text files, to .text. The created TAR file, should end up in the output directory build/distributions. Make sure to compress the archive using Gzip. Contact the greater documentation to understand the API for creating such a task. I also want you to become more familiar with defining task actions, and tasks dependencies. Define a task action, that should print the message, creating TAR file, before the…

Contents