Files
Amber/app/build.gradle
T
2024-07-03 14:48:58 -03:00

267 lines
7.3 KiB
Groovy

plugins {
alias(libs.plugins.androidApplication)
alias(libs.plugins.jetbrainsKotlinAndroid)
alias(libs.plugins.gradle.ktlint) version(libs.versions.ktlint)
alias(libs.plugins.google.gms) version(libs.versions.gms)
alias(libs.plugins.kotlin.ksp) version(libs.versions.ksp)
alias(libs.plugins.jetbrainsComposeCompiler)
}
android {
namespace 'com.greenart7c3.nostrsigner'
compileSdk 34
defaultConfig {
applicationId "com.greenart7c3.nostrsigner"
minSdk 26
targetSdk 34
versionCode 74
versionName "1.0.9"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
useSupportLibrary true
}
resourceConfigurations += [
'ar',
'bn-rBD',
'cs',
'cy-rGB',
'da-rDK',
'de',
'el-rGR',
'en-rGB',
'eo',
'es',
'es-rES',
'es-rMX',
'es-rUS',
'et-rEE',
'fa',
'fi-rFI',
'fo-rFO',
'fr',
'fr-rCA',
'gu-rIN',
'hi-rIN',
'hr-rHR',
'hu',
'in',
'in-rID',
'it-rIT',
'iw-rIL',
'ja',
'kk-rKZ',
'ko-rKR',
'ks-rIN',
'ku-rTR',
'lt-rLT',
'ne-rNP',
'night',
'nl',
'nl-rBE',
'pcm-rNG',
'pl-rPL',
'pt-rBR',
'pt-rPT',
'ru',
'ru-rUA',
'sa-rIN',
'sl-rSI',
'so-rSO',
'sr-rSP',
'ss-rZA',
'sv-rSE',
'sw-rKE',
'sw-rTZ',
'ta',
'th',
'tr',
'uk',
'ur-rIN',
'uz-rUZ',
'vi-rVN',
'zh',
'zh-rCN',
'zh-rHK',
'zh-rSG',
'zh-rTW'
]
lint {
disable 'MissingTranslation'
}
}
ksp {
arg("room.schemaLocation", "$projectDir/schemas")
}
buildTypes {
release {
proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"), 'proguard-rules.pro'
minifyEnabled true
resValue "string", "app_name", "@string/app_name_release"
}
debug {
applicationIdSuffix '.debug'
versionNameSuffix '-DEBUG'
resValue "string", "app_name", "@string/app_name_debug"
}
}
flavorDimensions += "version"
productFlavors {
create("play") {
getIsDefault().set(true)
dimension = "version"
}
create("free") {
dimension = "version"
}
create("offline") {
dimension = "version"
}
}
splits {
abi {
enable true
reset()
include "x86", "x86_64", "arm64-v8a", "armeabi-v7a"
universalApk true
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
buildFeatures {
compose true
buildConfig true
}
packagingOptions {
resources {
excludes += '/META-INF/{AL2.0,LGPL2.1}'
}
}
}
kotlin {
compilerOptions {
jvmTarget = JvmTarget.JVM_17
}
}
composeCompiler {
reportsDestination = layout.buildDirectory.dir("compose_compiler")
}
dependencies {
implementation(libs.quartz) {
exclude group: 'net.java.dev.jna'
}
implementation(libs.ammolite) {
exclude group: 'net.java.dev.jna'
}
implementation(libs.jna) {
artifact { type = "aar" }
}
implementation libs.core.splashscreen
implementation libs.core.ktx
implementation libs.activity.compose
implementation libs.ui
implementation libs.ui.tooling.preview
implementation libs.runtime.livedata
// Navigation
implementation libs.navigation.compose
// Observe Live data as State
implementation libs.runtime.livedata
implementation libs.material3
implementation libs.material.icons.extended
implementation libs.appcompat
implementation libs.work.runtime.ktx
testImplementation libs.junit
testImplementation libs.mockk
androidTestImplementation libs.ext.junit
androidTestImplementation libs.espresso.core
androidTestImplementation libs.ui.test.junit4
debugImplementation libs.ui.tooling
debugImplementation libs.ui.test.manifest
implementation libs.security.crypto.ktx
// Lifecycle
implementation libs.lifecycle.runtime.compose
implementation libs.lifecycle.viewmodel.compose
implementation libs.lifecycle.runtime.ktx
// For QR generation
implementation libs.core
implementation libs.zxing.android.embedded
// Json Serialization
implementation libs.converter.gson
// Markdown (With fix for full-image bleeds)
implementation(libs.richtext.ui)
implementation(libs.richtext.ui.material3)
implementation(libs.richtext.commonmark)
// Biometrics
implementation libs.biometric.ktx
playImplementation platform(libs.firebase.bom)
playImplementation(libs.firebase.messaging)
freeImplementation(libs.unfiedpush)
ksp(libs.room.compiler)
implementation(libs.room.ktx)
freeImplementation(libs.okhttp)
playImplementation(libs.okhttp)
}
// https://gitlab.com/fdroid/wiki/-/wikis/HOWTO:-diff-&-fix-APKs-for-Reproducible-Builds#differing-assetsdexoptbaselineprofm-easy-to-fix
// NB: Android Studio can't find the imports; this does not affect the
// actual build since Gradle can find them just fine.
import com.android.tools.profgen.ArtProfileKt
import com.android.tools.profgen.ArtProfileSerializer
import com.android.tools.profgen.DexFile
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
project.afterEvaluate {
tasks.each { task ->
if (task.name.startsWith("compile") && task.name.endsWith("ReleaseArtProfile")) {
task.doLast {
outputs.files.each { file ->
if (file.name.endsWith(".profm")) {
println("Sorting ${file} ...")
def version = ArtProfileSerializer.valueOf("METADATA_0_0_2")
def profile = ArtProfileKt.ArtProfile(file)
def keys = new ArrayList(profile.profileData.keySet())
def sortedData = new LinkedHashMap()
Collections.sort keys, new DexFile.Companion()
keys.each { key -> sortedData[key] = profile.profileData[key] }
new FileOutputStream(file).with {
write(version.magicBytes$profgen)
write(version.versionBytes$profgen)
version.write$profgen(it, sortedData, "")
}
}
}
}
}
}
}