Open mtsahakis opened 4 years ago
You didn't list your error message, but you may be having issues with the configuration you're listing not existing at the time this plugin evaluates the DSL above. The Android Gradle Plugin creates the variant configurations dynamically. You might try tinkering with the afterEvaluate lifecycle closure, or just avoiding specifying configurations in the DSL above completely and prune the output later.
In my attempts to make this work for a multi-module Android project (ex: modules A & B where B depends on A), it was failing in subproject B when trying to resolve dependencies on subproject A. It has difficult matching variants using attributes.
I was able to bypass this completely by doing the hack below. There's no need to resolve peer modules within the same project for my needs, because I'm running the plugin separately in each subproject.
configurations.all { Configuration c ->
println c.name
def projectDeps = []
c.dependencies.each { Dependency d ->
if (d instanceof ProjectDependency) {
println d
projectDeps << d
}
}
c.dependencies.removeAll(projectDeps)
}
I have tried to apply your plugin to an Android multi module project, but with no luck.
I have the following:
Any help here would be greatly appreciated.