YouTube

Got a YouTube account?

New: enable viewer-created translations and captions on your YouTube channel!

English subtitles

← Gradle DSL Reference

Get Embed Code
4 Languages

Showing Revision 4 created 05/24/2016 by Udacity Robot.

  1. As with any other software API or
    framework, you'll want to become
  2. very comfortable with finding your
    way around the Gradle documentation.
  3. Gradle provides a few different
    forms of documentation, but
  4. we'll focus specifically on the DSL
    reference, which is a good first place
  5. to look if you want to know what all
    configuration options are available,
  6. in any given part of your build script.
  7. The Gradle DSL reference covers all
    the different build script components.
  8. Many of which we'll talk
    about later in this course.
  9. Since we're currently concerned with
    tasks, let's take a look at the task
  10. types that are available as part
    of the Gradle distribution.
  11. As you can see there are a number
    of built in task types,
  12. varying from followup operations to
    compilation, to source code analysis.
  13. Since one of the most common build
    actions involves copying files.
  14. Let's take a look at the copy task API.
  15. For most built in task types
    examples are provided for
  16. common configuration use cases.
  17. If we look further, we can see the
    various task configuration properties
  18. as well as methods available.
  19. Many of the method descriptions
    reference other greater API types.
  20. Since many API methods take
    a groovy closure as an argument,
  21. it's helpful to know what arguments
    will be passed into the closure.
  22. The eachFile method, for example,
    takes a closure as an argument.
  23. The closure that we
    pass in as an argument,
  24. is then given an instance of
    FileCopyDetails as its argument.
  25. We can click this link, and then get
    additional details about the options
  26. that are available on this class.
  27. The Gradle DSL reference
    is your best friend.
  28. Learn it, love it, and it will
    help you out of all sorts of jams.