more work on iOS target.
This commit is contained in:
parent
cd439458c5
commit
56d5cc490f
1 changed files with 22 additions and 5 deletions
|
@ -1,7 +1,9 @@
|
|||
'''
|
||||
iOS target, based on kivy-ios project. (not working yet.)
|
||||
'''
|
||||
|
||||
from buildozer.target import Target
|
||||
from os.path import join
|
||||
|
||||
class TargetIos(Target):
|
||||
|
||||
|
@ -13,7 +15,7 @@ class TargetIos(Target):
|
|||
checkbin('Xcode xcode-select', 'xcode-select')
|
||||
checkbin('Git git', 'git')
|
||||
|
||||
print 'Check availability of a iPhone SDK'
|
||||
self.buildozer.debug('Check availability of a iPhone SDK')
|
||||
sdk = cmd('xcodebuild -showsdks | fgrep "iphoneos" | tail -n 1 | awk \'{print $2}\'')[0]
|
||||
if not sdk:
|
||||
raise Exception(
|
||||
|
@ -21,18 +23,33 @@ class TargetIos(Target):
|
|||
else:
|
||||
print ' -> found %r' % sdk
|
||||
|
||||
print 'Check Xcode path'
|
||||
self.buildozer.debug('Check Xcode path')
|
||||
xcode = cmd('xcode-select -print-path')[0]
|
||||
if not xcode:
|
||||
raise Exception('Unable to get xcode path')
|
||||
print ' -> found %r' % xcode
|
||||
self.buildozer.debug(' -> found {0}'.format(xcode))
|
||||
|
||||
def install_platform(self):
|
||||
cmd = self.buildozer.cmd
|
||||
self.ios_dir = ios_dir = join(self.buildozer.platform_dir, 'kivy-ios')
|
||||
if not self.buildozer.file_exists(ios_dir):
|
||||
cmd('git clone git://github.com/kivy/kivy-ios',
|
||||
cwd=self.buildozer.platform_dir)
|
||||
elif self.platform_update:
|
||||
cmd('git clean -dxf', cwd=ios_dir)
|
||||
cmd('git pull origin master', cwd=ios_dir)
|
||||
|
||||
def compile_platform(self):
|
||||
self.buildozer.cmd('tools/build-all.sh', cwd=self.ios_dir)
|
||||
|
||||
def build_package(self):
|
||||
# create the project
|
||||
app_name = self.buildozer.namify(self.config.get('app', 'title'))
|
||||
|
||||
self.app_project_dir = join(self.ios_dir, 'app-{0}'.format(app_name))
|
||||
self.buildozer.cmd('tools/create-xcode-project.sh {0} {1}'.format(
|
||||
app_name, self.buildozer.app_dir),
|
||||
cwd=self.ios_dir)
|
||||
|
||||
|
||||
def get_target(buildozer):
|
||||
|
|
Loading…
Reference in a new issue