Build block for srclibs
The idea behind
Some thoughts that came together:
- some
srclib
s need to build something, e.g. an.aar
file- currently these build "recipes" are located in the app metadata
- sometimes these artifacts are build multiple times if multiple apps need them
- sometimes different versions of
srclib
s need to be treated differently- e.g. VLC already has multiple
srclib.yml
files
- e.g. VLC already has multiple
Pro and Con
Pro
- if there is something to build it dosn't have to build twice → saves build server time
- a place for
scanignore
/scandelete
→ #784
Con
- Cost of developer time
Proposed format
Pretty much like app metadata, but without versionName
, versionCode
etc.
Regarding updates I would suggest updating them manually, so no AutoUpdateMode
etc.
There should be one entry in Builds
that has default: true
and will be used when the wanted version (the thing behind the '@') is not an entry in the Builds
block.
Artifacts
Handling these is an important point; here are some options:
# srclib.yml
Builds:
- artifacts: true
This will keep the whole cloned (and prepared) repository. Usage in app metadata as usual.
# srclib.yml
Builds:
- artifacts: false
This will not keep any files. The srclib
will be cloned, prepared etc. every time needed. Usage in app metadata as usual again.
# srclib.yml
Builds:
- artifacts:
- directory
- file.txt
- directory/subdir/file1.txt
This will keep the specified files. They can be accessed in the app metadata with $$srclib$$[i]
where i
is the index of artifacts
array. [This will require a lookup for the actual order in srclib.yml
in the implementation.]
Example
fdroid_fdroidserver.yml
RepoType: git
Repo: https://gitlab.com/fdroid/fdroidserver.git
Builds:
- commit: ea9f917ddc95bf766320229fa2cc36db0cfc850a
build:
- echo "Some command …"
- echo "… and another command."
artifacts:
- abc
- abc/def/ghi.aar
- default: true
rm: README.md
Proposed Workflow
Could happen at that time a Prepare
would.
graph TD
START["An app requires srclib aprilfools@1337."]
START --> QBUILT(["Has version '1337' already been prepared/built?"])
QBUILT -->|Yes.|BUILTYES("Pull the artifact(s) in and use them!")
QBUILT -->|No.|BUILTNO("Prepare/build this version of the srclib!")
BUILTNO --> QINBUILDS(["Is version '1337' in 'Builds'?"])
QINBUILDS --> |Yes.|INBUILDSYES("Use their build block!")
QINBUILDS --> |No.|INBUILDSNO("Use the 'default' block!")
INBUILDSYES --> END("Build or prepare the srclib!")
INBUILDSNO --> END
Open points
- Where to save the artifacts? Similar to unsigned apks?
- Garbage collections for those that were not used for a while?
- Lint for
srclib.yml
files? - What about the "old" format?
Feel free to add some more!