Downloading dependencies

1

Now, let's define our dependencies and their versions. Open the libs.versions.toml file, which is in the gradle folder.

We'll define the number of versions. The dependencies will be separated into hml and prod in the [versions] section.

Ex: taponphoneSdkV2HML = "1.0.23"

Then define the dependency in the [libraries] section.

= "com.first-tech:taponphone-sdk-v2-hml", version.ref = "taponphoneSdkV2HML" }

2

With all the changes completed, the libs.versions.toml file will look like this:

3

Now let's consume the SDK dependency (TTP) in the build.gradle.kts file of the application module (app). To do this, add the code snippet below in the dependencies block. We'll add each type of dependency separately: dev, hml and prod.

"hmlImplementation"(libs.taponphone.sdk.v2.homol) "releaseImplementation"(libs.taponphone.sdk.v2.release)

4

The build.gradle.kts file will look like this.

5

In the “buildTypes” topic, we'll add the following code snippet. So that the dependency is downloaded according to our build type.

release {
    resValue("string", "app_name", "taponphone-mobileapp-mpp-native")
    isMinifyEnabled = false
    proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")

}
create("hml") {
    resValue("string", "app_name", "[HML] taponphone-mobileapp-mpp-native")
    applicationIdSuffix = ".hml"
    signingConfig = signingConfigs.getByName("debug")
}
6

Nosso arquivo build.gradle.kts,ficara com a seguinte maneira.Após adicionar o trecho de código, clique em Sync Now para realizar a sincronização e baixar a dependência do SDK (TTP).

7

Depois disso, em External Libraries, veja que a dependência do SDK (TTP) foi baixada com sucesso. Agora, ela está disponível para uso.

Last updated