This guide targets Developers of this SDK. It explains how to build the project and how the CI setup works. In order to setup the environment you need to install Cocoapods and Fastlane
- How to Build the Sample App
- How to Test with the Sample App
- How to test your SDK integration with Cocoapods
- How to generate SDK documentation locally
- Continuous Integration and Deployment
First, it is highly recommended to setup some environment variables which are required by the project.
RMAAPIEndpoint=https://www.example.com
RASProjectId=test-project-id
RASProjectSubscriptionKey=test-subscription-key
NOTE: RASApplicationIdentifier
is deprecated
Next, run fastlane updatePods
from the root directory that will trigger a pod install
and fetch git submodules, then open MiniApp.xcworkspace
, and you should be able to successfully build the Sample App.
Note: You need to define the environment variables before installing the pods because there is a post install script which sets up the project with your environment variables. If you don't want to use environment variables, you can edit the MiniApp-Secrets.xcconfig
created after a pod install
in the parent folder of the project,but be aware you will have to update this file after every pod install
We currently don't provide an API for public use, so you must provide your own API.
If you need to test your SDK fork into your host app before making a pull request, you can use this line into your podfile:
pod 'MiniApp', git: 'https://github.com/<My fork account>/ios-miniapp', branch: 'master', submodules: true
You may want to generate the SDK documentation locally so that you can ensure that the generated docs look correct. We use Jazzy for this, so you can run the following commands:
bundle exec jazzy \
--xcodebuild-arguments -scheme,Tests \
--module MiniApp \
--source-directory MiniApp \
--podspec MiniApp.podspec \
--theme fullwidth \
--readme USERGUIDE.md
The generated docs will be output to a folder named docs
in the root of this repo.
Before any deployment, be sure the project will build and run unit tests by running fastlane ci
.
TravisCI is used for building and testing the project for every pull request. It is also used for publishing the SDK and Sample App.
Note that two Sample App builds are created on merge to master or during a release:
- One build for the iOS Simulator (built on TravisCI and then uploaded to App Center - App Center does not support building for the Simulator target)
- One build for iOS Devices (built directly on App Center in order to keep the certificate and provisioning profile secret)
The following describes the steps that CI performs when a branch is merged to master.
- We trigger a build on TravisCI by merging a branch to master.
- CI builds SDK and Sample App, run tests, linting, etc.
- CI creates a ZIP file for the iOS Simulator (Staging) build of the Sample App.
- Publishes build to App Center "Testers" group.
- App Center builds the Sample App for iOS Devices (Staging).
- Publishes build to App Center "Testers" group.
The following describes the steps that CI performs when releasing a new version of the SDK.
- We trigger a build on TravisCI by pushing a Git tag to the repo in the format
vX.X.X
. - CI builds SDK and Sample App, run tests, linting, etc.
- CI publishes the SDK to Cocoapods.
- CI creates ZIP file for the iOS Simulator (Production) build of the Sample App.
- Publishes build to App Center "Production" group.
- CI merges the
master
branch into theprod
branch.- This triggers a build on App Center for the iOS Device (Production) build of the Sample App.
- Publishes build to App Center "Production" group.
- CI publishes documentation to Github Pages site.