mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-09-17 10:40:12 +02:00
dbf80ad771
This is a vestige of implementing builds from a .fdroid.yml file directly in the app's source repo. It was never fully complete and seems to not be used in any apps in fdroiddata. This makes `fdroid build --all` runs much faster since it does not need to do any git handling for apps that do not have any new builds to run.4e8e29794
948689281
a4e431080
e37be9b06
e775d330c
41 lines
1.4 KiB
Python
41 lines
1.4 KiB
Python
#!/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():
|
|
parser = argparse.ArgumentParser(usage="%(prog)s [options] [APPID[:VERCODE] [APPID[:VERCODE] ...]]")
|
|
common.setup_global_opts(parser)
|
|
parser.add_argument("appid", nargs='*', help=_("applicationId with optional versionCode in the form APPID[:VERCODE]"))
|
|
metadata.add_metadata_arguments(parser)
|
|
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():
|
|
vcs, _ignored = common.setup_vcs(app)
|
|
vcs.gotorevision('HEAD', refresh=False)
|
|
for build in app.get('Builds', []):
|
|
for lib in build.srclibs:
|
|
srclibpaths.append(common.getsrclib(lib, srclib_dir, build=build))
|
|
print('Set up srclibs:')
|
|
pprint.pprint(srclibpaths)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|