Files
f7cloud_mobile/app/build.gradle
T
b-dev-mobile 67cc851b15 Этап 0 п.1: release собираем и подписан (signingConfig из env + R8-правила)
- signingConfig.release читает F7_KEYSTORE_FILE/PASSWORD, F7_KEY_ALIAS/PASSWORD
  из env или -P; фолбэк на debug-подпись если не заданы. Схемы v2+v3.
- R8: app/proguard-rules.pro (kotlinx.serialization, Firebase, JS-мосты, Coil);
  vendor consumer-rules.pro через consumerProguardFiles (WebRTC/LoganSquare/Dagger/
  RxJava/Parceler/EventBus + dontwarn geogson/joda из missing_rules.txt).
- Проверено на инфре B (JDK 21 + Android SDK 36): assembleRelease BUILD SUCCESSFUL,
  подписанный APK 99 МБ (было ~130 debug), apksigner verify v2+v3 OK.
- Доки: docs/RELEASE-SIGNING.md, docs/AUDIT-2026-07-07.md.
2026-07-07 13:17:20 +00:00

128 lines
5.6 KiB
Groovy

plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
id 'org.jetbrains.kotlin.plugin.compose'
}
def googleServicesFile = file('google-services.json')
if (googleServicesFile.exists()) {
apply plugin: 'com.google.gms.google-services'
}
// Release-подпись читается из окружения/gradle-properties (боевой keystore вне git,
// в CI — из secrets). Переменные: F7_KEYSTORE_FILE, F7_KEYSTORE_PASSWORD,
// F7_KEY_ALIAS, F7_KEY_PASSWORD (можно и как -P… gradle-property). Если не заданы —
// release подписывается debug-ключом (локальная сборка/QA работает без keystore).
def f7KeystoreFile = System.getenv('F7_KEYSTORE_FILE') ?: project.findProperty('F7_KEYSTORE_FILE')
def f7HasReleaseSigning = f7KeystoreFile != null && file(f7KeystoreFile).exists()
android {
namespace 'ru.forbion.f7cloud.mobile'
compileSdk 36
signingConfigs {
if (f7HasReleaseSigning) {
release {
storeFile file(f7KeystoreFile)
storePassword System.getenv('F7_KEYSTORE_PASSWORD') ?: project.findProperty('F7_KEYSTORE_PASSWORD')
keyAlias System.getenv('F7_KEY_ALIAS') ?: project.findProperty('F7_KEY_ALIAS')
keyPassword System.getenv('F7_KEY_PASSWORD') ?: project.findProperty('F7_KEY_PASSWORD')
// v2 обязателен (minSdk 26); v3 — под будущую ротацию ключа. v1 не нужен (minSdk>=24).
enableV1Signing false
enableV2Signing true
enableV3Signing true
}
}
}
defaultConfig {
applicationId 'ru.forbion.f7cloud.mobile'
minSdk 26
targetSdk 36
versionCode 122
versionName '0.5.114'
missingDimensionStrategy 'default', 'f7'
multiDexEnabled true
// Дефолтный адрес сервера на экране входа. Прод-URL в сборку не вшивать
// (решение integrator-b, f7_platform mail/035): для дев-сборки под свой
// стенд задать -Pf7DefaultServerUrl=https://... или f7DefaultServerUrl в
// ~/.gradle/gradle.properties. Без свойства поле входа пустое.
buildConfigField 'String', 'DEFAULT_SERVER_URL',
"\"${project.findProperty('f7DefaultServerUrl') ?: ''}\""
}
buildTypes {
debug {}
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
// боевой keystore — если задан env/-P; иначе debug-ключ (не для распространения)
signingConfig f7HasReleaseSigning ? signingConfigs.release : signingConfigs.debug
}
}
buildFeatures {
compose true
buildConfig true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = '17'
}
applicationVariants.configureEach { variant ->
variant.outputs.configureEach { output ->
def vName = variant.versionName ?: "0.0.0"
def vCode = variant.versionCode ?: 0
output.outputFileName = "f7cloud-mobile-v${vName}-${vCode}-${variant.name}.apk"
}
}
}
dependencies {
implementation project(':core:auth')
implementation project(':core:network')
implementation project(':core:push')
implementation project(':core:designsystem')
implementation project(':feature:files')
implementation project(':feature:talk')
implementation project(':feature:talk-native')
implementation project(':feature:calendar')
implementation project(':feature:contacts')
implementation project(':feature:tasks')
implementation project(':feature:deck')
implementation project(':feature:mail')
implementation project(':feature:f7support')
def composeBom = platform('androidx.compose:compose-bom:2025.02.00')
implementation composeBom
androidTestImplementation composeBom
implementation 'androidx.activity:activity-compose:1.10.1'
implementation 'androidx.compose.ui:ui'
implementation 'androidx.compose.ui:ui-tooling-preview'
implementation 'androidx.compose.material3:material3'
implementation 'androidx.navigation:navigation-compose:2.8.9'
implementation 'androidx.lifecycle:lifecycle-viewmodel-compose:2.8.7'
implementation 'androidx.lifecycle:lifecycle-runtime-compose:2.8.7'
implementation 'androidx.lifecycle:lifecycle-process:2.8.7'
implementation 'io.coil-kt:coil-compose:2.7.0'
implementation 'io.coil-kt:coil-svg:2.7.0'
implementation platform('com.google.firebase:firebase-bom:33.7.0')
implementation 'com.google.firebase:firebase-messaging'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.9.0'
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'androidx.biometric:biometric:1.1.0'
implementation 'androidx.fragment:fragment-ktx:1.8.6'
implementation 'androidx.camera:camera-camera2:1.5.2'
implementation 'androidx.camera:camera-lifecycle:1.5.2'
implementation 'androidx.camera:camera-view:1.5.2'
implementation 'com.google.zxing:core:3.3.0'
implementation 'androidx.compose.material:material-icons-extended'
implementation 'com.google.guava:guava:33.3.1-android'
debugImplementation 'androidx.compose.ui:ui-tooling'
}