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.13k stars 341 forks source link

Ensure app id is used correctly from new variant API #948

Closed SUPERCILEX closed 3 years ago

SUPERCILEX commented 3 years ago

https://github.com/Triple-T/gradle-play-publisher/issues/876#issuecomment-834200124

SUPERCILEX commented 3 years ago

So I was able to repro this, but sadly there's no way to fix it because it's an ordering issue again. The only solution is to put an apply(plugin = "com.github.triplet.play") line and do all GPP configuration after AGP configuration has run.

Thinking about this more, it might be possible to fix it if we created a single build service that acted as a registry keyed by appId that's passed in lazily to each task. Punting this.

SUPERCILEX commented 3 years ago

Actually, I just realized we still need the appId to create the commitEdit task, so this issue still wouldn't be fixed if the build service thing was figured out. The BuildService API supposedly invokes AutoCloseable#close() when the service is no longer needed, but I don't know if that's reliable enough to move the commit edit logic from a task to that closable API in the build service.

If this issue becomes more important in the future, I'll look into the build service closable idea further.