Support .fdroid.yml.

This commit is contained in:
Adrian Malacoda 2018-06-24 05:47:24 -05:00
parent 5d20e0585b
commit 0a157d1c01
2 changed files with 11 additions and 6 deletions

View File

@ -17,7 +17,9 @@ The `fdroiddata` is placed into `/fdroiddata`.
Should produce the `org.fdroid.fdroid` apk in `build`.
### Building in Repo
If you have a directory named `fdroid` at the root of your repository, its contents will be copied over into the `/fdroiddata/metadata` directory. Additionally, the token `%REPO` in all metadata files will be replaced with the path to the repo in the container. This is so the metadata file does not need to know the exact path the repo will live at during the build.
If you have a file named `.fdroid.yml` or `.fdroid.json` at the root of your repository, the build will be run right out of the repo using that metadata file; see [Running `fdroid build` in your app's source](https://f-droid.org/docs/Building_Applications/#running-fdroid-build-in-your-apps-source) (note that contrary to the doc, neither `.fdroid.txt` nor `.fdroid.xml` are supported anymore; thus, this image does not look for them).
Else, if you have a directory named `fdroid` at the root of your repository, its contents will be copied over into the `/fdroiddata/metadata` directory. Additionally, the token `%REPO` in all metadata files will be replaced with the path to the repo in the container. This is so the metadata file does not need to know the exact path the repo will live at during the build.
A F-Droid metadata file is named `<appId>.txt` and [looks like this](https://gitlab.com/fdroid/fdroiddata/blob/master/templates/app-full). So, if you have such a file located at `fdroid/net.monarchpass.app.txt`, you should be able to run this:

View File

@ -3,10 +3,13 @@
REPO="$(pwd)"
export PATH="/opt/gradle/bin:$PATH"
if [ -d "fdroid" ]; then
if [ ! -f ".fdroid.yml" ] && [ ! -f ".fdroid.json" ]; then
if [ -d "fdroid" ]; then
cp -Rv fdroid/* /fdroiddata/metadata;
fi
cd /fdroiddata
find ./metadata -type f -name "*.txt" -exec sed -i "s:%REPO:$REPO:g" {} +
fi
cd /fdroiddata
find ./metadata -type f -name "*.txt" -exec sed -i "s:%REPO:$REPO:g" {} +
fdroid $@
fdroid "$@"