Merge pull request #700 from rammie/fix-662

Changes how is_gradle_build is detected.
This commit is contained in:
Mathieu Virbel 2018-08-21 12:03:56 +02:00 committed by GitHub
commit 36ea4ba265
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -34,6 +34,7 @@ from shutil import copyfile
from glob import glob
from buildozer.libs.version import parse
from distutils.version import LooseVersion
class TargetAndroid(Target):
@ -797,10 +798,13 @@ class TargetAndroid(Target):
# maybe the hook fail because the apk is not
pass
# XXX found how the apk name is really built from the title
build_tools_versions = os.listdir(join(self.android_sdk_dir, "build-tools"))
build_tools_versions = sorted(build_tools_versions, key=LooseVersion)
build_tools_version = build_tools_versions[-1]
gradle_files = ["build.gradle", "gradle", "gradlew"]
is_gradle_build = any((
exists(join(dist_dir, x)) for x in gradle_files))
is_gradle_build = build_tools_version >= "25.0" and any(
(exists(join(dist_dir, x)) for x in gradle_files))
if is_gradle_build:
# on gradle build, the apk use the package name, and have no version
packagename = config.get('app', 'package.name')