2

I'm working on an Android application that has two different flavours and I'm looking at the Gradle Play Publisher to automate the release to the alpha channels by using the Gradle wrapper command line.

Each of the two flavours corresponds to a different developer account on Google Play.

The issue that I'm facing now, is that the Play Publisher plugin only takes one Google Play configuration ( service account + auth key ).

I'm not particularly familiarised with Gradle, but I'm guessing is flexible enough to iterate over the flavours and execute a task with a 'per-flavour' buildscript config.

Does anyone know how can I accomplish this? Maybe examples of other projects that manipulate buildscript configuration based on flavours?

Thanks in advance.

Relevant part of the build.gradle script.

android {

    ...

    productFlavors {
        flavour1 {
            applicationId 'com.example.1'
        }
        flavour2 {
            applicationId 'com.example.2'
        }
    }
}
...

play {
     serviceAccountEmail = '<SERVICE_ACCOUNT>'
     pk12File = file('<PATH_TO_KEY>')
}
SUPERCILEX
  • 3,929
  • 4
  • 32
  • 61
Robert Estivill
  • 12,369
  • 8
  • 43
  • 64

1 Answers1

0

Adding two solutions that I found in Github to work around this issue, as no official support for this feature is provided by the project developers.

Solution #1: Using environment variables

https://github.com/Triple-T/gradle-play-publisher/issues/65

Solution #2: Using Gradle Task and custom config files

https://github.com/Triple-T/gradle-play-publisher/issues/76#issuecomment-121756953

You can follow the complete discussion here:

https://github.com/Triple-T/gradle-play-publisher/issues/76

Robert Estivill
  • 12,369
  • 8
  • 43
  • 64