Skip to content
Grimont edited this page Jul 17, 2018 · 15 revisions

This is the place to discuss development and contribution to c8osdk for iOS. You’ll find pages about coding style, project structure, release and running the tests.

Get started

Requirements

Overview

c8osdk-ios repository is divided in two parts:

Except to do specific changes for react-native packaging, every changes must be done into master and then merged on RNPackaging branch from master.

Master branch

This is the main branch on which we are doing development, and add of new features...

We also release for swift-cocoapods from this branch

This branch use cocoapods to manage it's dependencies, with a basic podfile.

To work from this branch just type:

    $ git clone git@github.com:convertigo/c8osdk-ios.git

    $ cd c8osdk-ios

    $ pod install

    $ open C8oSDKiOS.xcworkspace

RNPackaging branch

This is a secondary branch ... It's configured to works with react-native-c8osdk

Due to an uge number of bugs with cocoapods and react-native working together we have to handle this branch differently.

Basically they are few changes that must be done directly on this branch since it's have been configured properly to works with react-native-c8osdk package.

We are just applying merge of feature from master.

Whenever, you have to work on this branch, or just test changes after applying merge from master just type:

    $ git clone git@github.com:convertigo/c8osdk-ios.git

    $ cd c8osdk-ios

    $ git checkout RNPackaging

    $ git submodule update --init --recursive

    $ open C8oSDKiOS.xcworkspace

In this branch we are using cocoapods structure, but not the tools. That means that the dependencies seems to be organized as with cocoapods but thats not the case. We have replaced the source brings backs from cocoapods by it's equivalent in linked git submodule, that helped us to manage the updates, and to let their repository getting the sources.

When you wants to update one of the dependencies, you just have to update git submodules from their repository.

for example, for SwiftyJSON:

    $ cd Pods/SwiftyJSON

    $ git reset --hard origin master

    $ git pull origin master

    $ git checkout VERSIONX

    $ cd ../..

    $ git add Pods/SwiftyJSON

    $ git commit -am "Update SwiftyJSON to new Version: VERSIONX"

Exept from Coucbase-lite-ios 1.4.1 that have packaging issues and that is handled from this repository, that we handle ourself.

Adding a new feature, or bug fix

Basically adding a new feature will be done from a new branch checked out from master.

git checkout -b feature1

Then on this branch you can do every changes you have to do concerning the feature1.

When your feature, or bug fix seems to be implemented you must use C8oSDKiOSTests project to locally test it.

Once, the local test is passing successfully, you can push your local commits on the new branch.

This will automatically triggered the Travis CI that will test and compile the sdk in another environnement.

Finally when it's passed, then you can merge your change into the master branch.

Furthermore, you must transmit your changes from master branch into RNPackaging branch,and re play tests both locally and remotely using the same method than for the master branch, describe above.

Release for Cocoapods

When your changes have been done and properly tested like describe above, you can release a new version.

Prerequisite

There is a few thing that you must do:

  • Update C8oSDK.podspec
    • By incrementing spec version
    • By incrementing spec source tag version
    • By incrementing (eventually) spec dependency version to fetch Podfile
    • Think about spec swift_version
  • Incrementing version number into getSdkVersion() method of C8o class
  • Incrementing version number into Targets => C8oSDKiOS => General => Version
  • Commit, tag and push
  • You can test if the publication will be successfully by typing the following

Testing the release

$ cd PodSpec
$ pod spec lint --verbose --no-clean --allow-warnings

Once the lint passed successfully, then we can release the new version with the following command

For beta Release

The version number of C8oSDK.podspec must be formatted as X.X.X-betaX

$ pod trunk push

NB: --allow-warnings option can be used as in pod spec lint

For production Release

$ pod trunk push

NB: --allow-warnings option can be used as in pod spec lint

Release for react-native

When your changes have been done an propagated from master branch into RNPackaging branch

There is a few thing that you must do:

  • test
  • Update C8oSDK.podspec
    • By incrementing spec version
    • By incrementing spec source tag version
    • By incrementing (eventually) spec dependency version to fetch Podfile
    • Think about spec swift_version
  • Incrementing version number into getSdkVersion() method of C8o class
  • Incrementing version number into Targets => C8oSDKiOS => General => Version
  • Commit, tag and push

The tag will be the release, and the other operations will be done into react-native-c8osdk wiki's