Allow google plugins in the build.gradle file for non-free builds
It would be nice if it was possible to have a single build.gradle file which could be built by F-droid as well as include proprietary plugins by google.
Some API's from Google require that you include a plugin in your build.gradle file - like:
apply plugin: 'com.google.gms.google-services'
However, this obviously breaks the compilation on the F-Droid build. I tried expanding the gradle file to something along these lines:
task nonfreeReleaseTask << {
apply plugin: 'com.google.gms.google-services'
}
tasks.whenTaskAdded { task ->
if (task.name != 'free') {
task.dependsOn nonfreeReleaseTask
}
}
The intention was to only use the plugin if a non-free flavor of the app was built, but it didn't seem to work. My F-Droid build still failed. Currently the only solutions seems to be to manually and and remove the line as needed, which is a pretty horrible solution.
Would it be possible to fix this issue without compromising the F-Droid build process?