From 58bbe85f2987c79eddb9760a2983d7473a5402ec Mon Sep 17 00:00:00 2001 From: Tangem Date: Tue, 7 Mar 2023 17:25:38 +0300 Subject: [PATCH] Updated on 2026-08-14 --- app/build.gradle.kts | 106 +----------------- common/build.gradle.kts | 9 +- core/analytics/build.gradle.kts | 33 +----- core/datasource/build.gradle.kts | 33 +----- core/featuretoggles/build.gradle.kts | 47 +------- core/res/build.gradle.kts | 32 +----- core/ui/build.gradle.kts | 41 +------ core/utils/build.gradle.kts | 9 +- domain/build.gradle.kts | 68 +---------- features/referral/data/build.gradle.kts | 34 +----- features/referral/domain/build.gradle.kts | 9 +- .../referral/presentation/build.gradle.kts | 42 +------ features/swap/data/build.gradle.kts | 34 +----- features/swap/domain/build.gradle.kts | 9 +- features/swap/presentation/build.gradle.kts | 43 +------ features/tester/impl/build.gradle.kts | 58 +--------- libs/auth/build.gradle.kts | 34 +----- libs/crypto/build.gradle.kts | 9 +- 18 files changed, 23 insertions(+), 627 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 8214555305..899e3cf11f 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -6,111 +6,7 @@ plugins { 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 { - // 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") + id("configuration") } dependencies { diff --git a/common/build.gradle.kts b/common/build.gradle.kts index e8259cee84..19e39fb7b0 100644 --- a/common/build.gradle.kts +++ b/common/build.gradle.kts @@ -1,9 +1,4 @@ plugins { - id("java-library") - id("org.jetbrains.kotlin.jvm") -} - -java { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + kotlin("jvm") + id("configuration") } \ No newline at end of file diff --git a/core/analytics/build.gradle.kts b/core/analytics/build.gradle.kts index 639fbbc622..a3d80803f6 100644 --- a/core/analytics/build.gradle.kts +++ b/core/analytics/build.gradle.kts @@ -3,38 +3,7 @@ plugins { 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() - } - } + id("configuration") } dependencies { diff --git a/core/datasource/build.gradle.kts b/core/datasource/build.gradle.kts index 1199f1f518..31f92aa978 100644 --- a/core/datasource/build.gradle.kts +++ b/core/datasource/build.gradle.kts @@ -3,38 +3,7 @@ plugins { 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() - } - } + id("configuration") } dependencies { diff --git a/core/featuretoggles/build.gradle.kts b/core/featuretoggles/build.gradle.kts index 84a19a537f..4c74fed994 100644 --- a/core/featuretoggles/build.gradle.kts +++ b/core/featuretoggles/build.gradle.kts @@ -3,52 +3,7 @@ plugins { 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() - } - } + id("configuration") } dependencies { diff --git a/core/res/build.gradle.kts b/core/res/build.gradle.kts index 77151f2a46..f5ba6275ef 100644 --- a/core/res/build.gradle.kts +++ b/core/res/build.gradle.kts @@ -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() - } - } + id("configuration") } \ No newline at end of file diff --git a/core/ui/build.gradle.kts b/core/ui/build.gradle.kts index 28792f7aa2..1269207e14 100644 --- a/core/ui/build.gradle.kts +++ b/core/ui/build.gradle.kts @@ -1,46 +1,7 @@ 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() - } - } + id("configuration") } dependencies { diff --git a/core/utils/build.gradle.kts b/core/utils/build.gradle.kts index 9f88778542..89f4727b11 100644 --- a/core/utils/build.gradle.kts +++ b/core/utils/build.gradle.kts @@ -1,7 +1,7 @@ plugins { - id("java-library") - id("org.jetbrains.kotlin.jvm") + kotlin("jvm") kotlin("kapt") + id("configuration") } dependencies { @@ -12,9 +12,4 @@ dependencies { /** Coroutines */ implementation(Library.coroutine) -} - -java { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 } \ No newline at end of file diff --git a/domain/build.gradle.kts b/domain/build.gradle.kts index 33ffebc8ed..849ed95c03 100644 --- a/domain/build.gradle.kts +++ b/domain/build.gradle.kts @@ -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" - } + id("configuration") } dependencies { diff --git a/features/referral/data/build.gradle.kts b/features/referral/data/build.gradle.kts index 510d84817c..78aa72d048 100644 --- a/features/referral/data/build.gradle.kts +++ b/features/referral/data/build.gradle.kts @@ -3,39 +3,7 @@ plugins { 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() - } - } + id("configuration") } dependencies { diff --git a/features/referral/domain/build.gradle.kts b/features/referral/domain/build.gradle.kts index fe5dace957..78f29434fe 100644 --- a/features/referral/domain/build.gradle.kts +++ b/features/referral/domain/build.gradle.kts @@ -1,7 +1,7 @@ plugins { - id("java-library") - id("org.jetbrains.kotlin.jvm") + kotlin("jvm") kotlin("kapt") + id("configuration") } dependencies { @@ -16,9 +16,4 @@ dependencies { /** DI */ implementation(Library.hiltCore) kapt(Library.hiltKapt) -} - -java { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 } \ No newline at end of file diff --git a/features/referral/presentation/build.gradle.kts b/features/referral/presentation/build.gradle.kts index 7096e631c0..db43d24e47 100644 --- a/features/referral/presentation/build.gradle.kts +++ b/features/referral/presentation/build.gradle.kts @@ -3,47 +3,7 @@ plugins { 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() - } - } + id("configuration") } dependencies { diff --git a/features/swap/data/build.gradle.kts b/features/swap/data/build.gradle.kts index 9f2c7c0c4d..07c5ef4c1d 100644 --- a/features/swap/data/build.gradle.kts +++ b/features/swap/data/build.gradle.kts @@ -3,39 +3,7 @@ plugins { 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() - } - } + id("configuration") } dependencies { diff --git a/features/swap/domain/build.gradle.kts b/features/swap/domain/build.gradle.kts index 87fa664521..08001ab75b 100644 --- a/features/swap/domain/build.gradle.kts +++ b/features/swap/domain/build.gradle.kts @@ -1,8 +1,8 @@ plugins { - id("java-library") - id("org.jetbrains.kotlin.jvm") + kotlin("jvm") kotlin("kapt") kotlin("plugin.serialization") + id("configuration") } dependencies { @@ -16,9 +16,4 @@ dependencies { /** Other Libraries **/ implementation(Library.kotlinSerialization) -} - -java { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 } \ No newline at end of file diff --git a/features/swap/presentation/build.gradle.kts b/features/swap/presentation/build.gradle.kts index 287b9e6ad6..e153a75e97 100644 --- a/features/swap/presentation/build.gradle.kts +++ b/features/swap/presentation/build.gradle.kts @@ -4,47 +4,7 @@ plugins { 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 - } + id("configuration") } dependencies { @@ -69,7 +29,6 @@ dependencies { /** Domain */ implementation(project(":features:swap:domain")) - implementation(project(":features:swap:data"))//todo remove, only for test /** Other libraries */ implementation(Library.composeShimmer) diff --git a/features/tester/impl/build.gradle.kts b/features/tester/impl/build.gradle.kts index 32807a6ded..bc262f1eb0 100644 --- a/features/tester/impl/build.gradle.kts +++ b/features/tester/impl/build.gradle.kts @@ -3,63 +3,7 @@ plugins { 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 - } + id("configuration") } dependencies { diff --git a/libs/auth/build.gradle.kts b/libs/auth/build.gradle.kts index b8dd6f840d..f5ba6275ef 100644 --- a/libs/auth/build.gradle.kts +++ b/libs/auth/build.gradle.kts @@ -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() - } - } + id("configuration") } \ No newline at end of file diff --git a/libs/crypto/build.gradle.kts b/libs/crypto/build.gradle.kts index de1a6876a4..a39e3425bf 100644 --- a/libs/crypto/build.gradle.kts +++ b/libs/crypto/build.gradle.kts @@ -1,15 +1,10 @@ plugins { - id("java-library") - id("org.jetbrains.kotlin.jvm") + kotlin("jvm") + id("configuration") } dependencies { /** Coroutines */ implementation(Library.coroutine) -} - -java { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 } \ No newline at end of file