Skip to content
This repository has been archived by the owner on Nov 10, 2020. It is now read-only.

Latest commit

 

History

History
79 lines (54 loc) · 2.23 KB

BUILDING.md

File metadata and controls

79 lines (54 loc) · 2.23 KB

Guide to building the Ninchat iOS SDK

This document describes the steps to take when developing, updating and releasing the Ninchat iOS SDK.

The library has been written in Objective-C, provinding a thin layer around a wrapped Golang SDK that has been built as a static Framework for iOS use.

The library is being published using Cocoapods, the de-facto standard dependency manager for iOS.

Development

When developing the SDK, pay attention to the existing coding style and follow the same conventions.

TODO

Use of the Ninchat Go SDK

This project uses the Ninchat Go SDK to take care of API communication.

Prerequisites

You must have go and gomobile installed. Install them by running:

brew install go
go get -u golang.org/x/mobile/cmd/gomobile
gomobile init

Updating the Go Framework

You will need Go 1.8+ installed to perform this step; it requires building the existing Ninchat Go SDK into a static library callable from iOS code.

Update the Framework by running the script:

update-go-framework.sh

To do the steps manually, do the following:

  1. Make sure you have the latest code:
git submodule init
git submodule update
git fetch
git merge <origin-branch>
  1. Enter the Go mobile package directory:
cd /path/to/project/go-sdk/src/github.com/ninchat/ninchat-go/mobile
  1. Create the Framework:
GOPATH=$GOPATH:/path/to/project/go-sdk gomobile bind -target ios -o /tmp/NinchatGo.framework
  1. Replace the version in the iOS project
rm -rf /path/to/project/Frameworks/NinchatGo.framework
cp -r /tmp/NinchatGo.framework /path/to/project/Frameworks/NinchatGo.framework

Releasing new SDK version

First of all you need to have configured the private podspecs repo:

pod repo add ninchat-podspecs [email protected]:somia/ninchat-podspecs.git

To release a new SDK version on the said podspec repository, take the following steps:

  • Update NinchatSDK.podspec and set s.version to match the upcoming tag
  • Commit all your changes, merge all pending accepted Merge ('pull') Requests
  • Create a new tag following Semantic Versioning; eg. git tag -a 1.0.1 -m "Your tag comment"
  • git push --tags
  • pod repo push ninchat-podspecs NinchatSDK.podspec