mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-14 15:02:51 +03:00
scanner: always setup JSON data structure so functions work as API
This commit is contained in:
parent
84f225f2f2
commit
2f5d780c49
1 changed files with 5 additions and 4 deletions
|
@ -34,7 +34,8 @@ from .exception import BuildException, VCSException
|
||||||
config = None
|
config = None
|
||||||
options = None
|
options = None
|
||||||
|
|
||||||
json_per_build = None
|
DEFAULT_JSON_PER_BUILD = {'errors': [], 'warnings': [], 'infos': []}
|
||||||
|
json_per_build = DEFAULT_JSON_PER_BUILD
|
||||||
|
|
||||||
|
|
||||||
def get_gradle_compile_commands(build):
|
def get_gradle_compile_commands(build):
|
||||||
|
@ -338,7 +339,7 @@ def main():
|
||||||
|
|
||||||
if app.Disabled and not options.force:
|
if app.Disabled and not options.force:
|
||||||
logging.info(_("Skipping {appid}: disabled").format(appid=appid))
|
logging.info(_("Skipping {appid}: disabled").format(appid=appid))
|
||||||
json_per_appid = json_per_appid['infos'].append('Skipping: disabled')
|
json_per_appid['disabled'] = json_per_build['infos'].append('Skipping: disabled')
|
||||||
continue
|
continue
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -354,7 +355,7 @@ def main():
|
||||||
else:
|
else:
|
||||||
logging.info(_("{appid}: no builds specified, running on current source state")
|
logging.info(_("{appid}: no builds specified, running on current source state")
|
||||||
.format(appid=appid))
|
.format(appid=appid))
|
||||||
json_per_build = {'errors': [], 'warnings': [], 'infos': []}
|
json_per_build = DEFAULT_JSON_PER_BUILD
|
||||||
json_per_appid['current-source-state'] = json_per_build
|
json_per_appid['current-source-state'] = json_per_build
|
||||||
count = scan_source(build_dir)
|
count = scan_source(build_dir)
|
||||||
if count > 0:
|
if count > 0:
|
||||||
|
@ -364,7 +365,7 @@ def main():
|
||||||
app.builds = []
|
app.builds = []
|
||||||
|
|
||||||
for build in app.builds:
|
for build in app.builds:
|
||||||
json_per_build = {'errors': [], 'warnings': [], 'infos': []}
|
json_per_build = DEFAULT_JSON_PER_BUILD
|
||||||
json_per_appid[build.versionCode] = json_per_build
|
json_per_appid[build.versionCode] = json_per_build
|
||||||
|
|
||||||
if build.disable and not options.force:
|
if build.disable and not options.force:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue