ASAPP - iOS
© 2023 ASAPP Inc, all rights reserved.
Organization
.
├── SDK Chat SDK
├── fastlane fastlane configuration files
├── package Directory containing docs, the built framework, and example projects that is delivered to partners
├── scripts Utility scripts
Running the test app locally
Pre-requisites
Program | Version |
---|---|
Xcode | 14.3.1 |
Steps
- Open
SDK/ASAPP.xcworkspace
- Select ASAPPTest from the schemes dropdown menu (near the stop button in the upper-left hand corner)
- Select the device or simulator you’d like to to test on using the dropdown menu next to the scheme you just selected. We run snapshot tests on the latest iPhone SE to ensure we handle small screens properly.
- Press the play button to build and run the application
Development, QA, and release process
We develop, test, and build using Xcode 14.3.1
Loosely following GitFlow, develop
is the default branch. We merge develop
into staging
to prepare a release candidate. Once a release candidate has been approved, staging
will be merged into master
.
staging
is built automatically by CircleCI using fastlane and distributed using Firebase. The build number is automatically incremented. The version string is updated based on the pull request title.
- Make a pull request from
develop
tostaging
. We follow SemVer to define our versions. To increment the patch, minor, or major versions, include “patch”, “minor”, or “major”, respectively, in the pull request title. If none of these keywords are present in the title, the version will not be incremented. Do not squash when merging. - On every commit to
staging
, our CircleCI workflow will check and update the version string, run tests, check that the public API is fully documented, and hold the release candidate for approval. Notifications will be sent to #chat-sdk-ios-builds in Slack. - Unpause the
rc-approval
job to distribute a release candidate via Firebase. - Wait for QA approval. If changes need to be made, push changes or merge a pull request into
staging
again. - Update the changelog by following the conventional format and using the command below to generate a list of changes. Verify the list by comparing against https://github.com/asappinc/chat-sdk-ios/compare/X.Y.Z…staging.
bash git log X.Y.Z..staging --pretty=oneline | perl -ne '{ while ($_ =~ /(\w+)[-](\d+)(.*)/g) { print "[$1-$2$3 \n"; } }' | sort | uniq
- Unpause the
release-approval
CircleCI job to archive the framework, tag the commit, create a GitHub release, and merge to master. If there are conflicts, the channel will be notified. - Prepare the release announcement message according to convention (search for “iOS SDK” in
#annc-release
). - Wait for https://github.com/asappinc/chat-sdk-ios-demo/commits/master to be automatically updated or, if there were breaking changes, update it manually.
- Download ASAPP.iOS.Framework.X.Y.Z.zip from either the CircleCI job or the GitHub release and double-check that the folder structure is correct and that the example projects work.
- Upload the archive to Google Drive.
- Post the release announcement message in #annc-release and alert the relevant deployment managers.
Generating API reference pages from documentation comments
Pre-requisites
Program | Version |
---|---|
ruby | 2.7.6 |
bundler | 2.1.4 |
jazzy | 0.9.3 |
Running jazzy
You may need to run bundle update
as above.
scripts/generate_docs.sh
The reference website can be found at package/docs/swift/index.html
.
Running tests
Pre-requisites
brew install carthage
cd SDK && carthage bootstrap --use-xcframeworks --platform iOS
Steps
- Select either
All Tests
orFast Tests
- Select the latest iPhone SE as target device
- Run tests
Sending data to SonarQube
Note that because we run our macOS jobs on circleci.com, we cannot access SonarQube from CircleCI. Therefore, we must run sonar-scanner
locally while connected to the VPN.
Pre-requisites
- Install sonar-scanner at the root of this project in a directory named
sonarsource
such that the path tosonar-scanner
issonarsource/bin/sonar-scanner
- Connect to the VPN
- Log in to https://sonarqube.asapp.dev via Okta
See
See the pre-requisites for “Running tests” aboveSteps
- Select the “All Tests” scheme
- Select the latest iPhone SE as the target device
- Run tests
- A few minutes after the tests have completed, linting and test coverage data will have been sent to SonarQube.
Running the Objective-C example project
- Open Xcode 14.3.1
- Archive the Aggregate scheme for a Generic iOS Device. The framework will be updated automatically.
- Open and run the example Objective-C project at
/package/Objective-C Example/ASAPPChatDemoObjc.xcodeproj