Skip to content

Commit

Permalink
Added option to support custom shared libraries with <uses-library> tag
Browse files Browse the repository at this point in the history
Minor refactor of list defaults in build.py
  • Loading branch information
pax0r committed Feb 8, 2019
1 parent 9409cf7 commit 3cb84f7
Showing 1 changed file with 5 additions and 17 deletions.
22 changes: 5 additions & 17 deletions pythonforandroid/bootstraps/common/build/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -590,16 +590,16 @@ def parse_args(args=None):
ap.add_argument('--launcher', dest='launcher', action='store_true',
help=('Provide this argument to build a multi-app '
'launcher, rather than a single app.'))
ap.add_argument('--permission', dest='permissions', action='append',
ap.add_argument('--permission', dest='permissions', action='append', default=[],
help='The permissions to give this app.', nargs='+')
ap.add_argument('--meta-data', dest='meta_data', action='append',
ap.add_argument('--meta-data', dest='meta_data', action='append', default=[],
help='Custom key=value to add in application metadata')
ap.add_argument('--uses-library', dest='android_used_libs', action='append',
ap.add_argument('--uses-library', dest='android_used_libs', action='append', default=[],
help='Used shared libraries included using <uses-library> tag in AndroidManifest.xml')
ap.add_argument('--icon', dest='icon',
help=('A png file to use as the icon for '
'the application.'))
ap.add_argument('--service', dest='services', action='append',
ap.add_argument('--service', dest='services', action='append', default=[],
help='Declare a new service entrypoint: '
'NAME:PATH_TO_PY[:foreground]')
if get_bootstrap_name() != "service_only":
Expand Down Expand Up @@ -742,21 +742,9 @@ def _read_configuration():
'deprecated and does nothing.')
args.sdk_version = -1 # ensure it is not used

if args.permissions is None:
args.permissions = []
elif args.permissions:
if isinstance(args.permissions[0], list):
if args.permissions and isinstance(args.permissions[0], list):
args.permissions = [p for perm in args.permissions for p in perm]

if args.meta_data is None:
args.meta_data = []

if args.android_used_libs is None:
args.android_used_libs = []

if args.services is None:
args.services = []

if args.try_system_python_compile:
# Hardcoding python2.7 is okay for now, as python3 skips the
# compilation anyway
Expand Down

0 comments on commit 3cb84f7

Please sign in to comment.