Skip to content

Commit

Permalink
Merge branch 'adding-more-assets' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Pfeiffer committed Apr 27, 2020
2 parents 223aa27 + e5aff0c commit ab1be3f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion pythonforandroid/bootstraps/common/build/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ def parse_args_and_make_package(args=None):
help='Used shared libraries included using <uses-library> tag in AndroidManifest.xml')
ap.add_argument('--asset', dest='assets',
action="append", default=[],
metavar="/path/to/source:dest"
metavar="/path/to/source:dest",
help='Put this in the assets folder at assets/dest')
ap.add_argument('--icon', dest='icon',
help=('A png file to use as the icon for '
Expand Down
17 changes: 9 additions & 8 deletions pythonforandroid/toolchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ def add_parser(subparsers, *args, **kwargs):
# However, it is also needed before the distribution is finally
# assembled for locating the setup.py / other build systems, which
# is why we also add it here:
parser_packaging.add_argument(
parser_packaging.add_argument(
'--add-asset', dest='assets',
action="append", default=[],
help='Put this in the assets folder in the apk.')
Expand Down Expand Up @@ -593,13 +593,6 @@ def add_parser(subparsers, *args, **kwargs):
args.unknown_args += ["--private", args.private]
if hasattr(args, "build_mode") and args.build_mode == "release":
args.unknown_args += ["--release"]
for asset in args.assets:
if ":" in asset:
asset_src, asset_dest = asset.split(":")
else:
asset_src = asset_dest = asset
# take abspath now, because build.py will be run in bootstrap dir
args.unknown_args += ["--asset", os.path.abspath(asset_src)+":"+asset_dest]
if hasattr(args, "ignore_setup_py") and args.ignore_setup_py:
args.use_setup_py = False

Expand Down Expand Up @@ -960,6 +953,14 @@ def _fix_args(args):
fix_args = ('--dir', '--private', '--add-jar', '--add-source',
'--whitelist', '--blacklist', '--presplash', '--icon')
unknown_args = args.unknown_args

for asset in args.assets:
if ":" in asset:
asset_src, asset_dest = asset.split(":")
else:
asset_src = asset_dest = asset
# take abspath now, because build.py will be run in bootstrap dir
unknown_args += ["--asset", os.path.abspath(asset_src)+":"+asset_dest]
for i, arg in enumerate(unknown_args):
argx = arg.split('=')
if argx[0] in fix_args:
Expand Down

0 comments on commit ab1be3f

Please sign in to comment.