Luke is confident, because he's one of the core Gradle developer :)
My team is working with the Gradle team to make the flavor support in library. I'm not sure how it's going to look like at the publication level. Obviously, Gradle will need to be able to support publishing different variants. It's not something that can be mapped easily to existing dependency management (for maven we'd have to allow making each variant a different artifact) but internally (when doing inter-project dependencies) we can leverage a more complex system.
While I'm not sure yet how it'll be done exactly internally, here's what I want it to look like for a user.
dependencies {
compile projet(':mylib')
}
that's it. If both publisher and consumer declares the same variant, nothing else needs to happen. Variant FooDebug of the project should automatically consume variant FooDebug of the library.
Now if the library and app variants don't match, we can provide a way through the DSL to provide a custom mapping. Simple mapping like the library only having debug/release can be easily mapped (any debug variant of the app use the debug library). In other case you'll simple provide a custom mapping.
If you publish the library to an artifact repository you'll probably have to go through different artifacts, and do
dependencies {
fooDebugCompile 'com.myapp:mylib-foo-debug:1.0'
barDebugCompile 'com.myapp:mylib-bar-debug:1.0'
}
Note that currently fooDebugCompile doesn't exist. We only have "fooCompile" or "debugCompile", but we are planning to add this.