Skip to content

Commit 3cb84f7

Browse files
committed
Added option to support custom shared libraries with <uses-library> tag
Minor refactor of list defaults in build.py
1 parent 9409cf7 commit 3cb84f7

File tree

1 file changed

+5
-17
lines changed
  • pythonforandroid/bootstraps/common/build

1 file changed

+5
-17
lines changed

pythonforandroid/bootstraps/common/build/build.py

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -590,16 +590,16 @@ def parse_args(args=None):
590590
ap.add_argument('--launcher', dest='launcher', action='store_true',
591591
help=('Provide this argument to build a multi-app '
592592
'launcher, rather than a single app.'))
593-
ap.add_argument('--permission', dest='permissions', action='append',
593+
ap.add_argument('--permission', dest='permissions', action='append', default=[],
594594
help='The permissions to give this app.', nargs='+')
595-
ap.add_argument('--meta-data', dest='meta_data', action='append',
595+
ap.add_argument('--meta-data', dest='meta_data', action='append', default=[],
596596
help='Custom key=value to add in application metadata')
597-
ap.add_argument('--uses-library', dest='android_used_libs', action='append',
597+
ap.add_argument('--uses-library', dest='android_used_libs', action='append', default=[],
598598
help='Used shared libraries included using <uses-library> tag in AndroidManifest.xml')
599599
ap.add_argument('--icon', dest='icon',
600600
help=('A png file to use as the icon for '
601601
'the application.'))
602-
ap.add_argument('--service', dest='services', action='append',
602+
ap.add_argument('--service', dest='services', action='append', default=[],
603603
help='Declare a new service entrypoint: '
604604
'NAME:PATH_TO_PY[:foreground]')
605605
if get_bootstrap_name() != "service_only":
@@ -742,21 +742,9 @@ def _read_configuration():
742742
'deprecated and does nothing.')
743743
args.sdk_version = -1 # ensure it is not used
744744

745-
if args.permissions is None:
746-
args.permissions = []
747-
elif args.permissions:
748-
if isinstance(args.permissions[0], list):
745+
if args.permissions and isinstance(args.permissions[0], list):
749746
args.permissions = [p for perm in args.permissions for p in perm]
750747

751-
if args.meta_data is None:
752-
args.meta_data = []
753-
754-
if args.android_used_libs is None:
755-
args.android_used_libs = []
756-
757-
if args.services is None:
758-
args.services = []
759-
760748
if args.try_system_python_compile:
761749
# Hardcoding python2.7 is okay for now, as python3 skips the
762750
# compilation anyway

0 commit comments

Comments
 (0)