Merge pull request #318 from kived/custom-kivy-ios

support using custom kivy-ios source dir
This commit is contained in:
Akshay Arora 2016-05-07 22:28:34 +05:30
commit 9a43b20f05
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('mkdir -p "{}"'.format(ios_dir))
cmd('cp -r "{}"/* "{}"/'.format(custom_kivy_ios, ios_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('cp -r "{}"/* "{}"/'.format(custom_kivy_ios, ios_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)