separate build per android.arch

This prevent using the same build (armv7a) when building another arch using profile (arm64-v8a)
This commit is contained in:
Mathieu Virbel 2019-08-30 18:05:12 +02:00 committed by Mathieu Virbel
parent 182d13f102
commit 8d4ad8b60f

View file

@ -65,7 +65,10 @@ class TargetAndroid(Target):
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
super(TargetAndroid, self).__init__(*args, **kwargs) super(TargetAndroid, self).__init__(*args, **kwargs)
self._build_dir = join(self.buildozer.platform_dir, 'build') self._arch = self.buildozer.config.getdefault(
'app', 'android.arch', "armeabi-v7a")
self._build_dir = join(
self.buildozer.platform_dir, 'build-{}'.format(self._arch))
executable = sys.executable or 'python' executable = sys.executable or 'python'
self._p4a_cmd = '{} -m pythonforandroid.toolchain '.format(executable) self._p4a_cmd = '{} -m pythonforandroid.toolchain '.format(executable)
self._p4a_bootstrap = self.buildozer.config.getdefault( self._p4a_bootstrap = self.buildozer.config.getdefault(
@ -775,7 +778,7 @@ class TargetAndroid(Target):
("create --dist_name={} --bootstrap={} --requirements={} " ("create --dist_name={} --bootstrap={} --requirements={} "
"--arch {} {}").format( "--arch {} {}").format(
dist_name, self._p4a_bootstrap, requirements, dist_name, self._p4a_bootstrap, requirements,
config.getdefault('app', 'android.arch', "armeabi-v7a"), " ".join(options)), self._arch, " ".join(options)),
get_stdout=True)[0] get_stdout=True)[0]
def get_available_packages(self): def get_available_packages(self):
@ -860,7 +863,7 @@ class TargetAndroid(Target):
cmd.append(gradle_dependency) cmd.append(gradle_dependency)
cmd.append('--arch') cmd.append('--arch')
cmd.append(self.buildozer.config.getdefault('app', 'android.arch', "armeabi-v7a")) cmd.append(self._arch)
cmd = " ".join(cmd) cmd = " ".join(cmd)
self._p4a(cmd) self._p4a(cmd)