Skip to content

Commit 3d5425c

Browse files
authored
add_resources
1 parent 5b9b382 commit 3d5425c

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

pythonforandroid/toolchain.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,10 @@ def add_parser(subparsers, *args, **kwargs):
512512
'--add-asset', dest='assets',
513513
action="append", default=[],
514514
help='Put this in the assets folder in the apk.')
515+
parser_packaging.add_argument(
516+
'--add-resource', dest='resources',
517+
action="append", default=[],
518+
help='Put this in the res folder in the apk.')
515519
parser_packaging.add_argument(
516520
'--private', dest='private',
517521
help='the directory with the app source code files' +
@@ -1000,6 +1004,13 @@ def _fix_args(args):
10001004
asset_src = asset_dest = asset
10011005
# take abspath now, because build.py will be run in bootstrap dir
10021006
unknown_args += ["--asset", os.path.abspath(asset_src)+":"+asset_dest]
1007+
for resource in args.resources:
1008+
if ":" in resource:
1009+
resource_src, resource_dest = resource.split(":")
1010+
else:
1011+
resource_src = resource_dest = resource
1012+
# take abspath now, because build.py will be run in bootstrap dir
1013+
unknown_args += ["--resource", os.path.abspath(resource_src)+":"+resource_dest]
10031014
for i, arg in enumerate(unknown_args):
10041015
argx = arg.split('=')
10051016
if argx[0] in fix_args:

0 commit comments

Comments
 (0)