Triple-T / gradle-play-publisher

GPP is Android's unofficial release automation Gradle Plugin. It can do anything from building, uploading, and then promoting your App Bundle or APK to publishing app listings and other metadata.
MIT License
4.12k stars 339 forks source link

Support `productFlavors` for different descriptions #83

Closed jaredsburrows closed 9 years ago

jaredsburrows commented 9 years ago

Support android.productFlavors extension provided by the Android plugin.

For instance, if you have a free and paid version of the application where the descriptions vary.

Currently:

|-- play
|   |-- contactEmail
|   |-- contactPhone
|   |-- contactWebsite
|   `-- en-US
|       |-- listing
|       |   |-- fulldescription
|       |   |-- icon
|       |   |   `-- web_hi_res_512_square.png
|       |   |-- phoneScreenshots
|       |   |-- sevenInchScreenshots
|       |   |-- shortdescription
|       |   |-- tenInchScreenshots
|       |   |   |-- screen1437336847.png
|       |   |   `-- screen1437336856.png
|       |   `-- title
|       |-- whatsnew
|       `-- whatsnew-beta

It would be nice to have:

|-- play
|   |-- free flavor
|       |   |--contactEmail
|       |   |--contactPhone
|   |-- paid flavor
|       |   |--contactEmail
|       |   |--contactPhone

etc...

bhurling commented 9 years ago

This is already supported and explained in a side note in the readme. Suppose you have a free and a paid flavor. Then you already have different source sets for your flavors. The plugin just merges several play folders into one like so:

- [src]
  |
  + - [main]
  |   |
  |   + - [play]
  |       |
  |       + // texts and images used in all flavors
  |
  + - [free]
  |   |
  |   + - [play]
  |       |
  |       + // texts and images used in your free flavor
  |
  + - [paid]
      |
      + - [play]
          |
          + // texts and images used in your paid flavor

This way you can even support different sets of languages in your flavors.

jaredsburrows commented 9 years ago

So if both free and paid share source code and resources from main, then what happens to the text? This setup only generates 2 APK files.

bhurling commented 9 years ago

Files in the flavour directories override files in the main source set just like your app resources would

jaredsburrows commented 9 years ago

Good, thank you!