How to make a variant aware configuration (with attributes) visible inside Android Studio

27 views
Skip to first unread message

Stéphane NICOLAS

unread,
Dec 17, 2017, 12:30:37 PM12/17/17
to adt-dev
Hi all,

still working on the same Android plugin. Everything works well, and we can now exchange artifacts between modules, and use the same variant resolution strategy than other Android artifacts.

BUT, we have an issue: how can we add our client configuration to the client module so that it's visible inside Android Studio.

More specifically: I got 2 modules, and I can share an artifact using attributes matching between the client and the producer. And all works on the command line: the client can use the artifact from the producer for its compile task. Though, there is an issue: Android Studio doesn't recognize the artifact from my consumer module and the classes inside the artifact remain red, I can't use them from the IDE.

In code, basically, my issue is the following

```client.configuration {
   conf_with_attributes //works well and gets resolved to the right artifact
}
client.dependencies {
   implementation conf_with_attributes //-- this doesn't work as the conf_with_attributes is resolved using the implementation attributes.
}
```
I can use the conf_with_attributes in the compile task and it works fine, but I can't make the IDE recognize the conf.

Is this what the registerArtifact method is supposed to be for ???
Reply all
Reply to author
Forward
0 new messages