Page MenuHomePhabricator

Create APKs with app_name, variant, flavour, version and git hash in the filename. Example: Wikipedia App-prod-release-132-cafedab.apk
Closed, InvalidPublic

Description

Situation:
When I build a new apk, "app-prod-relase.apk" was created, I don't like this general name.

I changed the /app/build.gradle so that the name is better reflecting the content.

Event Timeline

Wikinaut raised the priority of this task from to Needs Triage.
Wikinaut updated the task description. (Show Details)
Wikinaut subscribed.

Change 248699 had a related patch set uploaded (by Wikinaut):
Generate apk with app_name, variant, flavour and version number

https://gerrit.wikimedia.org/r/248699

Dbrant triaged this task as Lowest priority.Oct 26 2015, 3:35 PM
Dbrant subscribed.
Niedzielski claimed this task.

Related to T105230

Thank you for this change and attention to detail!

The reason the output is named super generically, like "app-beta-debug.apk", is that the project template generated by Android Studio calls the output "app-debug.apk" or "app-release.apk". We clearly want to follow this convention when considering build flavors so every newcomer knows _exactly_ what app-beta-debug.apk is without ever having to read documentation, tools originally designed for other projects tend to "just work", and similarly, we can more easily transition to other Android projects following this standard.

The reason for not versioning the output is that that apk may be installed via command line (e.g., adb install -r app/build/outputs/apk/app-beta-release.apk) and it's error prone to have to consider that multiple apks might exist from previous versions and accidentally installed.[0] We could version the APK only in the CI environment but we already have scripts that do that, and in general, I think it's probably more convenient to always have an expected output location when writing future scripts.

There is only one case I can think of where versioning is super useful and that's when casually sharing apks (e.g., email a designer an apk to test). Since we automatically produce alpha builds every 15 minutes or so, we don't often need to do this, and since our releases our about once every two weeks, this isn't likely to be very helpful either as more than one iteration would likely need to be shared within that time if any.

[0] Additionally, both myself and, I think, @bearND have seen Android Studio mistakenly install the wrong apk when using dynamic output names in the past.

I can simply left out the version numbers in the filename, so that the resulting names will be like Wikipedia-prod-release.apk

Let me know, if you like it then.

Change 248699 abandoned by Wikinaut:
apk filename with app_name, variant, flavour, version number, git hash

Reason:
I also added the git hash. But the fully flavoured apk filename may create problems (in the automatic tests, for example) as it solves locally for the single developer.

See discussion in Phabricator.

Therefore I abandon this change.
For those who like it: cherry-pick my code for your own wikipedia-app project.

https://gerrit.wikimedia.org/r/248699

Wikinaut renamed this task from Create APKs with app_name, variant, flavour and version in the filename. Example: Wikipedia App-prod-release-132.apk to Create APKs with app_name, variant, flavour, version and git hash in the filename. Example: Wikipedia App-prod-release-132-cafedab.apk.Oct 27 2015, 7:38 AM
Wikinaut set Security to None.

I abandoned the associated change for reasons as laid out above (change may create more problems than it solves)

Change 248699 restored by Wikinaut:
apk filename with app_name, variant, flavour, version number, git hash

Reason:
restoring in order to apply a correction

https://gerrit.wikimedia.org/r/248699

Change 248699 abandoned by Wikinaut:
apk filename with app_name, variant, flavour, version number, git hash

Reason:
Abandoned

I also added the git hash. But the fully flavoured apk filename may create problems (in the automatic tests, for example) as it solves locally for the single developer.

See discussion in Phabricator.

Therefore I abandon this change.
For those who like it: cherry-pick my code for your own wikipedia-app project.

https://gerrit.wikimedia.org/r/248699

Thanks, @Wikinaut! I really appreciate all the effort on the patch and sorry it didn't work out :( I'll be checking out your other patches soon!

@Niedzielski : ok. I coded that for myself. When you have many apk, and send them to your device, it's the hell if they all are called "app-release.apk" or so. That#s why I thought, it might of general interest that the apk name contains at least the word "Wikipedia" (or "Wikipedia-App").

As the patch is ready and working, it can be resurrected when there is later a need for it!

Change 248699 restored by Wikinaut:
apk filename with app_name, variant, flavour, version number, git hash

Reason:
reopened temporarily to supply a fix

https://gerrit.wikimedia.org/r/248699

Change 248699 abandoned by Wikinaut:
apk filename with app_name, variant, flavour, version number, git hash

Reason:
See discussion in Phabricator.

Therefore I abandoned this change.
For those who like it: cherry-pick my code for your own wikipedia-app project.

https://gerrit.wikimedia.org/r/248699