Swift 5.0 Migration

This article will go through recent changes in Zapp iOS SDK 12.0 and up made for the swift 5.0 migration. For the full SDK 12.0 changelog go here.

  1. Upgrade from Cocoapods 1.5.3 to 1.7.5.
  2. Use the new cocoapods CDN source and cache public repositories - CocoaPods is moving to use a CDN which is located at https://cdn.cocoapods.org/ and is still considered experimental. A future release will make it the default spec source. A CDN is a Content Delivery Network - what this means for CocoaPods is that using CocoaPods won't require you to have a local copy of all the public Podspecs on your computer. Saving you about a GB of file storage, and shaving a lot of time off pod install's. In addition, the new cocoapod repository directory is now cached in order to save continuous integration build time by adding ~/.cocoapods/repos/cocoapods- to the circle-ci caching phase scripts. For more information check the Cocoapods blog.
  3. The fastlane version was updated to 2.128.1. This update also means the fastlane build scripts were updated accordingly.
  4. The build scripts were updated to create a combined Framework-Swift.h file. This behavior was added to the build scripts used for all of Applicaster's internal SDKS. Building a framework containing Swift code using lipo in order to create a binary that supports both devices and simulators now must include this combined generated header. For more information Click here to read more about the necessary change in the Xcode 10.2 release notes.

Internal Applicaster Plugin Migration

Internal plugins should follow these instructions in order to update the creation of a closed framework.

  1. Install xcode 10.2.1 and cocoapods version 1.7.5 using the following command:

     sudo gem install cocoapods -v "=1.7.5"
    
  2. Upgrade the following gems inside the Gemfile:

     gem 'xcpretty'
     gem 'cocoapods', '= 1.7.5'
     gem 'fastlane', '= 2.128.1'
    
  3. Update the Gemfile.lock by running bundle install in your main plugin directory.

  4. Go to circle-ci confog.yml file and change the following:

    • Change the xcode version to 10.2.1
    • Change the deploy version to 0.8.11
    • Increment the caching key 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 and save_cache caching phases (check Zapp-iOS project as an example):
  5. Update podspec dependencies to support swift 5.0, please check the following:
    • Make sure you also update the podspec files located inside the /Podspec-templates directory.
    • Inside each podspec file, make sure that the s.xcconfig.'SWIFT_VERSION' value is set to 5.0.
    • Update all dependencies to support swift 5.0 specs.
  6. Update the swift version inside the .swift-version file.
  7. Update podfile structure according to the following steps:
    • dependencies to support swift 5.0 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.
  8. Open the workspace with Xcode 10.2.1.
  9. 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.
  10. 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.
  11. 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.
  12. Push your code with GIT and make sure circle-ci build process ended successfully.
  13. Verify that a new podspec file was created inside Applicaster's private CocoaPods-Private or public CocoaPods repositories.
  14. Create updated manifest file and upload it to Zapp after successfully passing circle ci.

3rd Party Plugins Migration

The following instructions are for 3th party developers that are not using the applicaster closed frameworks logic.

  1. Install xcode 10.2.1 and cocoapods version 1.7.5 using the following command:
     sudo gem install cocoapods -v "=1.7.5"
    
  2. Update podspec dependencies to support swift 5.0.
    • Inside each podspec file, make sure that the s.xcconfig.'SWIFT_VERSION' value is set to 5.0.
    • Update all dependencies to support swift 5.0 specs.
  3. 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.
  4. Create an empty xcode test project (or update existing) with xocde 10.2.1 and a new podfile that points to your upgraded podspec file.
  5. Update podfile structure according to the following steps:
    • dependencies to support swift 5.0 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.
  6. Update the podfile dependencies to support swift 5.0 specs.
  7. 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`
  8. Build the test project and make sure it’s working without errors.
  9. Push your code to main branch and tag it.
  10. Add a new git tag respectively to yhe new podsepc version.
  11. Create updated manifest file and upload it to Zapp.

results matching ""

    No results matching ""