Files
android-app/shared-test-code/build.gradle
2026-01-16 10:48:25 +00:00

166 lines
6.4 KiB
Groovy

/*
* Copyright (c) 2022. Proton AG
*
* This file is part of ProtonVPN.
*
* ProtonVPN is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ProtonVPN is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with ProtonVPN. If not, see <https://www.gnu.org/licenses/>.
*/
plugins {
id 'com.android.library'
id 'org.jetbrains.kotlin.android'
id 'com.google.devtools.ksp'
}
apply plugin: 'dagger.hilt.android.plugin'
android {
namespace 'com.protonvpn.test.shared'
compileSdk rootProject.ext.compileSdkVersion
defaultConfig {
minSdk rootProject.ext.minSdkVersionAmazon
consumerProguardFiles "consumer-rules.pro"
}
// Same flavors as in the app module.
flavorDimensions = ["environment", "functionality", "distribution"]
productFlavors {
production {
dimension "environment"
}
black {
dimension "environment"
}
bti {
dimension "environment"
}
vanilla {
dimension "functionality"
}
google {
dimension "functionality"
}
playStore {
dimension "distribution"
}
amazon {
dimension "distribution"
}
direct {
dimension "distribution"
}
openSource {
dimension "distribution"
}
dev {
dimension "distribution"
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
coreLibraryDesugaringEnabled = true
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_17.toString()
freeCompilerArgs += [
"-Xopt-in=kotlin.RequiresOptIn"
]
}
}
dependencies {
coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:$desugar_jdk_version"
ksp "com.google.dagger:hilt-compiler:$hilt_version"
implementation "com.google.dagger:hilt-android:$hilt_version"
implementation "com.google.dagger:hilt-android-testing:$hilt_version"
implementation 'androidx.hilt:hilt-work:1.2.0'
ksp "androidx.hilt:hilt-compiler:$hilt_compiler_version"
implementation project(':app')
implementation "me.proton.core:auth-dagger:$core_version"
implementation "me.proton.core:account-data:$core_version"
implementation "me.proton.core:account-recovery-dagger:$core_version"
implementation("me.proton.core:account-recovery-test:$core_version") {
// account-recovery modules are pulling in notification-dagger.
exclude group: "me.proton.core", module: "notification"
exclude group: "me.proton.core", module: "notification-dagger"
}
implementation "me.proton.core:configuration-data:$core_version"
implementation "me.proton.core:crypto-android:$core_version"
implementation "me.proton.core:domain:$core_version"
implementation "me.proton.core:event-manager-data:$core_version"
implementation "me.proton.core:feature-flag-data:$core_version"
implementation "me.proton.core:human-verification-data:$core_version"
implementation "me.proton.core:network-data:$core_version"
implementation "me.proton.core:network-domain:$core_version"
implementation "me.proton.core:network-presentation:$core_version"
implementation "me.proton.core:notification-data:$core_version"
implementation "me.proton.core:notification-domain:$core_version"
implementation("me.proton.core:notification-test:$core_version") {
// It's pulling in notification-dagger.
exclude group: "me.proton.core", module: "notification"
exclude group: "me.proton.core", module: "notification-dagger"
}
implementation "me.proton.core:observability-data:$core_version"
implementation "me.proton.core:payment-data:$core_version"
implementation "me.proton.core:presentation:$core_version"
implementation "me.proton.core:plan-domain:$core_version"
implementation "me.proton.core:plan-presentation:$core_version"
implementation "me.proton.core:push-data:$core_version"
implementation "me.proton.core:telemetry-data:$core_version"
implementation "me.proton.core:test-kotlin:$core_version"
implementation "me.proton.core:user-domain:$core_version"
implementation "me.proton.core:user-recovery-data:$core_version"
implementation "me.proton.core:user-settings-data:$core_version"
implementation "me.proton.core:user:$core_version"
implementation "me.proton.core:util-android-dagger:$core_version"
implementation "me.proton.core:util-android-datetime:$core_version"
implementation "me.proton.core:util-kotlin:$core_version"
implementation "androidx.datastore:datastore-core:$datastore_version"
implementation "androidx.lifecycle:lifecycle-livedata-ktx:$androidx_lifecycle_version"
implementation 'androidx.work:work-runtime:2.9.0'
implementation 'androidx.work:work-runtime-ktx:2.9.0'
implementation 'com.squareup.okhttp3:okhttp-tls:4.12.0'
implementation 'com.squareup.okhttp3:mockwebserver:4.12.0'
implementation 'com.google.guava:guava:33.2.1-android'
implementation "me.proton.test:fusion:$test_fusion_version"
implementation "me.proton.vpn:go-vpn-lib:$govpnlib_version"
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:$kotlinx_coroutines_version") {
// https://github.com/Kotlin/kotlinx.coroutines/tree/master/kotlinx-coroutines-debug#debug-agent-and-android
exclude group: "org.jetbrains.kotlinx", module: "kotlinx-coroutines-debug"
}
implementation "app.cash.turbine:turbine:$turbine_version"
implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:$kotlinx_serialization_json_version"
compileOnly "io.mockk:mockk:$mockk_version" // Tests will include mockk or mockk-android depending on type.
}