How to build custom adapters with incremental development in TIBCO Mashery Local?

How to build custom adapters with incremental development in TIBCO Mashery Local?

book

Article ID: KB0074009

calendar_today

Updated On:

Products Versions
TIBCO Cloud API Management - Local Edition 5.x and above

Description

.

Environment

All Supported Platforms

Resolution

Option 1: Position all code i.e. source for adapter 1 and 2  under same repo; so that the gradle build script can do the job of bundling all adapters into a single archive with which they can build the tm image

Option 2: If above option is not feasible; build two adapters separately and create a single zip with both the jars and include all dependent jars too.
Below is an example structure and contents for the zip tml-mashery-customer-extension.zip

1935 Wed Nov 11 09:01:22 IST 2020 adapter2.jar
0 Wed Nov 11 09:01:22 IST 2020 lib/
577742 Wed Nov 11 09:01:14 IST 2020 lib/commons-lang3-3.11.jar
6821 Wed Nov 11 09:01:22 IST 2020 EAV.jar
20261 Wed Oct 07 08:44:50 IST 2020 lib/fluent-logger-0.3.4.jar
282654 Wed Oct 07 08:44:50 IST 2020 lib/msgpack-0.6.8.jar
23931 Wed Oct 07 08:44:48 IST 2020 lib/json-simple-1.1.1.jar

adapter2.jar and EAV.jar are the two different adapters built by different teams and each of them provides all different dependent libraries which are bundled together in the lib directory. Please note the zip entries in the file; adapters are at root entry level while dependent jars are in the lib directory inside the zip file. This particular option will open up scope for a lot of human errors as pre-5.2 SDK experience suggests.

For option 1
The sample version control project would look like

MasheryLocalSDK

|----Project1
|----src
|----other directories
|----Project2
|----src
|----other directories
|----build-adapter.sh
|----dist
|----tml-mashery-customer-extension.zip

use the build-adapter.sh and build the project which will create the zip file with all the adapters included.

Issue/Introduction

This article provides inputs on building custom adapters in Mashery Local when multiple developers/projects are at play.