mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-15 23:42:37 +03:00
convert metadata.Build to a subclass of dict
Like with the App class in the commit before, this makes it a lot easier to work with this data when converting between the internal formats and external formats like YAML, JSON, MsgPack, protobuf, etc. The one unfortunate thing here is Build.update. It becomes dict.update(), which is a method not an attribute. build.get('update') or build['update'] could be used, but that would be oddly inconsistent. So instead the field is renamed to 'androidupdate', except for in the .txt v0 metadata files. This better describes what field does anyway, since it runs `android update`. Build.update is only referenced in two places right next to each other for the ant builds, so this change still seems worthwhile.
This commit is contained in:
parent
b7fc7f2228
commit
c0bc3afda9
9 changed files with 450 additions and 552 deletions
|
@ -1544,15 +1544,15 @@ def prepare_source(vcs, app, build, build_dir, srclib_dir, extlib_dir, onserver=
|
|||
(app.id, build.version), p.output)
|
||||
|
||||
# Generate (or update) the ant build file, build.xml...
|
||||
if build.build_method() == 'ant' and build.update != ['no']:
|
||||
if build.build_method() == 'ant' and build.androidupdate != ['no']:
|
||||
parms = ['android', 'update', 'lib-project']
|
||||
lparms = ['android', 'update', 'project']
|
||||
|
||||
if build.target:
|
||||
parms += ['-t', build.target]
|
||||
lparms += ['-t', build.target]
|
||||
if build.update:
|
||||
update_dirs = build.update
|
||||
if build.androidupdate:
|
||||
update_dirs = build.androidupdate
|
||||
else:
|
||||
update_dirs = ant_subprojects(root_dir) + ['.']
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue