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.1k stars 340 forks source link

prevent publication of specific flavour to production. #1141

Closed chris-sloan closed 4 weeks ago

chris-sloan commented 4 weeks ago

hi, I'm pretty new to this plugin and am having some difficulty in understanding how I can configure my requirement. I've added this as a documentation request but perhaps that's not quite right, so I apologise in advance.

I have a multi flavor app, and I want to prevent a specific flavour from ever making it to production. There are various reasons for this which are probably not that relevant to this request.

Is it possible using the plugin currently? If so, how would I go about it? Thanks

productFlavors {
        red {
            applicationId "com.chris.red"
            signingConfig = signingConfigs.release
            dimension 'theme'
        }
        blue {
            applicationId "com.chris.blue"
            signingConfig = signingConfigs.release
            dimension 'theme'
        }
        green {
            applicationId "com.chris.green"
            signingConfig = signingConfigs.release
            dimension 'theme'
        }
}
play {
    track.set("internal")

    // Restrict red on production track.
}
SUPERCILEX commented 4 weeks ago

https://github.com/Triple-T/gradle-play-publisher?tab=readme-ov-file#disabling-publishing

chris-sloan commented 4 weeks ago

This will disable it completely, is how it reads to me.

I want to allow most variants to publish completely, and my restircted variant only to alpha channel say, but no further. Is that possible?

SUPERCILEX commented 4 weeks ago

Disable just that variant.

SUPERCILEX commented 4 weeks ago

Actually rereading this since you want to allow publishing up to a certain track but no further you need to write some code that works with however your build handles publishing. Basically do enabled.set(isThisTrackAllowed) and write some code to determine the boolean.