Skip to content

Commit 1222be3

Browse files
committed
Fixed apk output name formatting by moving version to end of string
1 parent 4709476 commit 1222be3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pythonforandroid/toolchain.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
from pythonforandroid.util import BuildInterruptingException
1616
from pythonforandroid.entrypoints import main
1717

18-
1918
def check_python_dependencies():
2019
# Check if the Python requirements are installed. This appears
2120
# before the imports because otherwise they're imported elsewhere.
@@ -101,6 +100,7 @@ def check_python_dependencies():
101100
toolchain_dir = dirname(__file__)
102101
sys.path.insert(0, join(toolchain_dir, "tools", "external"))
103102

103+
APK_SUFFIX = '.apk'
104104

105105
def add_boolean_option(parser, names, no_names=None,
106106
default=True, dest=None, description=None):
@@ -1064,9 +1064,9 @@ def apk(self, args):
10641064
info_main('# Found APK file: {}'.format(apk_file))
10651065
if apk_add_version:
10661066
info('# Add version number to APK')
1067-
apk_name, apk_suffix = basename(apk_file).split("-", 1)
1067+
apk_name = basename(apk_file)[:-len(APK_SUFFIX)]
10681068
apk_file_dest = "{}-{}-{}".format(
1069-
apk_name, build_args.version, apk_suffix)
1069+
apk_name, build_args.version, APK_SUFFIX)
10701070
info('# APK renamed to {}'.format(apk_file_dest))
10711071
shprint(sh.cp, apk_file, apk_file_dest)
10721072
else:

0 commit comments

Comments
 (0)