fix: logic to compare versions "not installed" with "contain minor"(ex: 20.0.1)
method bulldozer.targets.android.TargetAndroid._install_android_packages() If build-tools is not installed, then variable "v_build_tools" is string = '0'. If latest version contains minor version code ~ example 19.0.3 ~, then variable "ver" is list = [19, 0, 3]. In that case, build-tools is not enable to install, because expression([19, 0, 3] > '0') returns False.
This commit is contained in:
parent
312fb67be4
commit
7a6034a75e
1 changed files with 6 additions and 2 deletions
|
@ -315,6 +315,10 @@ class TargetAndroid(Target):
|
|||
version = [int(i) for i in version_string.split(".")]
|
||||
return version
|
||||
|
||||
def _build_package_string(self, package_name, version_list):
|
||||
version_string = '.'.join([str(ver) for ver in version_list])
|
||||
return '{}-{}'.format(package_name, version_string)
|
||||
|
||||
def _read_version_subdir(self, *args):
|
||||
try:
|
||||
versions = [self._process_version_string(v) for v in
|
||||
|
@ -324,7 +328,7 @@ class TargetAndroid(Target):
|
|||
except:
|
||||
self.buildozer.error(
|
||||
'Unable to find the latest version for {}'.format(join(*args)))
|
||||
return '0'
|
||||
return [0]
|
||||
|
||||
def _find_latest_package(self, packages, key):
|
||||
package_versions = []
|
||||
|
@ -355,7 +359,7 @@ class TargetAndroid(Target):
|
|||
packages = self._android_list_sdk(include_all=True)
|
||||
ver = self._find_latest_package(packages, 'build-tools-')
|
||||
if ver and ver > v_build_tools:
|
||||
self._android_update_sdk(ver)
|
||||
self._android_update_sdk(self._build_package_string('build-tools', ver))
|
||||
|
||||
# 3. finally, install the android for the current api
|
||||
android_platform = join(self.android_sdk_dir, 'platforms',
|
||||
|
|
Loading…
Reference in a new issue