wgtunnel/app/build.gradle.kts

201 lines
6.4 KiB
Plaintext
Raw Normal View History

import java.util.Properties
2023-05-24 01:33:20 -04:00
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.hilt.android)
2023-05-24 01:33:20 -04:00
id("org.jetbrains.kotlin.plugin.serialization")
alias(libs.plugins.ksp)
2023-05-24 01:33:20 -04:00
}
android {
namespace = Constants.APP_ID
compileSdk = Constants.TARGET_SDK
2023-05-24 01:33:20 -04:00
defaultConfig {
applicationId = Constants.APP_ID
minSdk = Constants.MIN_SDK
targetSdk = Constants.TARGET_SDK
versionCode = Constants.VERSION_CODE
versionName = Constants.VERSION_NAME
ksp {
arg("room.schemaLocation", "$projectDir/schemas")
}
resourceConfigurations.addAll(listOf("en"))
2023-05-24 01:33:20 -04:00
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
useSupportLibrary = true
}
}
signingConfigs {
create("release") {
val properties = Properties().apply {
//created local file for signing details
try {
load(file("signing.properties").reader())
} catch (_ : Exception) {
load(file("signing_template.properties").reader())
}
}
//try to get secrets from env first for pipeline build, then properties file for local build
storeFile = file(System.getenv().getOrDefault(Constants.KEY_STORE_PATH_VAR, properties.getProperty(Constants.KEY_STORE_PATH_VAR)))
storePassword = System.getenv().getOrDefault(Constants.STORE_PASS_VAR, properties.getProperty(Constants.STORE_PASS_VAR))
keyAlias = System.getenv().getOrDefault(Constants.KEY_ALIAS_VAR, properties.getProperty(Constants.KEY_ALIAS_VAR))
keyPassword = System.getenv().getOrDefault(Constants.KEY_PASS_VAR, properties.getProperty(Constants.KEY_PASS_VAR))
}
}
2023-05-24 01:33:20 -04:00
buildTypes {
2023-11-08 22:39:51 -05:00
//don't strip
packaging.jniLibs.keepDebugSymbols.addAll(listOf("libwg-go.so", "libwg-quick.so", "libwg.so"))
applicationVariants.all {
val variant = this
variant.outputs
.map { it as com.android.build.gradle.internal.api.BaseVariantOutputImpl }
.forEach { output ->
val outputFileName = "wgtunnel-${variant.flavorName}-${variant.buildType.name}-${variant.versionName}.apk"
output.outputFileName = outputFileName
}
}
2023-05-24 01:33:20 -04:00
release {
isDebuggable = false
isMinifyEnabled = true
isShrinkResources = true
2023-05-24 01:33:20 -04:00
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
signingConfig = signingConfigs.getByName("release")
}
debug {
isDebuggable = true
2023-05-24 01:33:20 -04:00
}
}
flavorDimensions.add("type")
productFlavors {
2023-09-15 11:31:16 -04:00
create("fdroid") {
dimension = "type"
proguardFile("fdroid-rules.pro")
}
create("general") {
dimension = "type"
if (BuildHelper.isReleaseBuild(gradle) && BuildHelper.isGeneralFlavor(gradle))
{
apply(plugin = "com.google.gms.google-services")
apply(plugin = "com.google.firebase.crashlytics")
}
}
}
2023-05-24 01:33:20 -04:00
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
isCoreLibraryDesugaringEnabled = true
2023-05-24 01:33:20 -04:00
}
kotlinOptions {
jvmTarget = "17"
}
buildFeatures {
compose = true
buildConfig = true
2023-05-24 01:33:20 -04:00
}
composeOptions {
kotlinCompilerExtensionVersion = libs.versions.composeCompiler.get()
2023-05-24 01:33:20 -04:00
}
packaging {
resources {
excludes += "/META-INF/{AL2.0,LGPL2.1}"
}
}
}
tasks.register("printVersionCode") {
doLast {
//print version code for CI
println(Constants.VERSION_CODE)
}
}
val generalImplementation by configurations
2023-05-24 01:33:20 -04:00
dependencies {
implementation(libs.androidx.core.ktx)
implementation(libs.androidx.lifecycle.runtime.ktx)
// optional - helpers for implementing LifecycleOwner in a Service
implementation(libs.androidx.lifecycle.service)
implementation(libs.androidx.activity.compose)
implementation(platform(libs.androidx.compose.bom))
implementation(libs.androidx.compose.ui)
implementation(libs.androidx.compose.ui.graphics)
implementation(libs.androidx.compose.ui.tooling.preview)
implementation(libs.androidx.material3)
implementation(libs.androidx.appcompat)
//test
testImplementation(libs.junit)
androidTestImplementation(libs.androidx.junit)
androidTestImplementation(libs.androidx.espresso.core)
androidTestImplementation(platform(libs.androidx.compose.bom))
androidTestImplementation(libs.androidx.compose.ui.test)
debugImplementation(libs.androidx.compose.ui.tooling)
debugImplementation(libs.androidx.compose.manifest)
//wg
implementation(libs.tunnel)
coreLibraryDesugaring(libs.desugar.jdk.libs)
2023-05-24 01:33:20 -04:00
//logging
implementation(libs.timber)
2023-05-24 01:33:20 -04:00
// compose navigation
implementation(libs.androidx.navigation.compose)
implementation(libs.androidx.hilt.navigation.compose)
2023-05-24 01:33:20 -04:00
// hilt
implementation(libs.hilt.android)
ksp(libs.hilt.android.compiler)
2023-05-24 01:33:20 -04:00
//accompanist
implementation(libs.accompanist.systemuicontroller)
implementation(libs.accompanist.permissions)
implementation(libs.accompanist.flowlayout)
implementation(libs.accompanist.drawablepainter)
2023-05-24 01:33:20 -04:00
//room
implementation(libs.androidx.room.runtime)
ksp(libs.androidx.room.compiler)
implementation(libs.androidx.room.ktx)
2023-05-24 01:33:20 -04:00
//lifecycle
implementation(libs.lifecycle.runtime.compose)
implementation(libs.androidx.lifecycle.runtime.ktx)
implementation(libs.androidx.lifecycle.process)
2023-05-24 01:33:20 -04:00
//icons
implementation(libs.material.icons.extended)
//serialization
implementation(libs.kotlinx.serialization.json)
2023-05-24 01:33:20 -04:00
//firebase crashlytics
generalImplementation(platform(libs.firebase.bom))
generalImplementation(libs.google.firebase.crashlytics.ktx)
generalImplementation(libs.google.firebase.analytics.ktx)
2023-05-24 01:33:20 -04:00
//barcode scanning
2023-09-15 14:51:38 -04:00
implementation(libs.zxing.android.embedded)
implementation(libs.zxing.core)
//bio
implementation(libs.androidx.biometric.ktx)
//shortcuts
implementation(libs.androidx.core)
implementation(libs.androidx.core.google.shortcuts)
2023-05-24 01:33:20 -04:00
}