Closed blazsolar closed 4 years ago
Resolved it by reading documentation all the way through. 😄
Resolved it by reading documentation all the way through. 😄
On our build server I use an environment variable ANDROID_PUBLISHER_CREDENTIALS
, and therefore do not specify serviceAccountCredentials
in the gradle file. But in this case all gradle tasks fails when run locally.
Can you be a bit more specific about how you fixed it?
----- EDIT ----- OK, I fixed this by enabling the publisher task using an environment variable only present on the build server.
play { enabled.set(System.getenv("CI") == "true") }
What i did was set
play {
isEnabled = false
}
and then added also
android {
playConfigs {
register("<flavourName>") {
isEnabled = project.hasProperty("<gradle_properties_key_for_play_credewntials>")
}
}
}
and since <gradle_properties_key_for_play_credewntials>
is only set on CI, it works as expected.
Describe the bug
At the moment credentials are validated at the configuration phase of the project. Problem is that one may not want to have
serviceAccountCredentials
file accessible to everyone and will therefore not be set every time. For example, you don't want to have the file shared among the development team and just have it accessible on CI. Why is this validation not done when credentials actually need to be used?How To Reproduce
Don't set
play.serviceAccountCredentials
property and run./gradlew tasks
. Tasks task has nothing to do with this plugin but it will still fail.Versions
Expected behavior
The plugin should validate credentials when they are needed and not at configuration time.