Updated on 2026-08-14

This commit is contained in:
Tangem 2023-03-10 21:02:22 +03:00
commit 4914e6949f
51 changed files with 959 additions and 1196 deletions

1
.gitignore vendored
View file

@ -32,4 +32,3 @@ local.properties
**/fastlane/Preview.html
**/fastlane/screenshots
**/fastlane/test_output
/buildSrc/build/

View file

@ -1,120 +1,16 @@
plugins {
id("com.android.application")
kotlin("android")
kotlin("kapt")
kotlin("plugin.serialization")
id("com.google.gms.google-services")
id("com.google.firebase.crashlytics")
id("com.google.dagger.hilt.android")
}
android {
compileSdk = AppConfig.compileSdkVersion
defaultConfig {
applicationId = AppConfig.packageName
minSdk = AppConfig.minSdkVersion
targetSdk = AppConfig.targetSdkVersion
versionCode = if (project.hasProperty("versionCode")) {
(project.property("versionCode") as String).toInt()
} else {
AppConfig.versionCode
}
versionName = if (project.hasProperty("versionName")) {
project.property("versionName") as String
} else {
AppConfig.versionName
}
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
buildFeatures {
compose = true
viewBinding = true
}
buildTypes {
release {
isDebuggable = false
isMinifyEnabled = false
proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro")
BuildConfigFieldFactory(
fields = listOf(
Field.Environment("prod"),
Field.TestActionEnabled(false),
Field.LogEnabled(false),
Field.TesterMenuAvailability(false),
),
builder = ::buildConfigField,
).create()
}
debug {
isDebuggable = true
isMinifyEnabled = false
applicationIdSuffix = ".dev"
configure<com.google.firebase.crashlytics.buildtools.gradle.CrashlyticsExtension> {
// disable mapping file uploads (default=true if minifying)
mappingFileUploadEnabled = false
}
BuildConfigFieldFactory(
fields = listOf(
Field.Environment("dev"),
Field.TestActionEnabled(true),
Field.LogEnabled(true),
Field.TesterMenuAvailability(true),
),
builder = ::buildConfigField,
).create()
}
create("debug_beta") {
initWith(getByName("release"))
versionNameSuffix = "-beta"
applicationIdSuffix = ".debug"
signingConfig = signingConfigs.getByName("debug")
BuildConfigFieldFactory(
fields = listOf(Field.TesterMenuAvailability(true)),
builder = ::buildConfigField,
).create()
}
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
isCoreLibraryDesugaringEnabled = false
}
composeOptions {
kotlinCompilerExtensionVersion = Versions.compose
}
packagingOptions {
resources.excludes += "lib/x86_64/darwin/libscrypt.dylib"
resources.excludes += "lib/x86_64/freebsd/libscrypt.so"
resources.excludes += "lib/x86_64/linux/libscrypt.so"
resources.excludes += "META-INF/gradle/incremental.annotation.processors"
}
}
repositories {
mavenCentral()
maven(url = "https://jitpack.io")
alias(deps.plugins.android.application)
alias(deps.plugins.kotlin.android)
alias(deps.plugins.kotlin.kapt)
alias(deps.plugins.kotlin.serialization)
alias(deps.plugins.google.services)
alias(deps.plugins.hilt.android)
alias(deps.plugins.firebase.crashlytics)
id("configuration")
}
dependencies {
implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.aar"))))
implementation(files("libs/walletconnect-1.5.6.aar"))
implementation(project(":domain"))
implementation(project(":common"))
implementation(project(":core:analytics"))
@ -137,86 +33,85 @@ dependencies {
implementation(project(":features:tester:impl"))
/** AndroidX libraries */
implementation(AndroidX.coreKtx)
implementation(AndroidX.appCompat)
implementation(AndroidX.fragmentKtx)
implementation(AndroidX.constraintLayout)
implementation(AndroidX.browser)
implementation(AndroidX.lifecycleRuntimeKtx)
implementation(AndroidX.lifecycleCommonJava8)
implementation(AndroidX.lifecycleViewModelKtx)
implementation(AndroidX.lifecycleLiveDataKtx)
implementation(AndroidX.activityCompose)
implementation(deps.androidx.core.ktx)
implementation(deps.androidx.appCompat)
implementation(deps.androidx.fragment.ktx)
implementation(deps.androidx.constraintLayout)
implementation(deps.androidx.activity.compose)
implementation(deps.androidx.browser)
implementation(deps.lifecycle.runtime.ktx)
implementation(deps.lifecycle.common.java8)
implementation(deps.lifecycle.viewModel.ktx)
/** Compose libraries */
implementation(Compose.material)
implementation(Compose.animation)
implementation(Compose.foundation)
implementation(Compose.ui)
implementation(Compose.uiTooling)
implementation(Compose.coil)
implementation(deps.compose.material)
implementation(deps.compose.animation)
implementation(deps.compose.foundation)
implementation(deps.compose.ui)
implementation(deps.compose.ui.tooling)
implementation(deps.compose.coil)
implementation(deps.compose.shimmer)
/** Firebase libraries */
implementation(platform(Firebase.bom))
implementation(Firebase.firebaseAnalytics)
implementation(Firebase.firebaseCrashlytics)
implementation(platform(deps.firebase.bom))
implementation(deps.firebase.analytics)
implementation(deps.firebase.crashlytics)
/** Tangem libraries */
implementation(Tangem.blockchain) {
implementation(deps.tangem.blockchain) {
exclude(module = "joda-time")
}
implementation(Tangem.cardCore)
implementation(Tangem.cardAndroid) {
implementation(deps.tangem.card.core)
implementation(deps.tangem.card.android) {
exclude(module = "joda-time")
}
/** DI */
implementation(Library.hilt)
kapt(Library.hiltKapt)
implementation(deps.hilt.android)
kapt(deps.hilt.kapt)
/** Other libraries */
implementation(Library.materialComponent)
implementation(Library.googlePlayCore)
implementation(Library.googlePlayCoreKtx)
coreLibraryDesugaring(Library.desugarJdkLibs)
implementation(Library.timber)
implementation(Library.reKotlin)
implementation(Library.zxingQrCore)
implementation(Library.zxingQrBarcodeScanner)
implementation(Library.otaliastudiosCameraView)
implementation(Library.coil)
implementation(Library.appsflyer)
implementation(Library.amplitude)
implementation(Library.kotsonGsonExt)
implementation(deps.material)
implementation(deps.googlePlay.core)
implementation(deps.googlePlay.core.ktx)
implementation(deps.googlePlay.services.wallet)
coreLibraryDesugaring(deps.desugar)
implementation(deps.timber)
implementation(deps.reKotlin)
implementation(deps.zxing.qrCore)
implementation(deps.zxing.qrBarcodeScanner)
implementation(deps.otaliastudiosCameraView)
implementation(deps.coil)
implementation(deps.appsflyer)
implementation(deps.amplitude)
implementation(deps.kotsonGson)
//TODO: refactoring: remove it when all network services moved to the datasource module
implementation(Library.retrofit)
implementation(Library.retrofitMoshiConverter)
implementation(Library.moshi)
implementation(Library.moshiKotlin)
implementation(Library.okHttp)
implementation(Library.okHttpLogging)
implementation(Library.zendeskChat)
implementation(Library.zendeskMessaging)
implementation(Library.spongecastleCryptoCore)
implementation(Library.lottie)
implementation(Library.shopifyBuySdk) {
implementation(deps.retrofit)
implementation(deps.retrofit.moshi)
implementation(deps.moshi)
implementation(deps.moshi.kotlin)
implementation(deps.okHttp)
implementation(deps.okHttp.logging)
implementation(deps.zendesk.chat)
implementation(deps.zendesk.messaging)
implementation(deps.spongecastle.core)
implementation(deps.lottie)
implementation(deps.shopify.buy) {
exclude(group = "com.shopify.graphql.support")
exclude(module = "joda-time")
}
implementation(Library.accompanistAppCompatTheme)
implementation(Library.accompanistSystemUiController)
implementation(Library.accompanistWebView)
implementation(Library.xmlShimmer)
implementation(Library.viewBindingDelegate)
implementation(Library.armadillo)
implementation(Library.googlePlayServicesWallet)
implementation(Library.composeShimmer)
implementation(Library.mviCoreWatcher)
implementation(Library.kotlinSerialization)
implementation(deps.compose.accompanist.appCompatTheme)
implementation(deps.compose.accompanist.systemUiController)
implementation(deps.compose.accompanist.webView)
implementation(deps.xmlShimmer)
implementation(deps.viewBindingDelegate)
implementation(deps.armadillo)
implementation(deps.mviCore.watcher)
implementation(deps.kotlin.serialization)
/** Testing libraries */
testImplementation(Test.junit)
testImplementation(Test.truth)
androidTestImplementation(Test.junitAndroidExt)
androidTestImplementation(Test.espresso)
testImplementation(deps.test.junit)
testImplementation(deps.test.truth)
androidTestImplementation(deps.test.junit.android)
androidTestImplementation(deps.test.espresso)
}

View file

@ -3,4 +3,4 @@
<string name="tangem_app_name">DebugTangem</string>
</resources>
</resources>

View file

@ -3,4 +3,4 @@
<string name="tangem_app_name">BetaTangem</string>
</resources>
</resources>

View file

@ -3,4 +3,4 @@
<string name="tangem_app_name">BetaTangem</string>
</resources>
</resources>

View file

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<debug-overrides>
<trust-anchors>
<certificates src="user" />
@ -17,5 +16,4 @@
</domain-config>
<base-config cleartextTrafficPermitted="false" />
</network-security-config>

View file

@ -1,37 +1,13 @@
buildscript {
repositories {
google()
mavenCentral()
maven(url = "https://maven.fabric.io/public")
}
dependencies {
classpath(ClasspathDependency.AndroidGradlePlugin)
classpath(ClasspathDependency.KotlinGradlePlugin)
classpath(ClasspathDependency.AndroidMavenGradlePlugin)
classpath(ClasspathDependency.GoogleServices)
classpath(ClasspathDependency.GoogleFirebaseCrashlytics)
}
}
plugins {
id("com.google.dagger.hilt.android") version "2.44" apply false
kotlin("plugin.serialization") version Versions.kotlin apply false
}
allprojects {
repositories {
google()
jcenter() // unable to replace with mavenCentral() due to rekotlin and com.otaliastudios:cameraview
mavenLocal()
maven("https://nexus.tangem-tech.com/repository/maven-releases/")
maven("https://jitpack.io")
maven("https://zendesk.jfrog.io/zendesk/repo")
}
}
subprojects {
apply(plugin = "detekt-convention")
alias(deps.plugins.kotlin.android) apply false
alias(deps.plugins.kotlin.jvm) apply false
alias(deps.plugins.kotlin.serialization) apply false
alias(deps.plugins.kotlin.kapt) apply false
alias(deps.plugins.android.application) apply false
alias(deps.plugins.android.library) apply false
alias(deps.plugins.hilt.android) apply false
alias(deps.plugins.google.services) apply false
alias(deps.plugins.firebase.crashlytics) apply false
}
tasks.register("clean", Delete::class) {

View file

@ -1,16 +0,0 @@
plugins {
`kotlin-dsl`
}
repositories {
google()
mavenCentral()
}
dependencies {
implementation("com.android.tools.build:gradle:7.1.3")
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10")
//TODO("Upgrade version to 1.22.0 after upgrading kotlin version to 1.7.21")
implementation("io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.21.0")
implementation("com.squareup:javapoet:1.13.0")
}

View file

@ -1,9 +0,0 @@
object ClasspathDependency {
const val AndroidGradlePlugin = "com.android.tools.build:gradle:" + Versions.androidGradlePlugin
const val AndroidMavenGradlePlugin = "com.github.dcendents:android-maven-gradle-plugin:" +
Versions.androidMavenGradlePlugin
const val GoogleFirebaseCrashlytics = "com.google.firebase:firebase-crashlytics-gradle:" +
Versions.googleFirebaseCrashlytics
const val GoogleServices = "com.google.gms:google-services:" + Versions.googleServices
const val KotlinGradlePlugin = "org.jetbrains.kotlin:kotlin-gradle-plugin:" + Versions.kotlin
}

View file

@ -1,36 +0,0 @@
typealias ConfigFieldBuilder = (String, String, String) -> Unit
class BuildConfigFieldFactory(
private val fields: List<Field>,
private val builder: ConfigFieldBuilder,
) {
fun create() {
fields.forEach { field -> builder(field.type, field.name, field.value) }
}
}
/**
* Build config field
*
* @property type field type
* @property name field name
* @property value field value
*/
sealed class Field(val type: String, val name: String, val value: String) {
class Environment(value: String) : Field(type = "String", name = "ENVIRONMENT", value = "\"$value\"")
class TestActionEnabled(isEnabled: Boolean) : Field(
type = "Boolean",
name = "TEST_ACTION_ENABLED",
value = isEnabled.toString(),
)
class LogEnabled(isEnabled: Boolean) : Field(type = "Boolean", name = "LOG_ENABLED", value = isEnabled.toString())
class TesterMenuAvailability(isEnabled: Boolean) : Field(
type = "Boolean",
name = "TESTER_MENU_ENABLED",
value = isEnabled.toString(),
)
}

View file

@ -1,94 +0,0 @@
object AndroidX {
const val activityCompose = "androidx.activity:activity-compose:" + Versions.androidxActivityCompose
const val appCompat = "androidx.appcompat:appcompat:" + Versions.androidxAppCompat
const val browser = "androidx.browser:browser:" + Versions.androidxBrowser
const val constraintLayout = "androidx.constraintlayout:constraintlayout:" + Versions.androidxConstraintLayout
const val coreKtx = "androidx.core:core-ktx:" + Versions.androidxCore
const val fragmentKtx = "androidx.fragment:fragment-ktx:" + Versions.androidxFragment
const val lifecycleCommonJava8 = "androidx.lifecycle:lifecycle-common-java8:" + Versions.androidxLifecycle
const val lifecycleLiveDataKtx = "androidx.lifecycle:lifecycle-livedata-ktx:" + Versions.androidxLifecycle
const val lifecycleRuntimeKtx = "androidx.lifecycle:lifecycle-runtime-ktx:" + Versions.androidxLifecycle
const val lifecycleViewModelKtx = "androidx.lifecycle:lifecycle-viewmodel-ktx:" + Versions.androidxLifecycle
}
object Compose {
const val animation = "androidx.compose.animation:animation:" + Versions.compose
const val coil = "io.coil-kt:coil-compose:" + Versions.coil
const val foundation = "androidx.compose.foundation:foundation:" + Versions.composeFoundation
const val hiltNavigation = "androidx.hilt:hilt-navigation-compose:" + Versions.composeHiltNavigation
const val material = "androidx.compose.material:material:" + Versions.compose
const val navigation = "androidx.navigation:navigation-compose:" + Versions.composeNavigation
const val ui = "androidx.compose.ui:ui:" + Versions.compose
const val uiTooling = "androidx.compose.ui:ui-tooling:" + Versions.compose
const val constraintLayout = "androidx.constraintlayout:constraintlayout-compose:" + Versions.composeConstraint
}
object Firebase {
const val bom = "com.google.firebase:firebase-bom:" + Versions.firebase
const val firebaseAnalytics = "com.google.firebase:firebase-analytics-ktx"
const val firebaseCrashlytics = "com.google.firebase:firebase-crashlytics-ktx"
}
object Library {
const val accompanistAppCompatTheme = "com.google.accompanist:accompanist-appcompat-theme:" + Versions.accompanist
const val accompanistSystemUiController =
"com.google.accompanist:accompanist-systemuicontroller:" + Versions.accompanist
const val accompanistWebView = "com.google.accompanist:accompanist-webview:" + Versions.accompanist
const val amplitude = "com.amplitude:android-sdk:" + Versions.amplitude
const val appsflyer = "com.appsflyer:af-android-sdk:" + Versions.appsflyer
const val armadillo = "at.favre.lib:armadillo:" + Versions.armadillo
const val coil = "io.coil-kt:coil:" + Versions.coil
const val composeShimmer = "com.valentinilk.shimmer:compose-shimmer:" + Versions.composeShimmer
const val coroutine = "org.jetbrains.kotlinx:kotlinx-coroutines-core:" + Versions.coroutine
const val desugarJdkLibs = "com.android.tools:desugar_jdk_libs:" + Versions.desugarJdkLibs
const val googlePlayCore = "com.google.android.play:core:" + Versions.googlePlayCore
const val googlePlayCoreKtx = "com.google.android.play:core-ktx:" + Versions.googlePlayCoreKtx
const val googlePlayServicesWallet =
"com.google.android.gms:play-services-wallet:" + Versions.googlePlayServicesWallet
const val hilt = "com.google.dagger:hilt-android:" + Versions.hilt
const val hiltCore = "com.google.dagger:hilt-core:" + Versions.hilt
const val hiltKapt = "com.google.dagger:hilt-compiler:" + Versions.hilt
const val jodatime = "joda-time:joda-time:" + Versions.jodatime
const val krateSharedPref = "hu.autsoft:krate:" + Versions.krateSharedPref
const val kotsonGsonExt = "com.github.salomonbrys.kotson:kotson:" + Versions.kotsonGsonExt
const val lottie = "com.airbnb.android:lottie:" + Versions.lottie
const val materialComponent = "com.google.android.material:material:" + Versions.googleMaterialComponent
const val moshi = "com.squareup.moshi:moshi:" + Versions.moshi
const val moshiKotlin = "com.squareup.moshi:moshi-kotlin:" + Versions.moshi
const val okHttp = "com.squareup.okhttp3:okhttp:" + Versions.okhttp
const val okHttpLogging = "com.squareup.okhttp3:logging-interceptor:" + Versions.okhttp
const val otaliastudiosCameraView = "com.otaliastudios:cameraview:" + Versions.otaliastudiosCameraView
const val shopifyBuySdk = "com.shopify.mobilebuysdk:buy3:" + Versions.shopifyBuySdk
const val spongecastleCryptoCore = "com.madgag.spongycastle:core:" + Versions.spongycastleCryptoCore
const val reKotlin = "org.rekotlin:rekotlin:" + Versions.rekotlin
const val retrofit = "com.squareup.retrofit2:retrofit:" + Versions.retrofit
const val retrofitMoshiConverter = "com.squareup.retrofit2:converter-moshi:" + Versions.retrofitMoshiConverter
const val timber = "com.jakewharton.timber:timber:" + Versions.timber
const val viewBindingDelegate =
"com.github.kirich1409:viewbindingpropertydelegate-noreflection:" + Versions.viewBindingDelegate
const val xmlShimmer = "com.github.skydoves:androidveil:" + Versions.xmlShimmer
const val zendeskChat = "com.zendesk:chat:" + Versions.zendeskChat
const val zendeskMessaging = "com.zendesk:messaging:" + Versions.zendeskMessaging
const val zxingQrBarcodeScanner = "me.dm7.barcodescanner:zxing:" + Versions.zxingQrBarcodeScanner
const val zxingQrCore = "com.google.zxing:core:" + Versions.zxingQrCode
const val mviCoreWatcher = "com.github.badoo.mvicore:mvicore-diff:" + Versions.mviCore
const val kotlinSerialization = "org.jetbrains.kotlinx:kotlinx-serialization-json:" + Versions.kotlinSerialization
}
object Tangem {
const val blockchain = "com.tangem:blockchain:" + Versions.tangemBlockchainSdk
const val cardAndroid = "com.tangem.tangem-sdk-kotlin:android:" + Versions.tangemCardSdk
const val cardCore = "com.tangem.tangem-sdk-kotlin:core:" + Versions.tangemCardSdk
}
object Tools {
const val composeDetektRules = "ru.kode:detekt-rules-compose:" + Versions.composeDetektRules
const val formattingDetektRules = "io.gitlab.arturbosch.detekt:detekt-formatting:" + Versions.formattingDetektRules
}
object Test {
const val espresso = "androidx.test.espresso:espresso-core:" + Versions.espresso
const val junit = "junit:junit:" + Versions.junit
const val junitAndroidExt = "androidx.test.ext:junit:" + Versions.junitAndroidExt
const val truth = "com.google.truth:truth:" + Versions.truth
}

View file

@ -1,85 +0,0 @@
object Versions {
// region Classpath
const val androidGradlePlugin = "7.1.3"
const val androidMavenGradlePlugin = "2.1"
const val googleFirebaseCrashlytics = "2.7.1"
const val googleServices = "4.3.10"
const val kotlin = "1.7.10"
// endregion Classpath
// region AndroidX
const val androidxActivityCompose = "1.5.0"
const val androidxAppCompat = "1.5.1"
const val androidxBrowser = "1.4.0"
const val androidxConstraintLayout = "2.1.4"
const val androidxCore = "1.9.0"
const val androidxFragment = "1.5.3"
const val androidxLifecycle = "2.5.1"
// endregion AndroidX
// region Compose
const val compose = "1.3.1"
const val composeFoundation = "1.3.1"
const val composeHiltNavigation = "1.0.0"
const val composeNavigation = "2.5.1"
const val composeConstraint = "1.0.1"
// endregion Compose
// region Other libraries
const val accompanist = "0.28.0"
const val amplitude = "2.36.1"
const val appsflyer = "6.5.1"
const val armadillo = "0.9.0"
const val coil = "2.1.0"
const val composeShimmer = "1.0.3"
const val coroutine = "1.5.2"
const val desugarJdkLibs = "1.1.5"
const val firebase = "26.0.0"
const val googleMaterialComponent = "1.6.1"
const val googlePlayCore = "1.10.3"
const val googlePlayCoreKtx = "1.8.1"
const val googlePlayServicesWallet = "19.1.0"
const val hilt = "2.44"
const val jodatime = "2.12.1"
const val krateSharedPref = "2.0.0"
const val kotsonGsonExt = "2.5.0"
const val lottie = "3.4.0"
const val moshi = "1.12.0"
const val okhttp = "4.9.3"
const val otaliastudiosCameraView = "2.6.3"
const val rekotlin = "1.0.4"
const val retrofit = "2.8.1"
const val retrofitMoshiConverter = "2.6.0"
const val shopifyBuySdk = "12.0.0"
const val spongycastleCryptoCore = "1.58.0.0"
const val timber = "4.7.1"
const val viewBindingDelegate = "1.5.6"
const val xmlShimmer = "1.1.3"
const val zendeskChat = "3.3.5"
const val zendeskMessaging = "5.2.4"
const val zxingQrBarcodeScanner = "1.9.8"
const val zxingQrCode = "3.3.3"
const val mviCore = "1.3.1"
const val kotlinSerialization = "1.4.1"
// endregion Other libraries
// region Tangem
const val tangemBlockchainSdk = "develop-174"
// const val tangemBlockchainSdk = "0.0.1" // Keep it! - used for local builds
const val tangemCardSdk = "develop-200"
// const val tangemCardSdk = "0.0.1" // Keep it! - used for local builds
// endregion Tangem
// region Tools
const val composeDetektRules = "1.2.2"
const val formattingDetektRules = "1.21.0"
// endregion Tools
// region Testing
const val espresso = "3.4.0"
const val junit = "4.13.2"
const val truth = "1.1.3"
const val junitAndroidExt = "1.1.3"
// endregion Testing
}

View file

@ -1,33 +0,0 @@
import io.gitlab.arturbosch.detekt.Detekt
plugins {
id("io.gitlab.arturbosch.detekt")
}
detekt {
parallel = true
ignoreFailures = false
autoCorrect = true
buildUponDefaultConfig = true
config.setFrom(rootProject.files("config/detekt/detekt.yml"))
}
tasks.withType<Detekt> {
include("**/*.kt")
exclude("**/resources/**", "**/build/**")
reports {
sarif {
required.set(false)
}
txt {
required.set(true)
}
}
jvmTarget = "1.8"
}
dependencies {
detektPlugins(Tools.composeDetektRules)
detektPlugins(Tools.formattingDetektRules)
}

View file

@ -1,9 +1,4 @@
plugins {
id("java-library")
id("org.jetbrains.kotlin.jvm")
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
alias(deps.plugins.kotlin.jvm)
id("configuration")
}

View file

@ -1,47 +1,16 @@
plugins {
id("com.android.library")
kotlin("android")
kotlin("kapt")
id("com.google.dagger.hilt.android")
}
android {
defaultConfig {
compileSdk = AppConfig.compileSdkVersion
minSdk = AppConfig.minSdkVersion
targetSdk = AppConfig.targetSdkVersion
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
isCoreLibraryDesugaringEnabled = false
}
buildTypes {
create("debug_beta") {
initWith(getByName("release"))
BuildConfigFieldFactory(
fields = listOf(
Field.Environment("release"),
Field.TestActionEnabled(true),
Field.LogEnabled(true),
),
builder = ::buildConfigField,
).create()
}
}
alias(deps.plugins.android.library)
alias(deps.plugins.kotlin.android)
alias(deps.plugins.kotlin.kapt)
alias(deps.plugins.hilt.android)
id("configuration")
}
dependencies {
/** DI */
implementation(Library.hilt)
kapt(Library.hiltKapt)
implementation(deps.hilt.android)
kapt(deps.hilt.kapt)
/** Core shouldn't depends on core, but in case with utils and logging its necessary */
implementation(project(":core:utils"))

View file

@ -1,40 +1,9 @@
plugins {
id("com.android.library")
kotlin("android")
kotlin("kapt")
id("com.google.dagger.hilt.android")
}
android {
defaultConfig {
compileSdk = AppConfig.compileSdkVersion
minSdk = AppConfig.minSdkVersion
targetSdk = AppConfig.targetSdkVersion
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
isCoreLibraryDesugaringEnabled = false
}
buildTypes {
create("debug_beta") {
initWith(getByName("release"))
BuildConfigFieldFactory(
fields = listOf(
Field.Environment("release"),
Field.TestActionEnabled(true),
Field.LogEnabled(true),
),
builder = ::buildConfigField,
).create()
}
}
alias(deps.plugins.android.library)
alias(deps.plugins.kotlin.android)
alias(deps.plugins.kotlin.kapt)
alias(deps.plugins.hilt.android)
id("configuration")
}
dependencies {
@ -44,31 +13,31 @@ dependencies {
implementation(project(":libs:auth"))
/** Tangem libraries */
implementation(Tangem.blockchain)
implementation(Tangem.cardCore)
implementation(deps.tangem.blockchain)
implementation(deps.tangem.card.core)
/** DI */
implementation(Library.hilt)
kapt(Library.hiltKapt)
implementation(deps.hilt.android)
kapt(deps.hilt.kapt)
/** Coroutines */
implementation(Library.coroutine)
implementation(deps.kotlin.coroutines)
/** Logging */
implementation(Library.timber)
implementation(deps.timber)
/** Network */
implementation(Library.krateSharedPref)
implementation(Library.moshi)
implementation(Library.moshiKotlin)
implementation(Library.okHttp)
implementation(Library.okHttpLogging)
implementation(Library.retrofit)
implementation(Library.retrofitMoshiConverter)
implementation(deps.krateSharedPref)
implementation(deps.moshi)
implementation(deps.moshi.kotlin)
implementation(deps.okHttp)
implementation(deps.okHttp.logging)
implementation(deps.retrofit)
implementation(deps.retrofit.moshi)
/** Time */
implementation(Library.jodatime)
implementation(deps.jodatime)
/** Security */
implementation(Library.spongecastleCryptoCore)
implementation(deps.spongecastle.core)
}

View file

@ -1,62 +1,17 @@
plugins {
id("com.android.library")
kotlin("android")
kotlin("kapt")
id("com.google.dagger.hilt.android")
}
android {
defaultConfig {
compileSdk = AppConfig.compileSdkVersion
minSdk = AppConfig.minSdkVersion
targetSdk = AppConfig.targetSdkVersion
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
buildTypes {
release {
BuildConfigFieldFactory(
fields = listOf(Field.TesterMenuAvailability(false)),
builder = ::buildConfigField,
).create()
}
debug {
BuildConfigFieldFactory(
fields = listOf(Field.TesterMenuAvailability(true)),
builder = ::buildConfigField,
).create()
}
create("debug_beta") {
initWith(getByName("release"))
BuildConfigFieldFactory(
fields = listOf(
Field.Environment("release"),
Field.TestActionEnabled(true),
Field.LogEnabled(true),
Field.TesterMenuAvailability(true),
),
builder = ::buildConfigField,
).create()
}
}
alias(deps.plugins.android.library)
alias(deps.plugins.kotlin.android)
alias(deps.plugins.kotlin.kapt)
alias(deps.plugins.hilt.android)
id("configuration")
}
dependencies {
implementation(Library.moshi)
implementation(Library.moshiKotlin)
implementation(Library.hilt)
kapt(Library.hiltKapt)
implementation(Library.timber)
implementation(deps.moshi)
implementation(deps.moshi.kotlin)
implementation(deps.hilt.android)
kapt(deps.hilt.kapt)
implementation(deps.timber)
implementation(project(":core:datasource"))
}

View file

@ -1,35 +1,5 @@
plugins {
id("com.android.library")
kotlin("android")
}
android {
defaultConfig {
compileSdk = AppConfig.compileSdkVersion
minSdk = AppConfig.minSdkVersion
targetSdk = AppConfig.targetSdkVersion
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
buildTypes {
create("debug_beta") {
initWith(getByName("release"))
BuildConfigFieldFactory(
fields = listOf(
Field.Environment("release"),
Field.TestActionEnabled(true),
Field.LogEnabled(true),
),
builder = ::buildConfigField,
).create()
}
}
alias(deps.plugins.android.library)
alias(deps.plugins.kotlin.android)
id("configuration")
}

View file

@ -1,61 +1,22 @@
plugins {
id("com.android.library")
kotlin("android")
}
android {
defaultConfig {
compileSdk = AppConfig.compileSdkVersion
minSdk = AppConfig.minSdkVersion
targetSdk = AppConfig.targetSdkVersion
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
isCoreLibraryDesugaringEnabled = false
}
buildFeatures {
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion = Versions.compose
}
buildTypes {
create("debug_beta") {
initWith(getByName("release"))
BuildConfigFieldFactory(
fields = listOf(
Field.Environment("release"),
Field.TestActionEnabled(true),
Field.LogEnabled(true),
),
builder = ::buildConfigField,
).create()
}
}
alias(deps.plugins.android.library)
alias(deps.plugins.kotlin.android)
id("configuration")
}
dependencies {
/** AndroidX libraries */
implementation(AndroidX.fragmentKtx)
implementation(deps.androidx.fragment.ktx)
/** Compose */
implementation(Compose.foundation)
implementation(Compose.material)
implementation(Compose.uiTooling)
implementation(deps.compose.foundation)
implementation(deps.compose.material)
implementation(deps.compose.ui.tooling)
/** Other libraries */
implementation(Library.accompanistSystemUiController)
implementation(Library.materialComponent)
implementation(Library.composeShimmer)
implementation(deps.compose.accompanist.systemUiController)
implementation(deps.material)
implementation(deps.compose.shimmer)
implementation(project(":core:res"))
}

View file

@ -1,20 +1,15 @@
plugins {
id("java-library")
id("org.jetbrains.kotlin.jvm")
kotlin("kapt")
alias(deps.plugins.kotlin.jvm)
alias(deps.plugins.kotlin.kapt)
id("configuration")
}
dependencies {
/** DI */
implementation(Library.hiltCore)
kapt(Library.hiltKapt)
implementation(deps.hilt.core)
kapt(deps.hilt.kapt)
/** Coroutines */
implementation(Library.coroutine)
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
implementation(deps.kotlin.coroutines)
}

View file

@ -1,73 +1,7 @@
plugins {
id("com.android.library")
id("org.jetbrains.kotlin.android")
}
android {
compileSdk = AppConfig.compileSdkVersion
defaultConfig {
minSdk = AppConfig.minSdkVersion
targetSdk = AppConfig.targetSdkVersion
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
isMinifyEnabled = false
proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro")
BuildConfigFieldFactory(
fields = listOf(
Field.Environment("prod"),
Field.TestActionEnabled(false),
Field.LogEnabled(false),
),
builder = ::buildConfigField,
).create()
}
debug {
isMinifyEnabled = false
BuildConfigFieldFactory(
fields = listOf(
Field.Environment("prod"),
Field.TestActionEnabled(true),
Field.LogEnabled(true),
),
builder = ::buildConfigField,
).create()
}
create("debug_beta") {
initWith(getByName("release"))
BuildConfigFieldFactory(
fields = listOf(
Field.Environment("release"),
Field.TestActionEnabled(true),
Field.LogEnabled(true),
),
builder = ::buildConfigField,
).create()
}
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
packagingOptions {
resources.excludes += "lib/x86_64/darwin/libscrypt.dylib"
resources.excludes += "lib/x86_64/freebsd/libscrypt.so"
resources.excludes += "lib/x86_64/linux/libscrypt.so"
}
alias(deps.plugins.android.library)
alias(deps.plugins.kotlin.android)
id("configuration")
}
dependencies {
@ -77,28 +11,28 @@ dependencies {
implementation(project(":libs:auth"))
/** Tangem libraries */
implementation(Tangem.blockchain) {
implementation(deps.tangem.blockchain) {
exclude(module = "joda-time")
}
implementation(Tangem.cardCore)
implementation(Tangem.cardAndroid) {
implementation(deps.tangem.card.core)
implementation(deps.tangem.card.android) {
exclude(module = "joda-time")
}
/** Other libraries */
implementation(Library.reKotlin)
implementation(deps.reKotlin)
//TODO: refactoring: remove it when all network services moved to the datasource module
implementation(Library.retrofit)
implementation(Library.retrofitMoshiConverter)
implementation(Library.moshi)
implementation(Library.moshiKotlin)
implementation(Library.okHttpLogging)
implementation(Library.timber)
implementation(Library.coroutine)
implementation(deps.retrofit)
implementation(deps.retrofit.moshi)
implementation(deps.moshi)
implementation(deps.moshi.kotlin)
implementation(deps.okHttp.logging)
implementation(deps.timber)
implementation(deps.kotlin.coroutines)
/** Testing libraries */
testImplementation(Test.junit)
testImplementation(Test.truth)
androidTestImplementation(Test.junitAndroidExt)
androidTestImplementation(Test.espresso)
testImplementation(deps.test.junit)
testImplementation(deps.test.truth)
androidTestImplementation(deps.test.junit.android)
androidTestImplementation(deps.test.espresso)
}

View file

@ -1,41 +1,9 @@
plugins {
id("com.android.library")
kotlin("android")
kotlin("kapt")
id("com.google.dagger.hilt.android")
}
android {
defaultConfig {
compileSdk = AppConfig.compileSdkVersion
minSdk = AppConfig.minSdkVersion
targetSdk = AppConfig.targetSdkVersion
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
isCoreLibraryDesugaringEnabled = false
}
buildTypes {
create("debug_beta") {
initWith(getByName("release"))
BuildConfigFieldFactory(
fields = listOf(
Field.Environment("release"),
Field.TestActionEnabled(true),
Field.LogEnabled(true),
),
builder = ::buildConfigField,
).create()
}
}
alias(deps.plugins.android.library)
alias(deps.plugins.kotlin.android)
alias(deps.plugins.kotlin.kapt)
alias(deps.plugins.hilt.android)
id("configuration")
}
dependencies {
@ -46,9 +14,9 @@ dependencies {
implementation(project(":features:referral:domain"))
/** Time */
implementation(Library.jodatime)
implementation(deps.jodatime)
/** DI */
implementation(Library.hilt)
kapt(Library.hiltKapt)
implementation(deps.hilt.android)
kapt(deps.hilt.kapt)
}

View file

@ -1,7 +1,7 @@
plugins {
id("java-library")
id("org.jetbrains.kotlin.jvm")
kotlin("kapt")
alias(deps.plugins.kotlin.jvm)
alias(deps.plugins.kotlin.kapt)
id("configuration")
}
dependencies {
@ -11,14 +11,9 @@ dependencies {
implementation(project(":libs:crypto"))
/** Time */
implementation(Library.jodatime)
implementation(deps.jodatime)
/** DI */
implementation(Library.hiltCore)
kapt(Library.hiltKapt)
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
implementation(deps.hilt.core)
kapt(deps.hilt.kapt)
}

View file

@ -1,49 +1,9 @@
plugins {
id("com.android.library")
kotlin("android")
kotlin("kapt")
id("com.google.dagger.hilt.android")
}
android {
defaultConfig {
compileSdk = AppConfig.compileSdkVersion
minSdk = AppConfig.minSdkVersion
targetSdk = AppConfig.targetSdkVersion
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
isCoreLibraryDesugaringEnabled = false
}
buildFeatures {
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion = Versions.compose
}
buildTypes {
create("debug_beta") {
initWith(getByName("release"))
BuildConfigFieldFactory(
fields = listOf(
Field.Environment("release"),
Field.TestActionEnabled(true),
Field.LogEnabled(true),
),
builder = ::buildConfigField,
).create()
}
}
alias(deps.plugins.android.library)
alias(deps.plugins.kotlin.android)
alias(deps.plugins.kotlin.kapt)
alias(deps.plugins.hilt.android)
id("configuration")
}
dependencies {
@ -54,24 +14,24 @@ dependencies {
implementation(project(":core:ui"))
/** AndroidX */
implementation(AndroidX.appCompat)
implementation(AndroidX.fragmentKtx)
implementation(AndroidX.lifecycleViewModelKtx)
implementation(Library.materialComponent)
implementation(deps.androidx.appCompat)
implementation(deps.androidx.fragment.ktx)
implementation(deps.lifecycle.viewModel.ktx)
implementation(deps.material)
/** Compose */
implementation(Compose.foundation)
implementation(Compose.material)
implementation(Compose.uiTooling)
implementation(deps.compose.foundation)
implementation(deps.compose.material)
implementation(deps.compose.ui.tooling)
/** Domain */
implementation(project(":features:referral:domain"))
/** Other libraries */
implementation(Library.composeShimmer)
implementation(Library.accompanistWebView)
implementation(deps.compose.shimmer)
implementation(deps.compose.accompanist.webView)
/** DI */
implementation(Library.hilt)
kapt(Library.hiltKapt)
implementation(deps.hilt.android)
kapt(deps.hilt.kapt)
}

View file

@ -1,41 +1,9 @@
plugins {
id("com.android.library")
kotlin("android")
kotlin("kapt")
id("com.google.dagger.hilt.android")
}
android {
defaultConfig {
compileSdk = AppConfig.compileSdkVersion
minSdk = AppConfig.minSdkVersion
targetSdk = AppConfig.targetSdkVersion
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
isCoreLibraryDesugaringEnabled = false
}
buildTypes {
create("debug_beta") {
initWith(getByName("release"))
BuildConfigFieldFactory(
fields = listOf(
Field.Environment("release"),
Field.TestActionEnabled(true),
Field.LogEnabled(true),
),
builder = ::buildConfigField,
).create()
}
}
alias(deps.plugins.android.library)
alias(deps.plugins.kotlin.android)
alias(deps.plugins.kotlin.kapt)
alias(deps.plugins.hilt.android)
id("configuration")
}
dependencies {
@ -46,9 +14,9 @@ dependencies {
implementation(project(":features:swap:domain"))
/** Network */
implementation(Library.retrofit)
implementation(deps.retrofit)
/** DI */
implementation(Library.hilt)
kapt(Library.hiltKapt)
implementation(deps.hilt.android)
kapt(deps.hilt.kapt)
}

View file

@ -1,8 +1,8 @@
plugins {
id("java-library")
id("org.jetbrains.kotlin.jvm")
kotlin("kapt")
kotlin("plugin.serialization")
alias(deps.plugins.kotlin.jvm)
alias(deps.plugins.kotlin.kapt)
alias(deps.plugins.kotlin.serialization)
id("configuration")
}
dependencies {
@ -11,14 +11,9 @@ dependencies {
implementation(project(":core:utils"))
/** DI */
implementation(Library.hiltCore)
kapt(Library.hiltKapt)
implementation(deps.hilt.core)
kapt(deps.hilt.kapt)
/** Other Libraries **/
implementation(Library.kotlinSerialization)
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
implementation(deps.kotlin.serialization)
}

View file

@ -1,50 +1,10 @@
plugins {
id("com.android.library")
kotlin("android")
kotlin("kapt")
kotlin("plugin.serialization")
id("com.google.dagger.hilt.android")
}
android {
defaultConfig {
compileSdk = AppConfig.compileSdkVersion
minSdk = AppConfig.minSdkVersion
targetSdk = AppConfig.targetSdkVersion
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
isCoreLibraryDesugaringEnabled = false
}
buildTypes {
create("debug_beta") {
initWith(getByName("release"))
BuildConfigFieldFactory(
fields = listOf(
Field.Environment("release"),
Field.TestActionEnabled(true),
Field.LogEnabled(true),
),
builder = ::buildConfigField,
).create()
}
}
buildFeatures {
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion = Versions.compose
}
alias(deps.plugins.android.library)
alias(deps.plugins.kotlin.android)
alias(deps.plugins.kotlin.kapt)
alias(deps.plugins.kotlin.serialization)
alias(deps.plugins.hilt.android)
id("configuration")
}
dependencies {
@ -54,29 +14,28 @@ dependencies {
implementation(project(":core:ui"))
/** AndroidX */
implementation(AndroidX.activityCompose)
implementation(AndroidX.appCompat)
implementation(AndroidX.fragmentKtx)
implementation(AndroidX.lifecycleViewModelKtx)
implementation(AndroidX.browser)
implementation(deps.androidx.activity.compose)
implementation(deps.androidx.appCompat)
implementation(deps.androidx.fragment.ktx)
implementation(deps.lifecycle.viewModel.ktx)
implementation(deps.androidx.browser)
/** Compose */
implementation(Compose.foundation)
implementation(Compose.material)
implementation(Compose.uiTooling)
implementation(Compose.coil)
implementation(Compose.constraintLayout)
implementation(deps.compose.foundation)
implementation(deps.compose.material)
implementation(deps.compose.ui.tooling)
implementation(deps.compose.coil)
implementation(deps.compose.constraintLayout)
/** Domain */
implementation(project(":features:swap:domain"))
implementation(project(":features:swap:data"))//todo remove, only for test
/** Other libraries */
implementation(Library.composeShimmer)
implementation(Library.kotlinSerialization)
implementation(Library.timber)
implementation(deps.compose.shimmer)
implementation(deps.kotlin.serialization)
implementation(deps.timber)
/** DI */
implementation(Library.hilt)
kapt(Library.hiltKapt)
implementation(deps.hilt.android)
kapt(deps.hilt.kapt)
}

View file

@ -1,36 +1,5 @@
plugins {
id("com.android.library")
kotlin("android")
}
android {
defaultConfig {
compileSdk = AppConfig.compileSdkVersion
minSdk = AppConfig.minSdkVersion
targetSdk = AppConfig.targetSdkVersion
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
buildTypes {
create("debug_beta") {
initWith(getByName("release"))
BuildConfigFieldFactory(
fields = listOf(
Field.Environment("release"),
Field.TestActionEnabled(true),
Field.LogEnabled(true),
),
builder = ::buildConfigField,
).create()
}
}
alias(deps.plugins.android.library)
alias(deps.plugins.kotlin.android)
id("configuration")
}

View file

@ -1,83 +1,27 @@
plugins {
id("com.android.library")
kotlin("android")
kotlin("kapt")
id("com.google.dagger.hilt.android")
}
android {
defaultConfig {
compileSdk = AppConfig.compileSdkVersion
minSdk = AppConfig.minSdkVersion
targetSdk = AppConfig.targetSdkVersion
vectorDrawables {
useSupportLibrary = true
}
}
kotlinOptions {
jvmTarget = "1.8"
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
buildTypes {
release {
BuildConfigFieldFactory(
fields = listOf(Field.TesterMenuAvailability(false)),
builder = ::buildConfigField,
).create()
}
debug {
BuildConfigFieldFactory(
fields = listOf(Field.TesterMenuAvailability(true)),
builder = ::buildConfigField,
).create()
}
create("debug_beta") {
initWith(getByName("release"))
BuildConfigFieldFactory(
fields = listOf(
Field.Environment("release"),
Field.TestActionEnabled(true),
Field.LogEnabled(true),
Field.TesterMenuAvailability(true),
),
builder = ::buildConfigField,
).create()
}
}
buildFeatures {
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion = Versions.compose
}
alias(deps.plugins.android.library)
alias(deps.plugins.kotlin.android)
alias(deps.plugins.kotlin.kapt)
alias(deps.plugins.hilt.android)
id("configuration")
}
dependencies {
/** AndroidX */
implementation(AndroidX.activityCompose)
implementation(deps.androidx.activity.compose)
/** Compose */
implementation(Compose.foundation)
implementation(Compose.hiltNavigation)
implementation(Compose.material)
implementation(Compose.navigation)
implementation(Compose.ui)
implementation(Compose.uiTooling)
implementation(deps.compose.material)
implementation(deps.compose.foundation)
implementation(deps.compose.navigation)
implementation(deps.compose.navigation.hilt)
implementation(deps.compose.ui)
implementation(deps.compose.ui.tooling)
implementation(deps.compose.accompanist.systemUiController)
/** DI */
implementation(Library.accompanistSystemUiController)
implementation(Library.hilt)
kapt(Library.hiltKapt)
implementation(deps.hilt.android)
kapt(deps.hilt.kapt)
/** Core modules */
implementation(project(":core:featuretoggles"))

View file

@ -6,11 +6,12 @@
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
org.gradle.jvmargs = -Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
org.gradle.parallel=true
org.gradle.daemon=true
android.useAndroidX=true
android.enableJetifier=true
org.gradle.parallel = true
org.gradle.daemon = true
android.useAndroidX = true
android.enableJetifier = true
org.gradle.unsafe.configuration-cache = true

201
gradle/dependencies.toml Normal file
View file

@ -0,0 +1,201 @@
# docs https://docs.gradle.org/current/userguide/platforms.html
# TODO: update versions refs https://tangem.atlassian.net/browse/AND-3195
[versions]
# region Classpath
androidGradlePlugin = "7.4.2"
firebaseCrashlytics = "2.9.4"
googleServices = "4.3.10"
kotlin = "1.8.10"
# endregion Classpath
# region AndroidX
androidxActivityCompose = "1.5.0"
androidxAppCompat = "1.5.1"
androidxBrowser = "1.4.0"
androidxConstraintLayout = "2.1.4"
androidxCore = "1.9.0"
androidxFragment = "1.5.3"
androidxLifecycle = "2.5.1"
# endregion AndroidX
# region Compose
compose-compiler = "1.4.3"
compose-runtime = "1.3.3"
compose-foundation = "1.3.1"
compose-material = "1.3.1"
compose-constraint = "1.0.1"
compose-navigation = "2.5.3"
compose-accompanist = "0.28.0"
# endregion Compose
# region Other libraries
amplitude = "2.36.1"
appsflyer = "6.5.1"
armadillo = "0.9.0"
coil = "2.1.0"
compose-shimmer = "1.0.3"
coroutine = "1.5.2"
desugarJdkLibs = "1.1.5"
firebase = "26.0.0"
googleMaterialComponent = "1.6.1"
googlePlayCore = "1.10.3"
googlePlayCoreKtx = "1.8.1"
googlePlayServicesWallet = "19.1.0"
hilt = "2.44"
hilt-navigation = "1.0.0"
jodatime = "2.12.1"
krateSharedPref = "2.0.0"
kotsonGsonExt = "2.5.0"
lottie = "3.4.0"
moshi = "1.12.0"
okhttp = "4.9.3"
otaliastudiosCameraView = "2.6.3"
rekotlin = "1.0.4"
retrofit = "2.8.1"
retrofitMoshiConverter = "2.6.0"
shopifyBuySdk = "12.0.0"
spongycastleCryptoCore = "1.58.0.0"
timber = "4.7.1"
viewBindingDelegate = "1.5.6"
xmlShimmer = "1.1.3"
zendeskChat = "3.3.5"
zendeskMessaging = "5.2.4"
zxingQrBarcodeScanner = "1.9.8"
zxingQrCode = "3.3.3"
mviCore = "1.3.1"
kotlinSerialization = "1.4.1"
# endregion Other libraries
# region Tangem
tangemBlockchainSdk = "develop-174"
# tangemBlockchainSdk = "0.0.1" # Keep it! - used for local builds
tangemCardSdk = "develop-200"
# tangemCardSgk = "0.0.1" # Keep it! - used for local builds
# endregion Tangem
# region Tools
detektComposeRules = "1.2.2"
detekt = "1.21.0"
# endregion Tools
# region Testing
espresso = "3.4.0"
junit = "4.13.2"
truth = "1.1.3"
junitAndroidExt = "1.1.3"
# endregion Testing
[plugins]
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
kotlin-kapt = { id = "org.jetbrains.kotlin.kapt", version.ref = "kotlin" }
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
android-application = { id = "com.android.application", version.ref = "androidGradlePlugin" }
android-library = { id = "com.android.library", version.ref = "androidGradlePlugin" }
firebase-crashlytics = { id = "com.google.firebase.crashlytics", version.ref = "firebaseCrashlytics" }
google-services = { id = "com.google.gms.google-services", version.ref = "googleServices" }
hilt-android = { id = "com.google.dagger.hilt.android", version.ref = "hilt" }
detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "detekt" }
[libraries]
# region Classpath
# Used for plugins
gradle-android = { module = "com.android.tools.build:gradle", version.ref = "androidGradlePlugin" }
gradle-kotlin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
gradle-detekt = { module = "io.gitlab.arturbosch.detekt:detekt-gradle-plugin", version.ref = "detekt" }
gradle-firebase-crashlytics = { module = "com.google.firebase:firebase-crashlytics-gradle", version.ref = "firebaseCrashlytics" }
# end region Classpath
# region AndroidX
androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "androidxActivityCompose" }
androidx-appCompat = { module = "androidx.appcompat:appcompat", version.ref = "androidxAppCompat" }
androidx-browser = { module = "androidx.browser:browser", version.ref = "androidxBrowser" }
androidx-constraintLayout = { module = "androidx.constraintlayout:constraintlayout", version.ref = "androidxConstraintLayout" }
androidx-core-ktx = { module = "androidx.core:core-ktx", version.ref = "androidxCore" }
androidx-fragment-ktx = { module = "androidx.fragment:fragment-ktx", version.ref = "androidxFragment" }
lifecycle-common-java8 = { module = "androidx.lifecycle:lifecycle-common-java8", version.ref = "androidxLifecycle" }
lifecycle-runtime-ktx = { module = "androidx.lifecycle:lifecycle-runtime-ktx", version.ref = "androidxLifecycle" }
lifecycle-viewModel-ktx = { module = "androidx.lifecycle:lifecycle-viewmodel-ktx", version.ref = "androidxLifecycle" }
# region AndroidX
# region Compose
compose-ui = { module = "androidx.compose.ui:ui", version.ref = "compose-runtime" }
compose-ui-tooling = { module = "androidx.compose.ui:ui-tooling", version.ref = "compose-runtime" }
compose-animation = { module = "androidx.compose.animation:animation", version.ref = "compose-runtime" }
compose-foundation = { module = "androidx.compose.foundation:foundation", version.ref = "compose-foundation" }
compose-material = { module = "androidx.compose.material:material", version.ref = "compose-material" }
compose-constraintLayout = { module = "androidx.constraintlayout:constraintlayout-compose", version.ref = "compose-constraint" }
compose-shimmer = { module = "com.valentinilk.shimmer:compose-shimmer", version.ref = "compose-shimmer" }
compose-coil = { module = "io.coil-kt:coil-compose", version.ref = "coil" }
compose-navigation = { module = "androidx.navigation:navigation-compose", version.ref = "compose-navigation" }
compose-navigation-hilt = { module = "androidx.hilt:hilt-navigation-compose", version.ref = "hilt-navigation" }
compose-accompanist-appCompatTheme = { module = "com.google.accompanist:accompanist-appcompat-theme", version.ref = "compose-accompanist" }
compose-accompanist-systemUiController = { module = "com.google.accompanist:accompanist-systemuicontroller", version.ref = "compose-accompanist" }
compose-accompanist-webView = { module = "com.google.accompanist:accompanist-webview", version.ref = "compose-accompanist" }
# endregion Compose
# region Firebase
firebase-bom = { module = "com.google.firebase:firebase-bom", version.ref = "firebase" }
firebase-analytics = { module = "com.google.firebase:firebase-analytics-ktx" }
firebase-crashlytics = { module = "com.google.firebase:firebase-crashlytics-ktx" }
# endregion Firebase
# region Tangem
tangem-blockchain = { module = "com.tangem:blockchain", version.ref = "tangemBlockchainSdk" }
tangem-card-android = { module = "com.tangem.tangem-sdk-kotlin:android", version.ref = "tangemCardSdk" }
tangem-card-core = { module = "com.tangem.tangem-sdk-kotlin:core", version.ref = "tangemCardSdk" }
# endregion Tangem
# region Detekt
detekt-compose = { module = "ru.kode:detekt-rules-compose", version.ref = "detektComposeRules" }
detekt-formatting = { module = "io.gitlab.arturbosch.detekt:detekt-formatting", version.ref = "detekt" }
# ndregion Detekt
# region Test
test-espresso = { module = "androidx.test.espresso:espresso-core", version.ref = "espresso" }
test-junit = { module = "junit:junit", version.ref = "junit" }
test-junit-android = { module = "androidx.test.ext:junit", version.ref = "junitAndroidExt" }
test-truth = { module = "com.google.truth:truth", version.ref = "truth" }
# endregion Test
# region Other
amplitude = { module = "com.amplitude:android-sdk", version.ref = "amplitude" }
appsflyer = { module = "com.appsflyer:af-android-sdk", version.ref = "appsflyer" }
armadillo = { module = "at.favre.lib:armadillo", version.ref = "armadillo" }
coil = { module = "io.coil-kt:coil", version.ref = "coil" }
kotlin-coroutines = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "coroutine" }
desugar = { module = "com.android.tools:desugar_jdk_libs", version.ref = "desugarJdkLibs" }
googlePlay-core = { module = "com.google.android.play:core", version.ref = "googlePlayCore" }
googlePlay-core-ktx = { module = "com.google.android.play:core-ktx", version.ref = "googlePlayCoreKtx" }
googlePlay-services-wallet = { module = "com.google.android.gms:play-services-wallet", version.ref = "googlePlayServicesWallet" }
hilt-android = { module = "com.google.dagger:hilt-android", version.ref = "hilt" }
hilt-core = { module = "com.google.dagger:hilt-core", version.ref = "hilt" }
hilt-kapt = { module = "com.google.dagger:hilt-compiler", version.ref = "hilt" }
hilt-navigation = { module = "com.google.dagger:hilt-compiler", version.ref = "hilt" }
jodatime = { module = "joda-time:joda-time", version.ref = "jodatime" }
krateSharedPref = { module = "hu.autsoft:krate", version.ref = "krateSharedPref" }
kotsonGson = { module = "com.github.salomonbrys.kotson:kotson", version.ref = "kotsonGsonExt" }
lottie = { module = "com.airbnb.android:lottie", version.ref = "lottie" }
material = { module = "com.google.android.material:material", version.ref = "googleMaterialComponent" }
moshi = { module = "com.squareup.moshi:moshi", version.ref = "moshi" }
moshi-kotlin = { module = "com.squareup.moshi:moshi-kotlin", version.ref = "moshi" }
okHttp = { module = "com.squareup.okhttp3:okhttp", version.ref = "okhttp" }
okHttp-logging = { module = "com.squareup.okhttp3:logging-interceptor", version.ref = "okhttp" }
otaliastudiosCameraView = { module = "com.otaliastudios:cameraview", version.ref = "otaliastudiosCameraView" }
shopify-buy = { module = "com.shopify.mobilebuysdk:buy3", version.ref = "shopifyBuySdk" }
spongecastle-core = { module = "com.madgag.spongycastle:core", version.ref = "spongycastleCryptoCore" }
reKotlin = { module = "org.rekotlin:rekotlin", version.ref = "rekotlin" }
retrofit = { module = "com.squareup.retrofit2:retrofit", version.ref = "retrofit" }
retrofit-moshi = { module = "com.squareup.retrofit2:converter-moshi", version.ref = "retrofitMoshiConverter" }
timber = { module = "com.jakewharton.timber:timber", version.ref = "timber" }
viewBindingDelegate = { module = "com.github.kirich1409:viewbindingpropertydelegate-noreflection", version.ref = "viewBindingDelegate" }
xmlShimmer = { module = "com.github.skydoves:androidveil", version.ref = "xmlShimmer" }
zendesk-chat = { module = "com.zendesk:chat", version.ref = "zendeskChat" }
zendesk-messaging = { module = "com.zendesk:messaging", version.ref = "zendeskMessaging" }
zxing-qrBarcodeScanner = { module = "me.dm7.barcodescanner:zxing", version.ref = "zxingQrBarcodeScanner" }
zxing-qrCore = { module = "com.google.zxing:core", version.ref = "zxingQrCode" }
mviCore-watcher = { module = "com.github.badoo.mvicore:mvicore-diff", version.ref = "mviCore" }
kotlin-serialization = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinSerialization" }
# endregion Other

View file

@ -1,6 +1,6 @@
#Wed Oct 21 13:51:19 MSK 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
#Tue Mar 07 14:45:01 MSK 2023
distributionBase = GRADLE_USER_HOME
distributionUrl = https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip
distributionPath = wrapper/dists
zipStorePath = wrapper/dists
zipStoreBase = GRADLE_USER_HOME

View file

@ -1,37 +1,5 @@
plugins {
id("com.android.library")
kotlin("android")
}
android {
defaultConfig {
compileSdk = AppConfig.compileSdkVersion
minSdk = AppConfig.minSdkVersion
targetSdk = AppConfig.targetSdkVersion
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
isCoreLibraryDesugaringEnabled = false
}
buildTypes {
create("debug_beta") {
initWith(getByName("release"))
BuildConfigFieldFactory(
fields = listOf(
Field.Environment("release"),
Field.TestActionEnabled(true),
Field.LogEnabled(true),
),
builder = ::buildConfigField,
).create()
}
}
alias(deps.plugins.android.library)
alias(deps.plugins.kotlin.android)
id("configuration")
}

View file

@ -1,15 +1,10 @@
plugins {
id("java-library")
id("org.jetbrains.kotlin.jvm")
alias(deps.plugins.kotlin.jvm)
id("configuration")
}
dependencies {
/** Coroutines */
implementation(Library.coroutine)
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
implementation(deps.kotlin.coroutines)
}

1
plugins/configuration/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
/build

View file

@ -0,0 +1,27 @@
plugins {
`kotlin-dsl`
`java-gradle-plugin`
}
repositories {
google()
mavenCentral()
}
configure<JavaPluginExtension> {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
dependencies {
implementation(deps.gradle.kotlin)
implementation(deps.gradle.android)
implementation(deps.gradle.detekt)
}
gradlePlugin {
plugins.register("configuration") {
id = "configuration"
implementationClass = "com.tangem.plugin.configuration.ConfigurationPlugin"
}
}

View file

@ -0,0 +1,7 @@
dependencyResolutionManagement {
versionCatalogs {
create("deps") {
from(files("../../gradle/dependencies.toml"))
}
}
}

View file

@ -0,0 +1,30 @@
package com.tangem.plugin.configuration
import com.android.build.gradle.AppExtension
import com.android.build.gradle.LibraryExtension
import com.android.build.gradle.internal.plugins.AppPlugin
import com.android.build.gradle.internal.plugins.LibraryPlugin
import com.tangem.plugin.configuration.configurations.configure
import com.tangem.plugin.configuration.configurations.extension.configure
import org.gradle.api.Action
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.kotlin.dsl.configure
class ConfigurationPlugin : Plugin<Project> {
override fun apply(target: Project) {
target.plugins.all(startConfigurationAction(project = target))
}
private fun startConfigurationAction(project: Project) = Action<Plugin<*>> {
project.configure()
when (this) {
is AppPlugin -> {
project.configure<AppExtension> { configure(project) }
}
is LibraryPlugin -> {
project.configure<LibraryExtension> { configure(project) }
}
}
}
}

View file

@ -0,0 +1,52 @@
package com.tangem.plugin.configuration.configurations
import com.tangem.plugin.configuration.utils.findLibrary
import com.tangem.plugin.configuration.utils.findPlugin
import io.gitlab.arturbosch.detekt.CONFIGURATION_DETEKT
import io.gitlab.arturbosch.detekt.CONFIGURATION_DETEKT_PLUGINS
import io.gitlab.arturbosch.detekt.Detekt
import io.gitlab.arturbosch.detekt.extensions.DetektExtension
import org.gradle.api.Project
import org.gradle.kotlin.dsl.configure
import org.gradle.kotlin.dsl.withType
internal fun Project.configureDetektRules() {
plugins.apply(findPlugin(alias = CONFIGURATION_DETEKT).pluginId)
extensions.configure<DetektExtension> { configure(project) }
configureDetektPlugins()
configureDetektTask()
}
private fun DetektExtension.configure(project: Project) {
parallel = true
ignoreFailures = false
autoCorrect = true
buildUponDefaultConfig = true
config.setFrom(project.rootProject.files("plugins/configuration/detekt.yml"))
}
private fun Project.configureDetektPlugins() {
listOf(
findLibrary(alias = "detekt-formatting"),
findLibrary(alias = "detekt-compose"),
).forEach {
dependencies.add(CONFIGURATION_DETEKT_PLUGINS, it)
}
}
private fun Project.configureDetektTask() {
tasks.withType<Detekt> {
include("**/*.kt")
exclude("**/resources/**", "**/build/**")
reports {
sarif {
required.set(false)
}
txt {
required.set(true)
}
}
jvmTarget = "11"
}
}

View file

@ -0,0 +1,16 @@
package com.tangem.plugin.configuration.configurations
import org.gradle.api.Project
import org.gradle.kotlin.dsl.withType
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
internal fun Project.configureKotlinCompilerOptions() {
project.tasks.withType<KotlinCompile> {
kotlinOptions {
jvmTarget = "11"
allWarningsAsErrors = false
// this is required to produce a unique META-INF/*.kotlin_module files
moduleName = project.path.removePrefix(":").replace(':', '-')
}
}
}

View file

@ -0,0 +1,8 @@
package com.tangem.plugin.configuration.configurations
import org.gradle.api.Project
internal fun Project.configure() {
configureKotlinCompilerOptions()
configureDetektRules()
}

View file

@ -0,0 +1,94 @@
package com.tangem.plugin.configuration.configurations.extension
import com.android.build.gradle.AppExtension
import com.tangem.plugin.configuration.model.AppConfig
import com.tangem.plugin.configuration.model.BuildType
import com.tangem.plugin.configuration.utils.BuildConfigFieldFactory
import org.gradle.api.Project
import com.android.build.gradle.internal.dsl.BuildType as AndroidBuildType
internal fun AppExtension.configure(project: Project) {
configureCompileSdk()
configureDefaultConfig(project)
configureBuildFeatures()
configureBuildTypes()
configurePackagingOptions()
configureCompose(project)
configureCompilerOptions()
}
private fun AppExtension.configureDefaultConfig(project: Project) {
defaultConfig {
applicationId = AppConfig.packageName
minSdk = AppConfig.minSdkVersion
targetSdk = AppConfig.targetSdkVersion
versionCode = if (project.hasProperty("versionCode")) {
(project.property("versionCode") as String).toInt()
} else {
AppConfig.versionCode
}
versionName = if (project.hasProperty("versionName")) {
project.property("versionName") as String
} else {
AppConfig.versionName
}
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
}
// TODO: [REDACTED_JIRA]
private fun AppExtension.configureBuildFeatures() {
buildFeatures.apply {
viewBinding = true
}
}
private fun AppExtension.configureBuildTypes() {
buildTypes {
BuildType.values().forEach { buildVariant ->
maybeCreate(buildVariant.id).apply {
configureBuildVariant(extension = this@configureBuildTypes, buildVariant)
BuildConfigFieldFactory(
fields = buildVariant.configFields,
builder = ::buildConfigField,
).create()
}
}
}
}
private fun AndroidBuildType.configureBuildVariant(extension: AppExtension, buildType: BuildType) {
when (buildType) {
BuildType.Release -> {
isDebuggable = false
isMinifyEnabled = false
proguardFiles(extension.getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro")
}
BuildType.Debug -> {
isDebuggable = true
isMinifyEnabled = false
}
BuildType.External -> {
initWith(extension.buildTypes.getByName(BuildType.Release.id))
signingConfig = extension.signingConfigs.getByName(BuildType.Debug.id)
}
}
versionNameSuffix = buildType.versionSuffix?.let { "-$it" }
applicationIdSuffix = buildType.appIdSuffix?.let { ".$it" }
}
private fun AppExtension.configurePackagingOptions() {
packagingOptions {
resources {
excludes += "lib/x86_64/darwin/libscrypt.dylib"
excludes += "lib/x86_64/freebsd/libscrypt.so"
excludes += "lib/x86_64/linux/libscrypt.so"
excludes += "META-INF/gradle/incremental.annotation.processors"
}
}
}

View file

@ -0,0 +1,33 @@
package com.tangem.plugin.configuration.configurations.extension
import com.android.build.gradle.BaseExtension
import com.tangem.plugin.configuration.model.AppConfig
import com.tangem.plugin.configuration.utils.findVersion
import org.gradle.api.JavaVersion
import org.gradle.api.Project
internal fun BaseExtension.configureCompileSdk() {
compileSdkVersion(AppConfig.compileSdkVersion)
}
internal fun BaseExtension.configureCompilerOptions() {
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
}
internal fun BaseExtension.configureCompose(project: Project) {
val useCompose = with(project.path) {
contains(":ui") ||
contains(":presentation") ||
contains(":app") || // TODO: [REDACTED_JIRA]
contains(":tester:impl") // TODO: Rename module
}
buildFeatures.compose = useCompose
if (useCompose) {
composeOptions {
kotlinCompilerExtensionVersion = project.findVersion(alias = "compose-compiler").requiredVersion
}
}
}

View file

@ -0,0 +1,49 @@
package com.tangem.plugin.configuration.configurations.extension
import com.android.build.gradle.LibraryExtension
import com.tangem.plugin.configuration.model.AppConfig
import com.tangem.plugin.configuration.model.BuildType
import com.tangem.plugin.configuration.utils.BuildConfigFieldFactory
import org.gradle.api.Project
internal fun LibraryExtension.configure(project: Project) {
configureCompileSdk()
configureDefaultConfig()
configureBuildTypes()
configurePackagingOptions()
configureCompose(project)
configureCompilerOptions()
}
private fun LibraryExtension.configureDefaultConfig() {
defaultConfig {
minSdk = AppConfig.minSdkVersion
vectorDrawables {
useSupportLibrary = true
}
}
}
private fun LibraryExtension.configureBuildTypes() {
buildTypes {
BuildType.values().forEach { buildVariant ->
maybeCreate(buildVariant.id).apply {
BuildConfigFieldFactory(
fields = buildVariant.configFields,
builder = ::buildConfigField,
).create()
}
}
}
}
private fun LibraryExtension.configurePackagingOptions() {
packagingOptions {
resources {
excludes += "lib/x86_64/darwin/libscrypt.dylib"
excludes += "lib/x86_64/freebsd/libscrypt.so"
excludes += "lib/x86_64/linux/libscrypt.so"
excludes += "META-INF/gradle/incremental.annotation.processors"
}
}
}

View file

@ -1,4 +1,6 @@
object AppConfig {
package com.tangem.plugin.configuration.model
internal object AppConfig {
const val packageName = "com.tangem.wallet"
const val versionCode = 1
const val versionName = "1.0.0-SNAPSHOT"

View file

@ -0,0 +1,35 @@
package com.tangem.plugin.configuration.model
/**
* Build config field
*
* @property type field type
* @property name field name
* @property value field value
*/
internal sealed class BuildConfigField(val type: String, val name: String, val value: String) {
class Environment(value: String) : BuildConfigField(
type = "String",
name = "ENVIRONMENT",
value = "\"$value\"",
)
class TestActionEnabled(isEnabled: Boolean) : BuildConfigField(
type = "Boolean",
name = "TEST_ACTION_ENABLED",
value = isEnabled.toString(),
)
class LogEnabled(isEnabled: Boolean) : BuildConfigField(
type = "Boolean",
name = "LOG_ENABLED",
value = isEnabled.toString(),
)
class TesterMenuAvailability(isEnabled: Boolean) : BuildConfigField(
type = "Boolean",
name = "TESTER_MENU_ENABLED",
value = isEnabled.toString(),
)
}

View file

@ -0,0 +1,72 @@
package com.tangem.plugin.configuration.model
internal enum class BuildType(
val id: String,
val appIdSuffix: String? = null,
val versionSuffix: String? = null,
val configFields: List<BuildConfigField>,
) {
/**
* Production ready build type for clients
*
* Features:
* - Env: prod
* - Signing config: release
* - Proguard
* */
Release(
id = "release",
configFields = listOf(
BuildConfigField.Environment(value = "prod"),
BuildConfigField.TestActionEnabled(isEnabled = false),
BuildConfigField.LogEnabled(isEnabled = false),
BuildConfigField.TesterMenuAvailability(isEnabled = false),
),
),
/**
* Build type for developers
*
* Features:
* - Env: dev
* - Signing config: debug
* - Debuggable
* - Logs
* - Tester menu
* - Test action
* - Traffic sniffing
* */
Debug(
id = "debug",
appIdSuffix = "dev",
configFields = listOf(
BuildConfigField.Environment(value = "dev"),
BuildConfigField.TestActionEnabled(isEnabled = true),
BuildConfigField.LogEnabled(isEnabled = true),
BuildConfigField.TesterMenuAvailability(isEnabled = true),
),
),
/**
* Build type for QA and business
*
* Features:
* - Env: prod
* - Signing config: debug
* - Tester menu
* - Test action
* - Proguard
* */
External(
id = "debug_beta",
appIdSuffix = "debug",
versionSuffix = "debug",
configFields = listOf(
BuildConfigField.Environment(value = "prod"),
BuildConfigField.TestActionEnabled(isEnabled = true),
BuildConfigField.LogEnabled(isEnabled = false),
BuildConfigField.TesterMenuAvailability(isEnabled = true),
),
),
}

View file

@ -0,0 +1,14 @@
package com.tangem.plugin.configuration.utils
import com.tangem.plugin.configuration.model.BuildConfigField
private typealias ConfigFieldBuilder = (String, String, String) -> Unit
internal class BuildConfigFieldFactory(
private val fields: List<BuildConfigField>,
private val builder: ConfigFieldBuilder,
) {
fun create() {
fields.forEach { field -> builder(field.type, field.name, field.value) }
}
}

View file

@ -0,0 +1,28 @@
package com.tangem.plugin.configuration.utils
import org.gradle.api.Project
import org.gradle.api.artifacts.MinimalExternalModuleDependency
import org.gradle.api.artifacts.VersionCatalog
import org.gradle.api.artifacts.VersionCatalogsExtension
import org.gradle.api.artifacts.VersionConstraint
import org.gradle.kotlin.dsl.getByType
import org.gradle.plugin.use.PluginDependency
import kotlin.jvm.optionals.getOrNull
private val Project.depsVersionCatalog: VersionCatalog
get() = extensions.getByType<VersionCatalogsExtension>().named("deps")
internal fun Project.findVersion(alias: String): VersionConstraint {
return depsVersionCatalog.findVersion(alias).getOrNull()
?: error("Unable to find version $alias")
}
internal fun Project.findPlugin(alias: String): PluginDependency {
return depsVersionCatalog.findPlugin(alias).getOrNull()?.orNull
?: error("Unable to find plugin $alias")
}
internal fun Project.findLibrary(alias: String): MinimalExternalModuleDependency {
return depsVersionCatalog.findLibrary(alias).getOrNull()?.orNull
?: error("Unable to find library $alias")
}

View file

@ -1,3 +1,32 @@
pluginManagement {
repositories {
gradlePluginPortal()
google()
mavenCentral()
}
includeBuild("plugins/configuration")
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
jcenter() // unable to replace with mavenCentral() due to rekotlin and com.otaliastudios:cameraview
maven("https://nexus.tangem-tech.com/repository/maven-releases/")
maven("https://jitpack.io")
maven("https://zendesk.jfrog.io/zendesk/repo")
}
versionCatalogs {
create("deps") {
from(files("gradle/dependencies.toml"))
}
}
}
include(":app")
include(":domain")
include(":common")