add support for using custom kivy-ios source

This commit is contained in:
Ryan Pessa 2016-04-16 19:21:13 -05:00
parent 442fda7a73
commit 874dbe3fa5
2 changed files with 17 additions and 4 deletions

View file

@ -160,6 +160,9 @@ fullscreen = 1
# iOS specific # iOS specific
# #
# (str) Path to a custom kivy-ios folder
#ios.kivy_ios_dir = ../kivy-ios
# (str) Name of the certificate to use for signing the debug version # (str) Name of the certificate to use for signing the debug version
# Get a list of available identities: buildozer ios list_identities # Get a list of available identities: buildozer ios list_identities
#ios.codesign.debug = "iPhone Developer: <lastname> <firstname> (<hexstring>)" #ios.codesign.debug = "iPhone Developer: <lastname> <firstname> (<hexstring>)"

View file

@ -92,10 +92,20 @@ class TargetIos(Target):
def install_platform(self): def install_platform(self):
cmd = self.buildozer.cmd cmd = self.buildozer.cmd
self.ios_dir = ios_dir = join(self.buildozer.platform_dir, 'kivy-ios') self.ios_dir = ios_dir = join(self.buildozer.platform_dir, 'kivy-ios')
custom_kivy_ios = self.buildozer.config.getdefault('app', 'ios.kivy_ios_dir')
if custom_kivy_ios:
custom_kivy_ios = join(self.buildozer.root_dir, custom_kivy_ios)
if not self.buildozer.file_exists(ios_dir): if not self.buildozer.file_exists(ios_dir):
if custom_kivy_ios:
cmd('cp -r "{}" .'.format(custom_kivy_ios), cwd=self.buildozer.platform_dir)
else:
cmd('git clone https://github.com/kivy/kivy-ios', cmd('git clone https://github.com/kivy/kivy-ios',
cwd=self.buildozer.platform_dir) cwd=self.buildozer.platform_dir)
elif self.platform_update: elif self.platform_update:
if custom_kivy_ios:
cmd('rm -rf "{}"'.format(ios_dir))
cmd('cp -r "{}" .'.format(custom_kivy_ios), cwd=self.buildozer.platform_dir)
else:
cmd('git clean -dxf', cwd=ios_dir) cmd('git clean -dxf', cwd=ios_dir)
cmd('git pull origin master', cwd=ios_dir) cmd('git pull origin master', cwd=ios_dir)