Skip to content

Firebase App Distribution Gradle Plugin is unfriendly to extension through custom plugins #4265

@sampengilly

Description

@sampengilly

I currently use the Firebase App Distribution gradle plugin to publish internal builds for a collection of apps to Firebase App Distribution. There are some challenges that I have in our environment. The main one is that the FAD gradle plugin requires service credentials to be provided as a File. Whereas the CI infrastructure that my apps run on make it difficult to store secret files, we can store secret strings easily.

Because of this, I have written a gradle plugin of my own with a task that takes the service credentials secret string and writes it to the temp build files. By configuring each UploadDistributionTask.serviceCredentialsFile with the output of my task, it ensures that my task is run before UploadDistributionTask and the credentials are available. Creating this plugin means each of my apps can apply it and get common configuration for App Distribution.

Version 3.1.0 of the App Distribution gradle plugin has just made UploadDistributionTask package-private. Which means I can no longer configure it with my written credentials filepath. The task was also not properly honouring Gradle lifecycle previously, if you simply wired the serviceCredentialsFile property up to another gradle property inside configureEach {} without doing so in an afterEvaluate block the App Distribution gradle plugin would later overwrite that.

The source code for the App Distribution gradle plugin has not been made available so I can't check the specifics of what's going on. Could I ask that the plugin be updated to better make use of Gradle's lazy configuration APIs and to be more friendly to extension from other plugins.

If UploadDistributionTask is going to remain package-private, could the AppDistributionExtension interface be updated to take Gradle Property types rather than primitives? That way custom plugin developers can wire that configuration up to the output of a task and Gradle will handle the ordering. Could the app distribution plugin also be made open source like the rest of Firebase's SDKs?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions