How to release multiple AARs as artifacts in subproject


I try to build project where sub-project android library should release multiple aar’s (android archive files). In details: library code packed as AAR and also needed to include two dependent AARs that are heavily patched during compilation process.

I try to implement concept introduced for java libraries:

  1. create custom configurations
  2. publish configurations in artifacts/archives scope/closures and with builtBy assigned task

But that approach does not work for android libraries/applications with AAR archives. It works with JAR but not with AARs.

Can you help me find an approach that will work with AARs? Or give the way to inject ‘dependency into project after configuration phase’ OR ‘force task execution in the configuration phase’