Closed markosopcic closed 1 year ago
My gradle knowledge is pretty bad, so I appreciate this PR a lot. Thank you.
For F-Droid, I'm currently telling people to run this sed
(https://ntfy.sh/docs/develop/#build-f-droid-flavor-no-fcm):
# Remove Google dependencies (FCM)
sed -i -e '/google-services/d' build.gradle
sed -i -e '/google-services/d' app/build.gradle
# To build an unsigned .apk (app/build/outputs/apk/fdroid/*.apk)
./gradlew assembleFdroidRelease
# To build a bundle .aab (app/fdroid/release/*.aab)
./gradlew bundleFdroidRelease
Would this PR make that obsolete? This sed
is also used in the F-Droid build process (https://gitlab.com/fdroid/fdroiddata/-/blob/master/metadata/io.heckel.ntfy.yml#L191), which is very common there.
No problem, glad I can help!
So just to confirm what you said, I did the following:
./gradlew clean assembleFdroidRelease` to get the first APK.
On my PR version, without running the sed commands, I also ran
./gradlew clean assembleFdroidRelease
to get the second APK.
I then diff-ed them using the diff tool, and also using the Android Studio built in APK analyzer which can compare two APKs - and found no difference's at all.
So I think it's safe to say that yes, my PR would make the process of running those sed commands obsolete for someone who wants to build the fdroid
version - since both versions/processes generate the same APK down to every last bit. And the play version should stay the same since the task to process google services will stay enabled for the variants with the play
flavor.
@binwiederhier can we merge this then? 😄
Oops yes. I had the tab open for a while. I'll do it this week. I want to try it out myself first. I just did some Android build and dep-upgrade work, so this is a welcome addition.
I do have to make sure that the FDroid build doesn't break, or clean that up too.
Of course, I just wanted to follow up on this to see if you need anything else from me. As much as i've tested the f droid variant works as intended.
Thanks!
Application currently cannot be built if you do not have a google-services.json file, even the fdroid flavor which doesnt use google services. This PR disables the process GoogleServices gradle tasks which fail for all variants which aren't a part of the play flavor, e.g. the fdroid flavor.