Updated on 2026-08-14
This commit is contained in:
parent
e0f90419f4
commit
a6e04a4344
21 changed files with 540 additions and 359 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -29,3 +29,4 @@ local.properties
|
|||
**/fastlane/Preview.html
|
||||
**/fastlane/screenshots
|
||||
**/fastlane/test_output
|
||||
/buildSrc/build/
|
||||
|
|
|
|||
187
app/build.gradle
187
app/build.gradle
|
|
@ -1,187 +0,0 @@
|
|||
apply plugin: 'com.android.application'
|
||||
apply plugin: 'kotlin-android'
|
||||
apply plugin: 'kotlin-kapt'
|
||||
apply plugin: 'com.google.gms.google-services'
|
||||
apply plugin: 'com.google.firebase.crashlytics'
|
||||
apply from: '../dependencies.gradle'
|
||||
|
||||
android {
|
||||
compileSdkVersion 33
|
||||
defaultConfig {
|
||||
applicationId "com.tangem.wallet"
|
||||
versionCode project.hasProperty('versionCode') ? project.property('versionCode') as int : 1
|
||||
versionName project.hasProperty('versionName') ? project.property('versionName') : "1.0.0.-SNAPSHOT"
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 33
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
|
||||
buildConfigField 'Boolean', environmentConfig.testActionEnabled, 'false'
|
||||
buildConfigField 'Boolean', environmentConfig.logEnabled, 'false'
|
||||
}
|
||||
buildFeatures {
|
||||
compose true
|
||||
viewBinding true
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
debuggable false
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
signingConfig signingConfigs.debug
|
||||
buildConfigField 'String', environmentConfig.environment, '\"prod\"'
|
||||
buildConfigField 'Boolean', environmentConfig.testActionEnabled, 'false'
|
||||
buildConfigField 'Boolean', environmentConfig.logEnabled, 'false'
|
||||
}
|
||||
debug {
|
||||
debuggable true
|
||||
minifyEnabled false
|
||||
applicationIdSuffix ".dev"
|
||||
signingConfig signingConfigs.debug
|
||||
firebaseCrashlytics {
|
||||
mappingFileUploadEnabled false
|
||||
}
|
||||
buildConfigField 'String', environmentConfig.environment, '\"dev\"'
|
||||
buildConfigField 'Boolean', environmentConfig.testActionEnabled, 'true'
|
||||
buildConfigField 'Boolean', environmentConfig.logEnabled, 'true'
|
||||
}
|
||||
debug_beta {
|
||||
initWith release
|
||||
debuggable false
|
||||
versionNameSuffix "-beta"
|
||||
applicationIdSuffix ".debug"
|
||||
buildConfigField 'String', environmentConfig.environment, '\"prod\"'
|
||||
buildConfigField 'Boolean', environmentConfig.testActionEnabled, 'false'
|
||||
buildConfigField 'Boolean', environmentConfig.logEnabled, 'false'
|
||||
}
|
||||
|
||||
}
|
||||
kotlinOptions {
|
||||
jvmTarget = JavaVersion.VERSION_1_8.toString()
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
coreLibraryDesugaringEnabled false
|
||||
}
|
||||
composeOptions {
|
||||
kotlinCompilerExtensionVersion '1.1.0'
|
||||
}
|
||||
packagingOptions {
|
||||
exclude 'lib/x86_64/darwin/libscrypt.dylib'
|
||||
exclude 'lib/x86_64/freebsd/libscrypt.so'
|
||||
exclude 'lib/x86_64/linux/libscrypt.so'
|
||||
}
|
||||
}
|
||||
|
||||
repositories {
|
||||
maven { url "https://jitpack.io" }
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(include: ['*.aar'], dir: 'libs')
|
||||
implementation implementation(project(path: ':domain'))
|
||||
implementation implementation(project(path: ':network'))
|
||||
implementation implementation(project(path: ':common'))
|
||||
|
||||
implementation 'androidx.core:core-ktx:1.9.0'
|
||||
implementation 'androidx.appcompat:appcompat:1.5.1'
|
||||
implementation 'androidx.fragment:fragment-ktx:1.5.3'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
|
||||
implementation 'com.google.android.material:material:1.6.1'
|
||||
implementation 'com.google.android.play:core:1.10.3'
|
||||
implementation 'com.google.android.play:core-ktx:1.8.1'
|
||||
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
|
||||
|
||||
implementation "com.tangem:blockchain:${versions.tangem_blockchain_sdk}"
|
||||
implementation "com.tangem.tangem-sdk-kotlin:core:${versions.tangem_card_sdk}"
|
||||
implementation "com.tangem.tangem-sdk-kotlin:android:${versions.tangem_card_sdk}"
|
||||
|
||||
// WebView
|
||||
implementation "androidx.browser:browser:1.4.0"
|
||||
|
||||
implementation 'com.jakewharton.timber:timber:4.7.1'
|
||||
|
||||
//lifecycle
|
||||
implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.5.1"
|
||||
implementation "androidx.lifecycle:lifecycle-common-java8:2.5.1"
|
||||
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1"
|
||||
implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.5.1"
|
||||
|
||||
implementation "org.rekotlin:rekotlin:1.0.4"
|
||||
|
||||
// QR
|
||||
implementation 'com.google.zxing:core:3.3.3'
|
||||
implementation 'me.dm7.barcodescanner:zxing:1.9.8'
|
||||
|
||||
// Camera
|
||||
implementation 'com.otaliastudios:cameraview:2.6.3'
|
||||
|
||||
// Image Loading
|
||||
implementation 'io.coil-kt:coil:2.1.0'
|
||||
implementation 'io.coil-kt:coil-compose:2.1.0'
|
||||
|
||||
// Firebase
|
||||
implementation platform('com.google.firebase:firebase-bom:26.0.0')
|
||||
implementation 'com.google.firebase:firebase-analytics-ktx'
|
||||
implementation 'com.google.firebase:firebase-crashlytics-ktx'
|
||||
|
||||
// Analytics
|
||||
implementation 'com.appsflyer:af-android-sdk:6.5.1'
|
||||
implementation 'com.amplitude:android-sdk:2.36.1'
|
||||
|
||||
// WalletConnect
|
||||
implementation 'com.github.salomonbrys.kotson:kotson:2.5.0'
|
||||
|
||||
// Network and Json
|
||||
//TODO: refactoring: remove it when all network services moved to the network module
|
||||
implementation 'com.squareup.retrofit2:retrofit:2.8.1'
|
||||
implementation 'com.squareup.retrofit2:converter-moshi:2.6.0'
|
||||
implementation 'com.squareup.moshi:moshi:1.12.0'
|
||||
implementation "com.squareup.moshi:moshi-kotlin:1.12.0"
|
||||
|
||||
implementation(platform("com.squareup.okhttp3:okhttp-bom:4.9.3"))
|
||||
implementation("com.squareup.okhttp3:okhttp")
|
||||
implementation("com.squareup.okhttp3:logging-interceptor")
|
||||
|
||||
// Support
|
||||
implementation("com.zendesk:chat:3.3.5")
|
||||
implementation("com.zendesk:messaging:5.2.4")
|
||||
|
||||
//Crypto
|
||||
implementation "com.madgag.spongycastle:core:1.58.0.0"
|
||||
|
||||
// animation
|
||||
implementation "com.airbnb.android:lottie:3.4.0"
|
||||
|
||||
// Shopify
|
||||
implementation('com.shopify.mobilebuysdk:buy3:12.0.0') {
|
||||
exclude group: "com.shopify.graphql.support"
|
||||
exclude module: 'joda-time'
|
||||
}
|
||||
|
||||
// Google Pay
|
||||
implementation 'com.google.android.gms:play-services-wallet:19.1.0'
|
||||
|
||||
//Compose
|
||||
implementation 'androidx.activity:activity-compose:1.5.0'
|
||||
implementation 'androidx.compose.material:material:1.1.1'
|
||||
implementation 'androidx.compose.animation:animation:1.1.1'
|
||||
implementation 'androidx.compose.foundation:foundation:1.2.0-rc03'
|
||||
implementation 'androidx.compose.ui:ui:1.1.1'
|
||||
implementation 'androidx.compose.ui:ui-tooling:1.1.1'
|
||||
implementation "com.google.accompanist:accompanist-appcompat-theme:0.23.0"
|
||||
implementation "com.google.accompanist:accompanist-systemuicontroller:0.23.0"
|
||||
|
||||
implementation "com.github.skydoves:androidveil:1.1.2"
|
||||
|
||||
implementation 'com.github.kirich1409:viewbindingpropertydelegate-noreflection:1.5.6'
|
||||
|
||||
// Shared preferences (encrypted)
|
||||
implementation 'at.favre.lib:armadillo:0.9.0'
|
||||
|
||||
testImplementation 'junit:junit:4.13.2'
|
||||
testImplementation "com.google.truth:truth:1.1.3"
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
|
||||
|
||||
}
|
||||
182
app/build.gradle.kts
Normal file
182
app/build.gradle.kts
Normal file
|
|
@ -0,0 +1,182 @@
|
|||
plugins {
|
||||
id("com.android.application")
|
||||
kotlin("android")
|
||||
kotlin("kapt")
|
||||
id("com.google.gms.google-services")
|
||||
id("com.google.firebase.crashlytics")
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdk = AppConfig.compileSdkVersion
|
||||
|
||||
defaultConfig {
|
||||
applicationId = AppConfig.packageName
|
||||
minSdk = AppConfig.minSdkVersion
|
||||
targetSdk = AppConfig.targetSdkVersion
|
||||
|
||||
versionCode = if (project.hasProperty("versionCode")) {
|
||||
project.property("versionCode") as Int
|
||||
} 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),
|
||||
),
|
||||
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),
|
||||
),
|
||||
builder = ::buildConfigField,
|
||||
).create()
|
||||
}
|
||||
|
||||
create("debug_beta") {
|
||||
initWith(getByName("release"))
|
||||
versionNameSuffix = "-beta"
|
||||
applicationIdSuffix = ".debug"
|
||||
}
|
||||
}
|
||||
|
||||
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"
|
||||
}
|
||||
}
|
||||
|
||||
repositories {
|
||||
maven(url = "https://jitpack.io")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.aar"))))
|
||||
implementation(project(":domain"))
|
||||
implementation(project(":network"))
|
||||
implementation(project(":common"))
|
||||
|
||||
/** 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)
|
||||
|
||||
/** Compose libraries */
|
||||
implementation(Compose.material)
|
||||
implementation(Compose.animation)
|
||||
implementation(Compose.foundation)
|
||||
implementation(Compose.ui)
|
||||
implementation(Compose.uiTooling)
|
||||
implementation(Compose.coil)
|
||||
|
||||
/** Firebase libraries */
|
||||
implementation(platform(Firebase.bom))
|
||||
implementation(Firebase.firebaseAnalytics)
|
||||
implementation(Firebase.firebaseCrashlytics)
|
||||
|
||||
/** Tangem libraries */
|
||||
implementation(Tangem.blockchain)
|
||||
implementation(Tangem.cardCore)
|
||||
implementation(Tangem.cardAndroid)
|
||||
|
||||
/** 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)
|
||||
//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) {
|
||||
exclude(group = "com.shopify.graphql.support")
|
||||
exclude(module = "joda-time")
|
||||
}
|
||||
implementation(Library.accompanistAppCompatTheme)
|
||||
implementation(Library.accompanistSystemUiController)
|
||||
implementation(Library.skydovesVeil)
|
||||
implementation(Library.viewBindingDelegate)
|
||||
implementation(Library.armadillo)
|
||||
implementation(Library.googlePlayServicesWallet)
|
||||
|
||||
/** Testing libraries */
|
||||
testImplementation(Test.junit)
|
||||
testImplementation(Test.truth)
|
||||
androidTestImplementation(Test.junitAndroidExt)
|
||||
androidTestImplementation(Test.espresso)
|
||||
}
|
||||
2
app/proguard-rules.pro
vendored
2
app/proguard-rules.pro
vendored
|
|
@ -1,6 +1,6 @@
|
|||
# Add project specific ProGuard rules here.
|
||||
# You can control the set of applied configuration files using the
|
||||
# proguardFiles setting in build.gradle.
|
||||
# proguardFiles setting in build.gradle.kts.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
|
|
|||
31
build.gradle
31
build.gradle
|
|
@ -1,31 +0,0 @@
|
|||
buildscript {
|
||||
apply from: 'dependencies.gradle'
|
||||
|
||||
repositories {
|
||||
google()
|
||||
jcenter()
|
||||
maven { url 'https://maven.fabric.io/public' }
|
||||
}
|
||||
dependencies {
|
||||
classpath "com.android.tools.build:gradle:${versions.build_gradle}"
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$versions.kotlin"
|
||||
classpath "com.github.dcendents:android-maven-gradle-plugin:2.1"
|
||||
classpath 'com.google.gms:google-services:4.3.10'
|
||||
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.7.1'
|
||||
}
|
||||
}
|
||||
|
||||
allprojects {
|
||||
repositories {
|
||||
google()
|
||||
jcenter()
|
||||
mavenLocal()
|
||||
maven { url "https://nexus.tangem-tech.com/repository/maven-releases/" }
|
||||
maven { url 'https://jitpack.io' }
|
||||
maven { url 'https://zendesk.jfrog.io/zendesk/repo' }
|
||||
}
|
||||
}
|
||||
|
||||
task clean(type: Delete) {
|
||||
delete rootProject.buildDir
|
||||
}
|
||||
30
build.gradle.kts
Normal file
30
build.gradle.kts
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
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)
|
||||
}
|
||||
}
|
||||
|
||||
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")
|
||||
}
|
||||
}
|
||||
|
||||
tasks.register("clean", Delete::class) {
|
||||
delete(rootProject.buildDir)
|
||||
}
|
||||
7
buildSrc/build.gradle.kts
Normal file
7
buildSrc/build.gradle.kts
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
plugins {
|
||||
`kotlin-dsl`
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
8
buildSrc/src/main/java/AppConfig.kt
Normal file
8
buildSrc/src/main/java/AppConfig.kt
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
object AppConfig {
|
||||
const val packageName = "com.tangem.wallet"
|
||||
const val versionCode = 1
|
||||
const val versionName = "1.0.0.-SNAPSHOT"
|
||||
const val minSdkVersion = 21
|
||||
const val targetSdkVersion = 33
|
||||
const val compileSdkVersion = 33
|
||||
}
|
||||
9
buildSrc/src/main/java/ClasspathDependency.kt
Normal file
9
buildSrc/src/main/java/ClasspathDependency.kt
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
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
|
||||
}
|
||||
26
buildSrc/src/main/java/ConfigFieldBuilder.kt
Normal file
26
buildSrc/src/main/java/ConfigFieldBuilder.kt
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
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("String", "ENVIRONMENT", "\"$value\"")
|
||||
|
||||
class TestActionEnabled(isEnabled: Boolean) : Field("Boolean","TEST_ACTION_ENABLED", isEnabled.toString())
|
||||
|
||||
class LogEnabled(isEnabled: Boolean) : Field("Boolean","LOG_ENABLED", isEnabled.toString())
|
||||
}
|
||||
77
buildSrc/src/main/java/Dependency.kt
Normal file
77
buildSrc/src/main/java/Dependency.kt
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
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 material = "androidx.compose.material:material:" + Versions.compose
|
||||
const val ui = "androidx.compose.ui:ui:" + Versions.compose
|
||||
const val uiTooling = "androidx.compose.ui:ui-tooling:" + Versions.compose
|
||||
}
|
||||
|
||||
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 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 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 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 skydovesVeil = "com.github.skydoves:androidveil:" + Versions.skydovesAndroidVeil
|
||||
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 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
|
||||
}
|
||||
|
||||
object Tangem {
|
||||
const val blockchain = "com.tangem:blockchain:" + Versions.tangemBlockchainSdk
|
||||
const val cardAndroid = "com.tangem.tangem-sdk-kotlin:android:" + Versions.tangemCardSgk
|
||||
const val cardCore = "com.tangem.tangem-sdk-kotlin:core:" + Versions.tangemCardSgk
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
68
buildSrc/src/main/java/Versions.kt
Normal file
68
buildSrc/src/main/java/Versions.kt
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
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.6.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.1.0"
|
||||
const val composeFoundation = "1.2.0-rc03"
|
||||
// endregion Compose
|
||||
|
||||
// region Other libraries
|
||||
const val accompanist = "0.23.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 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 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 skydovesAndroidVeil = "1.1.2"
|
||||
const val spongycastleCryptoCore = "1.58.0.0"
|
||||
const val timber = "4.7.1"
|
||||
const val viewBindingDelegate = "1.5.6"
|
||||
const val zendeskChat = "3.3.5"
|
||||
const val zendeskMessaging = "5.2.4"
|
||||
const val zxingQrBarcodeScanner = "1.9.8"
|
||||
const val zxingQrCode = "3.3.3"
|
||||
// endregion Other libraries
|
||||
|
||||
// region Tangem
|
||||
const val tangemBlockchainSdk = "develop-133"
|
||||
const val tangemCardSgk = "develop-165"
|
||||
// endregion Tangem
|
||||
|
||||
// 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
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
plugins {
|
||||
id 'java-library'
|
||||
id 'org.jetbrains.kotlin.jvm'
|
||||
id("java-library")
|
||||
id("org.jetbrains.kotlin.jvm")
|
||||
}
|
||||
|
||||
java {
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
ext.versions = [
|
||||
kotlin : '1.6.10',
|
||||
build_gradle : '7.1.3',
|
||||
tangem_card_sdk : 'develop-165',
|
||||
// tangem_card_sdk : '0.0.1',
|
||||
tangem_blockchain_sdk: 'develop-133',
|
||||
// tangem_blockchain_sdk: '0.0.1',
|
||||
]
|
||||
|
||||
ext.environmentConfig = [
|
||||
environment : "ENVIRONMENT",
|
||||
testActionEnabled: "TEST_ACTION_ENABLED",
|
||||
logEnabled : "LOG_ENABLED",
|
||||
]
|
||||
|
|
@ -1,88 +0,0 @@
|
|||
plugins {
|
||||
id 'com.android.library'
|
||||
id 'org.jetbrains.kotlin.android'
|
||||
}
|
||||
|
||||
apply from: '../dependencies.gradle'
|
||||
|
||||
android {
|
||||
compileSdk 31
|
||||
|
||||
defaultConfig {
|
||||
minSdk 21
|
||||
targetSdk 31
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
consumerProguardFiles "consumer-rules.pro"
|
||||
buildConfigField 'Boolean', environmentConfig.testActionEnabled, 'false'
|
||||
buildConfigField 'Boolean', environmentConfig.logEnabled, 'false'
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
debuggable false
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
buildConfigField 'Boolean', environmentConfig.testActionEnabled, 'false'
|
||||
buildConfigField 'Boolean', environmentConfig.logEnabled, 'false'
|
||||
}
|
||||
debug {
|
||||
debuggable true
|
||||
minifyEnabled false
|
||||
buildConfigField 'Boolean', environmentConfig.testActionEnabled, 'true'
|
||||
buildConfigField 'Boolean', environmentConfig.logEnabled, 'true'
|
||||
}
|
||||
debug_beta {
|
||||
initWith release
|
||||
buildConfigField 'Boolean', environmentConfig.testActionEnabled, 'true'
|
||||
buildConfigField 'Boolean', environmentConfig.logEnabled, 'true'
|
||||
}
|
||||
}
|
||||
kotlinOptions {
|
||||
jvmTarget = JavaVersion.VERSION_1_8.toString()
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
// composeOptions {
|
||||
// kotlinCompilerExtensionVersion '1.1.0'
|
||||
// }
|
||||
packagingOptions {
|
||||
exclude 'lib/x86_64/darwin/libscrypt.dylib'
|
||||
exclude 'lib/x86_64/freebsd/libscrypt.so'
|
||||
exclude 'lib/x86_64/linux/libscrypt.so'
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation implementation(project(path: ':network'))
|
||||
implementation implementation(project(path: ':common'))
|
||||
|
||||
implementation "com.tangem:blockchain:${versions.tangem_blockchain_sdk}"
|
||||
implementation "com.tangem.tangem-sdk-kotlin:core:${versions.tangem_card_sdk}"
|
||||
implementation "com.tangem.tangem-sdk-kotlin:android:${versions.tangem_card_sdk}"
|
||||
|
||||
// Kotlin coroutines
|
||||
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2'
|
||||
|
||||
// State management
|
||||
implementation "org.rekotlin:rekotlin:1.0.4"
|
||||
|
||||
// Network
|
||||
//TODO: it must depends from network module
|
||||
implementation 'com.squareup.retrofit2:retrofit:2.8.1'
|
||||
implementation 'com.squareup.retrofit2:converter-moshi:2.6.0'
|
||||
implementation 'com.squareup.moshi:moshi:1.12.0'
|
||||
implementation "com.squareup.moshi:moshi-kotlin:1.12.0"
|
||||
implementation 'com.squareup.okhttp3:logging-interceptor:4.2.2'
|
||||
|
||||
// Logs
|
||||
implementation 'com.jakewharton.timber:timber:4.7.1'
|
||||
|
||||
// Tests
|
||||
testImplementation 'junit:junit:4.13.2'
|
||||
testImplementation "com.google.truth:truth:1.1.3"
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
|
||||
}
|
||||
98
domain/build.gradle.kts
Normal file
98
domain/build.gradle.kts
Normal file
|
|
@ -0,0 +1,98 @@
|
|||
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"
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(project(":network"))
|
||||
implementation(project(":common"))
|
||||
|
||||
/** Tangem libraries */
|
||||
implementation(Tangem.blockchain)
|
||||
implementation(Tangem.cardCore)
|
||||
implementation(Tangem.cardAndroid)
|
||||
|
||||
/** Other libraries */
|
||||
implementation(Library.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)
|
||||
|
||||
/** Testing libraries */
|
||||
testImplementation(Test.junit)
|
||||
testImplementation(Test.truth)
|
||||
androidTestImplementation(Test.junitAndroidExt)
|
||||
androidTestImplementation(Test.espresso)
|
||||
}
|
||||
2
domain/proguard-rules.pro
vendored
2
domain/proguard-rules.pro
vendored
|
|
@ -1,6 +1,6 @@
|
|||
# Add project specific ProGuard rules here.
|
||||
# You can control the set of applied configuration files using the
|
||||
# proguardFiles setting in build.gradle.
|
||||
# proguardFiles setting in build.gradle.kts.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
|
|
|||
|
|
@ -1,31 +0,0 @@
|
|||
plugins {
|
||||
id 'java-library'
|
||||
id 'org.jetbrains.kotlin.jvm'
|
||||
}
|
||||
|
||||
java {
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
targetCompatibility = JavaVersion.VERSION_1_8
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation implementation(project(path: ':common'))
|
||||
|
||||
// Tangem sdk's
|
||||
implementation "com.tangem.tangem-sdk-kotlin:core:${versions.tangem_card_sdk}"
|
||||
|
||||
// Kotlin coroutines
|
||||
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2'
|
||||
|
||||
// Logs
|
||||
implementation 'com.jakewharton.timber:timber:4.7.1'
|
||||
|
||||
// Network
|
||||
implementation(platform("com.squareup.okhttp3:okhttp-bom:4.9.3"))
|
||||
implementation("com.squareup.okhttp3:okhttp")
|
||||
implementation("com.squareup.okhttp3:logging-interceptor")
|
||||
implementation 'com.squareup.retrofit2:retrofit:2.8.1'
|
||||
implementation 'com.squareup.retrofit2:converter-moshi:2.6.0'
|
||||
implementation 'com.squareup.moshi:moshi:1.13.0'
|
||||
implementation "com.squareup.moshi:moshi-kotlin:1.13.0"
|
||||
}
|
||||
26
network/build.gradle.kts
Normal file
26
network/build.gradle.kts
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
plugins {
|
||||
id("java-library")
|
||||
id("org.jetbrains.kotlin.jvm")
|
||||
}
|
||||
|
||||
java {
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
targetCompatibility = JavaVersion.VERSION_1_8
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(project(":common"))
|
||||
|
||||
/** Tangem libraries */
|
||||
implementation(Tangem.cardCore)
|
||||
|
||||
/** Other libraries */
|
||||
implementation(Library.retrofit)
|
||||
implementation(Library.retrofitMoshiConverter)
|
||||
implementation(Library.moshi)
|
||||
implementation(Library.moshiKotlin)
|
||||
implementation(Library.okHttp)
|
||||
implementation(Library.okHttpLogging)
|
||||
implementation(Library.timber)
|
||||
implementation(Library.coroutine)
|
||||
}
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
include ':app'
|
||||
include ':domain'
|
||||
include ':network'
|
||||
include ':common'
|
||||
4
settings.gradle.kts
Normal file
4
settings.gradle.kts
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
include(":app")
|
||||
include(":domain")
|
||||
include(":network")
|
||||
include(":common")
|
||||
Loading…
Add table
Add a link
Reference in a new issue