wgtunnel/app/build.gradle.kts

195 lines
6.0 KiB
Plaintext
Raw Normal View History

2023-05-24 01:33:20 -04:00
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.hilt.android)
2024-03-11 12:39:00 -04:00
alias(libs.plugins.kotlinxSerialization)
alias(libs.plugins.ksp)
alias(libs.plugins.compose.compiler)
2024-07-27 04:15:57 -04:00
alias(libs.plugins.grgit)
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
2024-04-16 16:02:20 -04:00
androidResources {
generateLocaleConfig = true
}
2023-05-24 01:33:20 -04:00
defaultConfig {
applicationId = Constants.APP_ID
minSdk = Constants.MIN_SDK
targetSdk = Constants.TARGET_SDK
2024-07-27 22:56:56 -04:00
versionCode = Constants.VERSION_CODE
versionName = Constants.VERSION_NAME
ksp { arg("room.schemaLocation", "$projectDir/schemas") }
sourceSets {
getByName("debug").assets.srcDirs(files("$projectDir/schemas")) // Room
}
2023-05-24 01:33:20 -04:00
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables { useSupportLibrary = true }
2023-05-24 01:33:20 -04:00
}
signingConfigs {
create(Constants.RELEASE) {
2024-07-27 04:15:57 -04:00
storeFile = getStoreFile()
storePassword = getSigningProperty(Constants.STORE_PASS_VAR)
keyAlias = getSigningProperty(Constants.KEY_ALIAS_VAR)
keyPassword = getSigningProperty(Constants.KEY_PASS_VAR)
}
}
2023-05-24 01:33:20 -04:00
buildTypes {
// don't strip
packaging.jniLibs.keepDebugSymbols.addAll(
listOf("libwg-go.so", "libwg-quick.so", "libwg.so"),
)
2023-11-08 22:39:51 -05:00
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",
2023-05-24 01:33:20 -04:00
)
2024-07-27 22:56:56 -04:00
signingConfig = signingConfigs.getByName(Constants.RELEASE)
}
debug { isDebuggable = true }
2024-07-27 04:15:57 -04:00
2024-07-27 22:56:56 -04:00
create(Constants.NIGHTLY) {
2024-07-28 02:13:18 -04:00
initWith(buildTypes.getByName(Constants.RELEASE))
2024-07-27 22:56:56 -04:00
defaultConfig.versionName = nightlyVersionName()
defaultConfig.versionCode = nightlyVersionCode()
2024-07-27 04:15:57 -04:00
}
2024-07-28 02:13:18 -04:00
applicationVariants.all {
val variant = this
variant.outputs
.map { it as com.android.build.gradle.internal.api.BaseVariantOutputImpl }
.forEach { output ->
val outputFileName =
"${Constants.APP_NAME}-${variant.flavorName}-${variant.buildType.name}-${variant.versionName}.apk"
output.outputFileName = outputFileName
}
}
2023-05-24 01:33:20 -04:00
}
flavorDimensions.add(Constants.TYPE)
productFlavors {
2023-09-15 11:31:16 -04:00
create("fdroid") {
dimension = Constants.TYPE
proguardFile("fdroid-rules.pro")
}
create("general") {
dimension = Constants.TYPE
}
}
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 = Constants.JVM_TARGET }
2023-05-24 01:33:20 -04:00
buildFeatures {
compose = true
buildConfig = true
2023-05-24 01:33:20 -04:00
}
packaging { resources { excludes += "/META-INF/{AL2.0,LGPL2.1}" } }
2023-05-24 01:33:20 -04:00
}
val generalImplementation by configurations
2023-05-24 01:33:20 -04:00
dependencies {
2024-03-13 02:52:57 -04:00
implementation(project(":logcatter"))
implementation(libs.androidx.core.ktx)
implementation(libs.androidx.lifecycle.runtime.ktx)
2024-05-10 21:42:59 -04:00
// 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)
testImplementation(libs.androidx.junit)
androidTestImplementation(libs.androidx.junit)
androidTestImplementation(libs.androidx.espresso.core)
androidTestImplementation(platform(libs.androidx.compose.bom))
androidTestImplementation(libs.androidx.compose.ui.test)
androidTestImplementation(libs.androidx.room.testing)
debugImplementation(libs.androidx.compose.ui.tooling)
debugImplementation(libs.androidx.compose.manifest)
// get tunnel lib from github packages or mavenLocal
implementation(libs.tunnel)
2024-05-05 00:45:01 -04:00
implementation(libs.amneziawg.android)
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
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
2024-05-10 21:42:59 -04:00
implementation(libs.zaneschepke.multifab)
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.permissions)
implementation(libs.accompanist.flowlayout)
implementation(libs.accompanist.drawablepainter)
2023-05-24 01:33:20 -04:00
// storage
implementation(libs.androidx.room.runtime)
ksp(libs.androidx.room.compiler)
implementation(libs.androidx.room.ktx)
implementation(libs.androidx.datastore.preferences)
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)
// icons
implementation(libs.material.icons.extended)
// serialization
implementation(libs.kotlinx.serialization.json)
2023-05-24 01:33:20 -04:00
// barcode scanning
2023-09-15 14:51:38 -04:00
implementation(libs.zxing.android.embedded)
// bio
implementation(libs.androidx.biometric.ktx)
implementation(libs.pin.lock.compose)
// shortcuts
implementation(libs.androidx.core)
implementation(libs.androidx.core.google.shortcuts)
// splash
implementation(libs.androidx.core.splashscreen)
}
2024-07-27 04:15:57 -04:00
2024-07-28 02:17:01 -04:00
fun nightlyVersionCode(): Int {
2024-07-27 22:56:56 -04:00
return Constants.VERSION_CODE + Constants.NIGHTLY_CODE
2024-07-27 04:15:57 -04:00
}
2024-07-28 02:17:01 -04:00
fun nightlyVersionName(): String {
2024-07-27 22:56:56 -04:00
return Constants.VERSION_NAME + "-${grgitService.service.get().grgit.head().abbreviatedId}"
2024-07-27 04:15:57 -04:00
}