How to read gradle documentation


I am trying to get some help here in reading and understanding gradle DSL documentation.

Let me take example of the Test phase

There is a property called “options” for this.

How am I to read this ? What does it expect, a closure, a value or what ?

Reason I ask is, the following example

  test {
     options {
             listeners << 'org.uncommons.reportng.HTMLReporter'
             listeners << 'org.uncommons.reportng.JUnitXMLReporter'

As you can see above, options looks like it takes a closure, or what is it taking exactly ?

Please educate a Gradle-Newbie.

Regards, -Narahari

What you are linking to is a (read-only) property rather than a method, so it doesn’t take any arguments. There is also an equally named method that takes a closure, but unfortunately the method doesn’t currently show up in the docs. I’ve just fixed that.


I am on the gradle doc site but I dont see the update for the options method.

Am I not looking at the right one ?


The “current” docs are for the latest release, so they won’t be updated until the next release.

Our nightly docs are published, unsurprisingly, every night so you can check them tomorrow.