Skip to content

Commit

Permalink
fixed output path in _finish_package
Browse files Browse the repository at this point in the history
  • Loading branch information
zworkb committed Apr 1, 2020
1 parent b711b47 commit 8d51362
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 41 deletions.
2 changes: 1 addition & 1 deletion pythonforandroid/recipes/openssl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class OpenSSLRecipe(Recipe):
version = '1.1'
'''the major minor version used to link our recipes'''

url_version = '1.1.1'
url_version = '1.1.1f'
'''the version used to download our libraries'''

url = 'https://www.openssl.org/source/openssl-{url_version}.tar.gz'
Expand Down
80 changes: 40 additions & 40 deletions pythonforandroid/toolchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -1043,48 +1043,48 @@ def _finish_package(self, args, output, build_args, package_type, output_dir):
:param output_dir: where to put the package file
"""

with current_directory(self._dist.dist_dir):
package_glob = "*-{}.%s" % package_type
package_add_version = True

self.hook("after_apk_assemble")

info_main('# Copying android package to current directory')

package_re = re.compile(r'.*Package: (.*\.apk)$')
package_file = None
for line in reversed(output.splitlines()):
m = package_re.match(line)
if m:
package_file = m.groups()[0]
package_glob = "*-{}.%s" % package_type
package_add_version = True

self.hook("after_apk_assemble")

info_main('# Copying android package to current directory')

package_re = re.compile(r'.*Package: (.*\.apk)$')
package_file = None
for line in reversed(output.splitlines()):
m = package_re.match(line)
if m:
package_file = m.groups()[0]
break
if not package_file:
info_main('# Android package filename not found in build output. Guessing...')
if args.build_mode == "release":
suffixes = ("release", "release-unsigned")
else:
suffixes = ("debug", )
for suffix in suffixes:

package_files = glob.glob(join(output_dir, package_glob.format(suffix)))
if package_files:
if len(package_files) > 1:
info('More than one built APK found... guessing you '
'just built {}'.format(package_files[-1]))
package_file = package_files[-1]
break
if not package_file:
info_main('# Android package filename not found in build output. Guessing...')
if args.build_mode == "release":
suffixes = ("release", "release-unsigned")
else:
suffixes = ("debug", )
for suffix in suffixes:
package_files = glob.glob(join(output_dir, package_glob.format(suffix)))
if package_files:
if len(package_files) > 1:
info('More than one built APK found... guessing you '
'just built {}'.format(package_files[-1]))
package_file = package_files[-1]
break
else:
raise BuildInterruptingException('Couldn\'t find the built APK')

info_main('# Found android package file: {}'.format(package_file))
if package_add_version:
info('# Add version number to android package')
package_name = basename(package_file)[:-len(APK_SUFFIX)]
package_file_dest = "{}-{}-{}".format(
package_name, build_args.version, APK_SUFFIX)
info('# Android package renamed to {}'.format(package_file_dest))
shprint(sh.cp, package_file, package_file_dest)
else:
shprint(sh.cp, package_file, './')
raise BuildInterruptingException('Couldn\'t find the built APK')

info_main('# Found android package file: {}'.format(package_file))
if package_add_version:
info('# Add version number to android package')
package_name = basename(package_file)[:-len(APK_SUFFIX)]
package_file_dest = "{}-{}-{}".format(
package_name, build_args.version, APK_SUFFIX)
info('# Android package renamed to {}'.format(package_file_dest))
shprint(sh.cp, package_file, package_file_dest)
else:
shprint(sh.cp, package_file, './')

@require_prebuilt_dist
def apk(self, args):
Expand Down

0 comments on commit 8d51362

Please sign in to comment.