How to publish another variant aware artifact per android module ?

Skip to first unread message

Stéphane NICOLAS

Dec 8, 2017, 1:51:37 AM12/8/17
to adt-dev
Hi all,

I am trying, for an OSS lib, to write a plugin that
  • creates a jar artifact, only code, no resource
  • the jar is created via a task, compiled via a task
  • the configurations, sourceset, are pure java (I don't use andoird source sets)

I can get this to work, but I would like this to be variant aware: I would like a consumer project to be able to consume different jars by passing their current android variant to the producer.

And I am stuck, I spent hours reading the code, and I couldn't find a way to do it. It looks like there is no open API to achieve it.

Can anyone help ?

Thanks in advance,


Stéphane NICOLAS

Dec 11, 2017, 1:54:13 PM12/11/17
to adt-dev
It's clearly not an easy one, but we are making progress.

The last thing we are struggling with is getting the build type and product flavor attirbutes and applying them to our custom coonfigurations for attributes matching (we want to use the android attributes so that we benefit from the matching strategy).

Thanks in advance if anyone can point us in the right direction, otherwise our plan is to copy the attributes from a working configuration from the android plugin.

Stéphane NICOLAS

Dec 11, 2017, 7:58:35 PM12/11/17
to adt-dev
FYI: It worked by copying the attributes from a variant's config. We had to exclude some attributes but it works well to get access to proper buitype and product flavor attributes.
Our plugin is variant aware !
Reply all
Reply to author
0 new messages