Terra BOM
The keyword BOM( Bill of Materials) has not been a strange name for mobile developers recently, especially in Android development (Firebase BOM has been a prevalent example).
A BOM is explained as a blueprint for manufacturing a product that consists of materials, components... to create items. But in this article, we just use BOM as the dependency management. The BOM is special kind of software component which does not contain any sources and was mainly used to reference other libraries
#
FeatureTerra BOM can help you to manage all library versions of the Terra platform easily by using only one version - The BOM version. All you need is to define the provided BOM version - the Terra BOM will choose an individual library version mapped to the BOM version. Therefore, we will take some advantage of it:
- Terra team has provided some core libraries(Terra Core, Apollo...) that have been used in the whole Teko Mobile SDK teams and some services have depends on each other so BOM was build to ensure that every release of each library is compatible with others, you do not need to specify which version is compatible with another Terra library
- When we upgrade Terra BOM features, these dependencies are upgraded as well in a consistent way.\
#
Usage- Android
- iOS
In Android Approach, we use Java Platform Plugin
to define a set of dependency constraints
across the project. After determining the suitable BOM version, you can define Terra dependencies easily like this:
Installing the plugin
Installing Pods
Add $TerraBomVersion
variable to the head of your Podfile
Then run pod install
as usual.
Example
This is an example of Podfile
with TerraBOM
version 1.0.0
#
Dependency Management- Android
- iOS

Currently, the Terra team has been using a dynamic minor version to manage their dependencies to reduce many changes on each release, Terra BOM is therefore dynamic at minor version too. It means you will pull the latest version in a range of versions by default. Example:
Assume that login-ui had the latest version at v1.8 and in Terra BOM was define in a range from v1.4 to v2.0, so the BOM will decide to pull v1.8 for your project.
In case you do not want to get the latest version automatically, you can still specify a version and override the version recommended in BOM:
For iOS, we had written a plugin named cocoapods-terra-bom to make your project install the SDKs version which is defined in the TerraBOM podspec.

There would be two cases with your dependencies.
If a pod is defined with a specific version (e.g.
'1.0.0', '~> 1.2.0'
), that version will be installed.If a pod is not defined with a specific version, (e.g.
pod 'Minerva'
), the plugin will find the version of the dependency with that name in the TerraBOM podspec file and install that version.
If cannot find, cocoapods will install any version of that pod as its original behavior.