GitLab Commit is coming up on August 3-4. Learn how to innovate together using GitLab, the DevOps platform. Register for free:

Verified Commit 330ca231 authored by Hans-Christoph Steiner's avatar Hans-Christoph Steiner
Browse files

example plugin for fetching srclibs

This is used in _fdroiddata_'s `fdroid build` CI job, and _issuebot_.
This uses @uniqx's awesome new 'plugin' feature to create a 'fetchsrclibs`
command.  The 'fdroid build' gitlab-ci job uses --on-server, which does not
set up the srclibs.  This plugin does the missing setup.

This is moved from _fdroiddata_ where it was _tools/fdroid_fetchsrclibs.py_.
parent 03aba988
Pipeline #233413622 passed with stage
in 49 minutes and 11 seconds
#!/usr/bin/env python3
# an fdroid plugin for setting up srclibs
# The 'fdroid build' gitlab-ci job uses --on-server, which does not
# set up the srclibs. This plugin does the missing setup.
import argparse
import os
import pprint
from fdroidserver import _, common, metadata
fdroid_summary = 'prepare the srclibs for `fdroid build --on-server`'
def main():
common.config = {
'accepted_formats': 'yml',
'sdk_path': os.getenv('ANDROID_HOME'),
parser = argparse.ArgumentParser(usage="%(prog)s [options] [APPID[:VERCODE] [APPID[:VERCODE] ...]]")
parser.add_argument("appid", nargs='*', help=_("applicationId with optional versionCode in the form APPID[:VERCODE]"))
options = parser.parse_args()
common.options = options
pkgs = common.read_pkg_args(options.appid, True)
allapps = metadata.read_metadata(pkgs)
apps = common.read_app_args(options.appid, allapps, True)
srclib_dir = os.path.join('build', 'srclib')
os.makedirs(srclib_dir, exist_ok=True)
srclibpaths = []
for appid, app in apps.items():
for build in app.get('Builds', []):
for lib in build.srclibs:
srclibpaths.append(common.getsrclib(lib, srclib_dir, build=build))
print('Set up srclibs:')
if __name__ == "__main__":
......@@ -8,7 +8,7 @@ exec 1>&2
files=`git diff-index --cached HEAD 2>&1 | sed 's/^:.* //' | uniq | cut -b100-500`
if [ -z "$files" ]; then
PY_FILES="fdroid makebuildserver fdroidserver/*.py"
PY_FILES="fdroid makebuildserver fdroidserver/*.py examples/*.py"
BASH_FILES="gradlew-fdroid jenkins-build-all jenkins-setup-build-environment jenkins-test completion/bash-completion buildserver/provision-*"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment