Swift 5.1 Migration
This article will go through recent changes in Zapp iOS SDK 13.0 and up made for the Swift 5.1 migration. For the full SDK 13.0 changelog go here.
Internal Applicaster Plugin Migration
Internal plugins should follow these instructions in order to update the creation of a closed framework.
Install Xcode 11.2.1 and Cocoapods v1.7.5 using the following command:
sudo gem install cocoapods -v "=1.7.5"
Upgrade the following gems inside the Gemfile:
gem 'xcpretty' gem 'cocoapods', '= 1.7.5' gem 'fastlane'
Update the Gemfile.lock by running
bundle install
in your main plugin directory.Note: If the
bundle install
command is not working for you, make sure that the active developer directory is set to the right location. This directory controls which tools are used for the Xcode command line tools (for example, xcodebuild) as well as the BSD development commands (such as cc and make). You can switch the Xcode main environments by setting the following command:sudo xcode-select -switch /Applications/<name_of_your_xcode>.app
for example:
sudo xcode-select -switch /Applications/Xcode11.2.1.app
Go to circle-ci confog.yml file and change the following:
- Change the Xcode version to 11.2.1
- Change the deploy version to 0.10.0
Update
Ruby - set version
run step from ruby v2.4 to ruby v2.5 as follows:echo "ruby-2.4" > ~/.ruby-version
Should changed to:
echo "ruby-2.5" > ~/.ruby-version
Increment the caching keys to a new version, for example:
KanCentralizedViewsPlugin-v3-{<other_values>}
Should changed to:
KanCentralizedViewsPlugin-v4-{<other_values>}.
- Make sure that all caching key’s have the same prefix name.
- Cache the pod directory by adding to circle script the following
Restore Pods cache
andsave_cache
caching phases (check Zapp-iOS project as an example):
- Update your podspec dependencies to support swift 5.1, please check the following:
- Make sure you also update the podspec files located inside the /Podspec-templates directory.
- Inside all relevant podspec files, make sure that the s.xcconfig.'SWIFT_VERSION' value is set to 5.1.
- Update all dependencies to support swift 5.1 specs.
- Update the swift version inside the .swift-version file.
- Update podfile structure according to the following steps:
- dependencies to support swift 5.1 specs.
- Use the new cocoapods CDN source:
- Remove
source 'git@github.com:CocoaPods/Specs.git'
. - Add the new CDN
source 'https://cdn.cocoapods.org/'
(If you have private specs, add the new source below all of the other sources). - Run
pod update
.
- Remove
- Open the workspace with Xcode 11.2.1.
- For each one of the product targets make sure there isn't an override swift version (search for
Swift Language Version
inside each of the targets build settings and make sure the text is not in bold. They should show Swift 5.1. - Build the framework in Xcode. Make sure the framework compiles with no warning or errors generated by the framework itself. Dependencies might create warnings that are out of our control.
- Increment the plist framework version to a major change version notion. For the record, Applicaster uses semantic versioning in the form of
Major.Minor.Patch
. - Push your code with GIT and make sure circle-ci build process ended successfully.
- Verify that a new podspec file was created inside Applicaster's private CocoaPods-Private or public CocoaPods repositories.
- Create updated manifest file and upload it to Zapp after successfully passing circle ci.
- Notes:
- Set a minimum supported sdk:
"min_zapp_sdk": "13.0.0-Dev"
- The version of the manifest should correlate to the podspec major version change notion.
- Set a minimum supported sdk:
- Notes:
3rd Party Plugins Migration
The following instructions are for 3th party developers that are not using the applicaster closed frameworks logic.
- Install Xcode 11.2.1 and Cocoapods v1.7.5 using the following command:
sudo gem install cocoapods -v "=1.7.5"
- Update podspec dependencies to support swift 5.1.
- Inside each podspec file, make sure that the s.xcconfig.'SWIFT_VERSION' value is set to 5.1.
- Update all dependencies to support swift 5.1 specs.
- Increment the podspec to a major change version notion in the specs directory. For the record, Applicaster uses semantic versioning in the form of
Major.Minor.Patch
. - Create an empty Xcode test project (or update existing) with Xcode 11.2.1 and a new podfile that points to your upgraded podspec file.
- Update podfile structure according to the following steps:
- Set your dependencies to support swift 5.1 specs.
- Use the new cocoapods CDN source:
- Remove
source 'git@github.com:CocoaPods/Specs.git'
. - Add the new CDN
source 'https://cdn.cocoapods.org/'
(If you have private specs, add the new source below all of the other sources). - Run
pod update
.
- Remove
- Update the podfile dependencies to support swift 5.1 specs.
- For each one of the product targets make sure there isn't an override swift version (search for
Swift Language Version
inside each of the targets build settings and make sure the text is not in bold. They should show Swift 5.1`. - Push your code to main branch and tag it.
- Add a new git tag respectively to the new podspec version.
- Create updated manifest file and upload it to Zapp.
- Notes:
* Set a minimum supported sdk: `"min_zapp_sdk": "13.0.0-Dev"` * The version of the manifest should correlate to the podspec major version change notion.
- Notes: