Merge pull request #483 from kived/pkgapp-deprecated
ios: refactor deprecated PackageApplication command
This commit is contained in:
commit
7ee7150a73
1 changed files with 34 additions and 8 deletions
|
@ -222,16 +222,42 @@ class TargetIos(Target):
|
|||
elif ioscodesign[0] not in ('"', "'"):
|
||||
ioscodesign = '"{}"'.format(ioscodesign)
|
||||
|
||||
ipa = join(self.buildozer.bin_dir, '{}-{}.ipa'.format(
|
||||
intermediate_dir = join(self.ios_dir, '{}-{}.intermediates'.format(app_name, version))
|
||||
xcarchive = join(intermediate_dir, '{}-{}.xcarchive'.format(
|
||||
app_name, version))
|
||||
ipa_name = '{}-{}.ipa'.format(app_name, version)
|
||||
ipa_tmp = join(intermediate_dir, ipa_name)
|
||||
ipa = join(self.buildozer.bin_dir, ipa_name)
|
||||
build_dir = join(self.ios_dir, '{}-ios'.format(app_name.lower()))
|
||||
|
||||
self.buildozer.rmdir(intermediate_dir)
|
||||
|
||||
self.buildozer.info('Creating archive...')
|
||||
self.buildozer.cmd((
|
||||
'/usr/bin/xcrun '
|
||||
'-sdk iphoneos PackageApplication {ios_app_dir} '
|
||||
'-o {ipa} --sign {ioscodesign} --embed '
|
||||
'{ios_app_dir}/embedded.mobileprovision').format(
|
||||
ioscodesign=ioscodesign, ios_app_dir=ios_app_dir,
|
||||
mode=mode, ipa=ipa),
|
||||
cwd=self.ios_dir)
|
||||
'/usr/bin/xcodebuild'
|
||||
' -alltargets'
|
||||
' -configuration {mode}'
|
||||
' -scheme {scheme}'
|
||||
' -archivePath "{xcarchive}"'
|
||||
' archive'
|
||||
' ENABLE_BITCODE=NO'
|
||||
).format(mode=mode, xcarchive=xcarchive, scheme=app_name.lower()),
|
||||
cwd=build_dir)
|
||||
|
||||
self.buildozer.info('Creating IPA...')
|
||||
self.buildozer.cmd((
|
||||
'/usr/bin/xcodebuild'
|
||||
' -exportArchive'
|
||||
' -exportFormat IPA'
|
||||
' -archivePath "{xcarchive}"'
|
||||
' -exportPath "{ipa}"'
|
||||
' CODE_SIGN_IDENTITY={ioscodesign}'
|
||||
' ENABLE_BITCODE=NO'
|
||||
).format(xcarchive=xcarchive, ipa=ipa_tmp, ioscodesign=ioscodesign),
|
||||
cwd=build_dir)
|
||||
|
||||
self.buildozer.info('Moving IPA to bin...')
|
||||
self.buildozer.file_rename(ipa_tmp, ipa)
|
||||
|
||||
self.buildozer.info('iOS packaging done!')
|
||||
self.buildozer.info('IPA {0} available in the bin directory'.format(
|
||||
|
|
Loading…
Reference in a new issue