Gradle-play-publisher: Skip processing metadata on repo PRs

Created on 3 Jun 2019  路  7Comments  路  Source: Triple-T/gradle-play-publisher

Describe the bug

When using this plugin in our repository, we found that the task processReleaseMetadata is running on regular debug builds and PRs, so as we don't provide keystore and service account on debug builds, the json file doesn't exist, failing the build.

How To Reproduce

  1. Build the project in travis CI (debug), without google_play.json file.
  2. CI build failed with google_play.json not found.

Versions

  • Gradle Play Publisher: 2.2.1
  • Gradle Wrapper: 5.1.1
  • Android Gradle Plugin: 3.4.1

Tasks executed

  • assembleDebug
  • processReleaseMetadata

Expected behavior

We want to run this task on releases only, so there should be a way to skip this processReleaseMetadata task on non-release builds.

Additional context (if a crash, provide stack trace)

We're publishing releases on tagged builds.

bug

Most helpful comment

Yep, this change is intentional. The idea that if you don't have credentials, you should simply disable all of GPP. It could something like this:

play {
    isEnabled = file("google_play.json").exists()
}

All 7 comments

Yep, this change is intentional. The idea that if you don't have credentials, you should simply disable all of GPP. It could something like this:

play {
    isEnabled = file("google_play.json").exists()
}

That led me to reading this section. Thanks.

@SUPERCILEX the processReleaseMetadata task is still running on CI even though I've disabled it by default. We want to use this as our travis CI config. Is there something I'm missing?

You haven't disabled it: you set enabled = true which is the default. As per my above comment, this should work:

play {
    enabled = rootProject.file('google_play.json').exists()
}

Thanks again for the fast reply, the CI build is now passing.

@SUPERCILEX 1 more question - the publishRelease task is successful, but I cannot see any changes in the Play store page. The page's still on the previous release. What do you suggest to do? Do we need to create a new, updated service account?

My guess is that the app was published as a rollout release due to this line. If you just remove it or change the value to completed you should be good.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

SUPERCILEX picture SUPERCILEX  路  6Comments

emartynov picture emartynov  路  4Comments

theunreal picture theunreal  路  3Comments

siddharthkhindri picture siddharthkhindri  路  5Comments

ToxicBakery picture ToxicBakery  路  4Comments