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.

  1. Install Xcode 11.2.1 and Cocoapods v1.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'
    
  3. 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
      
  1. 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 and save_cache caching phases (check Zapp-iOS project as an example):
  2. 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.
  3. Update the swift version inside the .swift-version file.
  4. 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.
  5. Open the workspace with Xcode 11.2.1.
  6. 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.
  7. 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.
  8. 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.
  9. Push your code with GIT and make sure circle-ci build process ended successfully.
  10. Verify that a new podspec file was created inside Applicaster's private CocoaPods-Private or public CocoaPods repositories.
  11. 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.

3rd Party Plugins Migration

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

  1. Install Xcode 11.2.1 and Cocoapods v1.7.5 using the following command:
     sudo gem install cocoapods -v "=1.7.5"
    
  2. 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.
  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 11.2.1 and a new podfile that points to your upgraded podspec file.
  5. 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.
  6. Update the podfile dependencies to support swift 5.1 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.1`.
  8. Push your code to main branch and tag it.
  9. Add a new git tag respectively to yhe new podsepc version.
  10. 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.
      

results matching ""

    No results matching ""