All* syntax in docs isn't ideal


(Justin Ryan) #1

In the docs, the example for an exclude is add such:

configurations {
    compile.exclude module: 'commons'
    all*.exclude group: 'org.gradle.test.excludes', module: 'reports'
}

We’ve found problems with this, because the asterisk is having Groovy call getAll() which is returning the current list of configurations. Which means this exclude has to be put after every configuration is created, or else it’ll miss some. In our case, we saw it applied before any configurations were created so it was silently ignored. I’d propose we use the all syntax in the docs:

configurations {
    compile.exclude module: 'commons'
    all { exclude group: 'org.gradle.test.excludes', module: 'reports' }
}

This will then have the exclude apply to all configuration now and into the future, which is the general lazy evaluation Gradle approach.


#2

Sounds like a good change to make: any chance of a pull request?