Updated on 2026-08-14
This commit is contained in:
parent
c9b99c587d
commit
7a8f55b589
8 changed files with 68 additions and 6 deletions
|
|
@ -320,6 +320,7 @@ dependencies {
|
|||
/** Chucker */
|
||||
debugImplementation(deps.chucker)
|
||||
mockedImplementation(deps.chuckerStub)
|
||||
externalImplementation(deps.chuckerStub)
|
||||
internalImplementation(deps.chuckerStub)
|
||||
releaseImplementation(deps.chuckerStub)
|
||||
|
||||
|
|
|
|||
|
|
@ -59,9 +59,41 @@ val assembleInternalQA by tasks.registering {
|
|||
}
|
||||
}
|
||||
|
||||
val assembleExternalQA by tasks.registering {
|
||||
group = "build"
|
||||
description = "Builds external APK to 'build/outputs' directory"
|
||||
|
||||
val appOutputApkDir = "$projectDir/app/build/outputs/apk/external"
|
||||
val rootOutputApkDir = "$buildDir/outputs"
|
||||
val injected = objects.newInstance<Injected>()
|
||||
|
||||
dependsOn(":app:assembleExternal")
|
||||
|
||||
doFirst {
|
||||
injected.fs.delete {
|
||||
delete(appOutputApkDir)
|
||||
delete("$rootOutputApkDir/app-external.apk")
|
||||
}
|
||||
}
|
||||
doLast {
|
||||
injected.fs.copy {
|
||||
from("$appOutputApkDir/app-external.apk")
|
||||
into(rootOutputApkDir)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val assembleQA by tasks.registering {
|
||||
group = "build"
|
||||
description = "Builds internal and external APKs to 'build/outputs' directory"
|
||||
|
||||
dependsOn(assembleInternalQA)
|
||||
dependsOn(assembleExternalQA)
|
||||
}
|
||||
|
||||
val generateComposeMetrics by tasks.registering {
|
||||
group = "other"
|
||||
description = "Build internal APK and generates compose metrics to 'build/compose-metrics' directory"
|
||||
description = "Build external APK and generates compose metrics to 'build/compose-metrics' directory"
|
||||
|
||||
subprojects {
|
||||
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
|
||||
|
|
@ -86,5 +118,5 @@ val generateComposeMetrics by tasks.registering {
|
|||
}
|
||||
}
|
||||
|
||||
finalizedBy(assembleInternalQA)
|
||||
finalizedBy(assembleExternalQA)
|
||||
}
|
||||
|
|
@ -72,6 +72,7 @@ dependencies {
|
|||
/** Chucker */
|
||||
debugImplementation(deps.chucker)
|
||||
mockedImplementation(deps.chuckerStub)
|
||||
externalImplementation(deps.chuckerStub)
|
||||
internalImplementation(deps.chuckerStub)
|
||||
releaseImplementation(deps.chuckerStub)
|
||||
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@ sealed class ApiConfig {
|
|||
internal const val DEBUG_BUILD_TYPE = "debug"
|
||||
internal const val INTERNAL_BUILD_TYPE = "internal"
|
||||
internal const val MOCKED_BUILD_TYPE = "mocked"
|
||||
internal const val EXTERNAL_BUILD_TYPE = "external"
|
||||
internal const val RELEASE_BUILD_TYPE = "release"
|
||||
}
|
||||
}
|
||||
|
|
@ -73,6 +73,7 @@ internal class Express(
|
|||
INTERNAL_BUILD_TYPE,
|
||||
MOCKED_BUILD_TYPE,
|
||||
-> ApiEnvironment.STAGE
|
||||
EXTERNAL_BUILD_TYPE,
|
||||
RELEASE_BUILD_TYPE,
|
||||
-> ApiEnvironment.PROD
|
||||
else -> error("Unknown build type [${BuildConfig.BUILD_TYPE}]")
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import com.tangem.datasource.BuildConfig
|
|||
import com.tangem.datasource.api.common.AuthProvider
|
||||
import com.tangem.datasource.api.common.config.*
|
||||
import com.tangem.datasource.api.common.config.ApiConfig.Companion.DEBUG_BUILD_TYPE
|
||||
import com.tangem.datasource.api.common.config.ApiConfig.Companion.EXTERNAL_BUILD_TYPE
|
||||
import com.tangem.datasource.api.common.config.ApiConfig.Companion.INTERNAL_BUILD_TYPE
|
||||
import com.tangem.datasource.api.common.config.ApiConfig.Companion.MOCKED_BUILD_TYPE
|
||||
import com.tangem.datasource.api.common.config.ApiConfig.Companion.RELEASE_BUILD_TYPE
|
||||
|
|
@ -100,6 +101,7 @@ internal class ProdApiConfigsManagerTest(private val model: Model) {
|
|||
INTERNAL_BUILD_TYPE,
|
||||
MOCKED_BUILD_TYPE,
|
||||
-> ApiEnvironment.STAGE
|
||||
EXTERNAL_BUILD_TYPE,
|
||||
RELEASE_BUILD_TYPE,
|
||||
-> ApiEnvironment.PROD
|
||||
else -> error("Unknown build type [${BuildConfig.BUILD_TYPE}]")
|
||||
|
|
@ -115,6 +117,7 @@ internal class ProdApiConfigsManagerTest(private val model: Model) {
|
|||
INTERNAL_BUILD_TYPE,
|
||||
MOCKED_BUILD_TYPE,
|
||||
-> "[REDACTED_ENV_URL]"
|
||||
EXTERNAL_BUILD_TYPE,
|
||||
RELEASE_BUILD_TYPE,
|
||||
-> "https://express.tangem.com/v1/"
|
||||
else -> error("Unknown build type [${BuildConfig.BUILD_TYPE}]")
|
||||
|
|
|
|||
|
|
@ -69,17 +69,19 @@ private fun AppExtension.configureBuildTypes() {
|
|||
|
||||
private fun AndroidBuildType.configureBuildVariant(appExtension: AppExtension, buildType: BuildType) {
|
||||
when (buildType) {
|
||||
BuildType.Release -> {
|
||||
isDebuggable = false
|
||||
}
|
||||
BuildType.Debug -> {
|
||||
isDebuggable = true
|
||||
}
|
||||
BuildType.Internal -> {
|
||||
BuildType.Internal,
|
||||
BuildType.External
|
||||
-> {
|
||||
initWith(appExtension.buildTypes.getByName(BuildType.Release.id))
|
||||
matchingFallbacks.add(BuildType.Release.id)
|
||||
signingConfig = appExtension.signingConfigs.getByName(BuildType.Debug.id)
|
||||
}
|
||||
BuildType.Release -> {
|
||||
isDebuggable = false
|
||||
}
|
||||
BuildType.Mocked -> {
|
||||
initWith(appExtension.buildTypes.getByName(BuildType.Release.id))
|
||||
matchingFallbacks.add(BuildType.Release.id)
|
||||
|
|
|
|||
|
|
@ -78,6 +78,27 @@ internal enum class BuildType(
|
|||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Build type for QA and business
|
||||
*
|
||||
* Features:
|
||||
* - Env: prod
|
||||
* - Signing config: debug
|
||||
* - Proguard
|
||||
* */
|
||||
External(
|
||||
id = "external",
|
||||
appIdSuffix = "external",
|
||||
versionSuffix = "external",
|
||||
configFields = listOf(
|
||||
BuildConfigField.Environment(value = "prod"),
|
||||
BuildConfigField.TestActionEnabled(isEnabled = false),
|
||||
BuildConfigField.LogEnabled(isEnabled = false),
|
||||
BuildConfigField.TesterMenuAvailability(isEnabled = false),
|
||||
BuildConfigField.MockDataSource(isEnabled = false),
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Production ready build type for clients
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue