new helpers: get_output_extension() & get_release_apk_filename()

This also moves to the standard var names: appid & versionCode
This commit is contained in:
Hans-Christoph Steiner 2024-06-06 18:17:54 +02:00
parent 8b52740636
commit b933043ca1
2 changed files with 14 additions and 7 deletions

View file

@ -1126,13 +1126,23 @@ def apk_parse_release_filename(apkname):
return None, None, None
def get_output_extension(build):
if build.output:
return get_file_extension(replace_build_vars(build.output, build))
return 'apk'
def get_release_apk_filename(appid, versionCode):
return f"{appid}_{versionCode}.apk"
def get_release_filename(app, build, extension=None):
if extension:
return "%s_%s.%s" % (app.id, build.versionCode, extension)
if build.output and get_file_extension(build.output):
return "%s_%s.%s" % (app.id, build.versionCode, get_file_extension(build.output))
else:
return "%s_%s.apk" % (app.id, build.versionCode)
return get_release_apk_filename(app.id, build.versionCode)
def get_toolsversion_logname(app, build):