How to add extra metadata to configuration dependency?


(james.poli) #1

Hello,

I’m trying to add additional metadata (property) to a configuration dependency via a closure but it doesn’t
appear to be working?

// CODE SNIPPET START
...
// SET PROPERTY
dependencies {
    compile('com.group:good-stuff:1.+') {
        ext.foo = true
    }
}
...
// CHECK PROPERTY
configuration.allDependencies.findAll {
    it.group == group && it.name == name && it.version == version
}.each {
    if (it.hasProrperty('foo') && it.foo) {
        foo = true
        return true // stop looking
        }
}
...
// CODE SNIPPET END

Any assistance is appreciated!

Thanks in advance,
Jim


(René Groeschke) #2

there is a typo here. apart from that it should work. just tested it locally on my box.


(james.poli) #3

Awesome, thanks Rene! Jim