Fix location of metadata for F-Droid
See https://gitlab.com/fdroid/fdroiddata/-/issues/3210
It should pick up the location relative to the subdir directory. But it could be limited to the app build.
A quick fix could be to change the ´fdroiddata´ config to create a link to the fastlane folder ln -s app-k9mail/fastlane fastlane (not tested).
There are other apps using the same approach, but I checked and they are also broken.
A consequence of this not working is to have two distinct repositories for K9-Mail and Thunderbird
Compatible locations are listed here: https://gitlab.com/-/snippets/1895688#locations
Using /metadata/<packageName>/<locale> should work for having multiple apps in one repo.
Edit: I'm assuming packageName means application ID.
https://gitlab.com/-/snippets/1895688#locations is not an official documentation and from fastlane docs, I don't see how that would work. But /metadata/<packageName>/<locale> is the data structure used for fdroiddata so maybe it also works in other repositories.
Okay, it seems like /metadata/<packageName>/<locale> is supported: source. I'll go with that.
With the change to /metadata/<packageName>/ structure it is possible to move the whole metadata into a submodule to not polute the repository with screenshots. This is even more needed when we're going to add the thunderbird app and it's variations.
Are you sure /metadata/<packageName>/ in the app repository is working? The way I read the Python code it doesn't. It looks like /metadata/<packageName>/ is only there to support the data from the fdroiddata repository.
I tested it and it works because of the os.walk, but I guess that this is not how it is supposed to work.
The issue for us is, that fdroid update does not use the subdir property to search for the metadata. Which prevents us from having multiple apps in the same repository. I created a second app to validate the behaviour and found other issues.
The easiest solution is to create a symbolic link to place the metadata where fdroidserver expects it. I'm about to modify the fix to allow that and also the move of the metadata to another repository.
Apparently our current solution doesn't work due to the way F-Droid builds its index: https://gitlab.com/fdroid/fdroiddata/-/merge_requests/14815#note_1849173016
I suggest for now we update our realease instructions to manually add a symlink to the appropriate metadata directory and commit that change when doing a release.
The symlink approach works with our new automation setup.