amethyst/app/build.gradle

323 wiersze
9.0 KiB
Groovy
Czysty Zwykły widok Historia

2023-01-11 18:31:20 +00:00
plugins {
2024-03-01 15:38:03 +00:00
alias(libs.plugins.androidApplication)
alias(libs.plugins.jetbrainsKotlinAndroid)
alias(libs.plugins.googleServices)
2023-01-11 18:31:20 +00:00
}
android {
namespace 'com.vitorpamplona.amethyst'
2023-08-18 23:32:30 +00:00
compileSdk 34
2023-01-11 18:31:20 +00:00
defaultConfig {
applicationId "com.vitorpamplona.amethyst"
minSdk 26
2023-08-18 23:32:30 +00:00
targetSdk 34
2024-04-11 22:20:48 +00:00
versionCode 368
versionName "0.86.5"
2024-04-04 21:21:03 +00:00
buildConfigField "String", "RELEASE_NOTES_ID", "\"a704a11334ed4fe6fc6ee6f8856f6f005da33644770616f1437f8b2b488b52b1\""
2023-01-11 18:31:20 +00:00
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
useSupportLibrary true
}
resourceConfigurations += [
2023-12-11 17:50:44 +00:00
'ar',
'bn-rBD',
'cs',
'cy-rGB',
'da-rDK',
'de',
2024-01-30 13:30:25 +00:00
'el-rGR',
2023-12-11 17:50:44 +00:00
'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'
]
2023-01-11 18:31:20 +00:00
}
buildTypes {
release {
2023-08-02 01:49:30 +00:00
proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"), 'proguard-rules.pro'
minifyEnabled true
2023-02-06 14:15:18 +00:00
resValue "string", "app_name", "@string/app_name_release"
}
debug {
applicationIdSuffix '.debug'
versionNameSuffix '-DEBUG'
resValue "string", "app_name", "@string/app_name_debug"
2023-01-11 18:31:20 +00:00
}
create("benchmark") {
initWith(getByName("release"))
2024-01-18 16:35:53 +00:00
profileable true
signingConfig signingConfigs.debug
}
2023-01-11 18:31:20 +00:00
}
2023-07-30 22:10:23 +00:00
flavorDimensions = ["channel"]
productFlavors {
play {
2023-03-17 20:54:57 +00:00
getIsDefault().set(true)
dimension "channel"
}
fdroid {
dimension "channel"
}
}
splits {
abi {
enable true
reset()
include "x86", "x86_64", "arm64-v8a", "armeabi-v7a"
universalApk true
}
}
2023-01-11 18:31:20 +00:00
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
2023-01-11 18:31:20 +00:00
}
2023-01-11 18:31:20 +00:00
kotlinOptions {
jvmTarget = '17'
2023-01-11 18:31:20 +00:00
}
2023-01-11 18:31:20 +00:00
buildFeatures {
compose true
2023-12-14 15:45:14 +00:00
buildConfig true
2023-01-11 18:31:20 +00:00
}
2023-01-11 18:31:20 +00:00
composeOptions {
// Should match compose version : https://developer.android.com/jetpack/androidx/releases/compose-kotlin
2024-04-10 14:20:33 +00:00
kotlinCompilerExtensionVersion "1.5.11"
2023-01-11 18:31:20 +00:00
}
packagingOptions {
resources {
2024-03-01 13:03:58 +00:00
excludes += ['/META-INF/{AL2.0,LGPL2.1}', '**/libscrypt.dylib']
2023-01-11 18:31:20 +00:00
}
}
2023-10-21 20:24:58 +00:00
2023-04-20 21:18:20 +00:00
lint {
disable 'MissingTranslation'
}
2023-10-21 20:24:58 +00:00
testOptions {
unitTests.returnDefaultValues = true
}
2023-01-11 18:31:20 +00:00
}
dependencies {
implementation platform(libs.androidx.compose.bom)
implementation project(path: ':quartz')
implementation project(path: ':commons')
2024-03-01 15:38:03 +00:00
implementation libs.androidx.core.ktx
implementation libs.androidx.activity.compose
implementation libs.androidx.ui
implementation libs.androidx.ui.graphics
implementation libs.androidx.ui.tooling.preview
2023-01-11 18:31:20 +00:00
2023-03-05 01:55:52 +00:00
// Needs this to open gallery / image upload
2024-03-01 15:38:03 +00:00
implementation libs.androidx.fragment.ktx
2023-03-05 01:55:52 +00:00
2023-01-11 18:31:20 +00:00
// Navigation
2024-03-01 15:38:03 +00:00
implementation libs.androidx.navigation.compose
// Observe Live data as State
2024-03-01 15:38:03 +00:00
implementation libs.androidx.runtime.livedata
2023-01-11 18:31:20 +00:00
// Material 3 Design
2024-03-01 15:38:03 +00:00
implementation libs.androidx.material3
implementation libs.androidx.material.icons
// Adaptive Layout / Two Pane
2024-03-01 15:38:03 +00:00
implementation libs.androidx.material3.windowSize
implementation libs.accompanist.adaptive
// Lifecycle
2024-03-01 15:38:03 +00:00
implementation libs.androidx.lifecycle.runtime.ktx
implementation libs.androidx.lifecycle.runtime.compose
implementation libs.androidx.lifecycle.viewmodel.compose
implementation libs.androidx.lifecycle.livedata.ktx
2023-01-11 18:31:20 +00:00
// Zoomable images
2024-03-01 15:38:03 +00:00
implementation libs.zoomable
// Biometrics
2024-03-01 15:38:03 +00:00
implementation libs.androidx.biometric.ktx
2023-01-11 18:31:20 +00:00
// Websockets API
2024-03-01 15:38:03 +00:00
implementation libs.okhttp
2023-01-11 18:31:20 +00:00
2023-02-25 21:18:31 +00:00
// Encrypted Key Storage
2024-03-01 15:38:03 +00:00
implementation libs.androidx.security.crypto.ktx
2023-01-13 03:40:39 +00:00
// view videos
2024-03-01 15:38:03 +00:00
implementation libs.androidx.media3.exoplayer
implementation libs.androidx.media3.exoplayer.hls
implementation libs.androidx.media3.ui
implementation libs.androidx.media3.session
2023-11-21 18:29:48 +00:00
// important for proxy / tor
2024-03-01 15:38:03 +00:00
implementation libs.androidx.media3.datasource.okhttp
2023-01-13 03:40:39 +00:00
// Load images from the web.
2024-03-01 15:38:03 +00:00
implementation libs.coil.compose
2023-01-16 17:57:23 +00:00
// view gifs
2024-03-01 15:38:03 +00:00
implementation libs.coil.gif
2023-01-16 17:57:23 +00:00
// view svgs
2024-03-01 15:38:03 +00:00
implementation libs.coil.svg
2023-01-16 17:57:23 +00:00
2023-04-21 21:01:42 +00:00
// create blurhash
2024-03-01 15:38:03 +00:00
implementation libs.trbl.blurhash
2023-04-21 21:01:42 +00:00
// Permission to upload pictures:
2024-03-01 15:38:03 +00:00
implementation libs.accompanist.permissions
// For QR generation
2024-03-01 15:38:03 +00:00
implementation libs.zxing
implementation libs.zxing.embedded
// Markdown
//implementation "com.halilibo.compose-richtext:richtext-ui:0.16.0"
//implementation "com.halilibo.compose-richtext:richtext-ui-material:0.16.0"
//implementation "com.halilibo.compose-richtext:richtext-commonmark:0.16.0"
// Markdown (With fix for full-image bleeds)
2024-03-01 15:38:03 +00:00
implementation libs.markdown.ui
implementation libs.markdown.ui.material3
implementation libs.markdown.commonmark
// Language picker and Theme chooser
2024-03-01 15:38:03 +00:00
implementation libs.androidx.appcompat
// Local model for language identification
2024-03-01 15:38:03 +00:00
playImplementation libs.google.mlkit.language.id
// Google services model the translate text
2024-03-01 15:38:03 +00:00
playImplementation libs.google.mlkit.translate
// PushNotifications
2024-03-01 15:38:03 +00:00
playImplementation platform(libs.firebase.bom)
playImplementation libs.firebase.messaging
2023-10-12 17:36:59 +00:00
//PushNotifications(FDroid)
2024-03-01 15:38:03 +00:00
fdroidImplementation libs.unifiedpush
2023-10-12 17:36:59 +00:00
2023-05-17 02:41:47 +00:00
// Charts
2024-03-01 15:38:03 +00:00
implementation libs.vico.charts.core
implementation libs.vico.charts.compose
implementation libs.vico.charts.views
implementation libs.vico.charts.m3
2023-05-17 02:41:47 +00:00
// GeoHash
2024-03-01 15:38:03 +00:00
implementation libs.drfonfon.geohash
2023-08-19 03:42:24 +00:00
// Waveform visualizer
2024-03-01 15:38:03 +00:00
implementation libs.audiowaveform
2023-08-19 03:42:24 +00:00
2023-06-08 16:14:26 +00:00
// Video compression lib
2024-03-01 15:38:03 +00:00
implementation libs.abedElazizShe.image.compressor
2023-06-08 16:14:26 +00:00
// Image compression lib
2024-03-01 15:38:03 +00:00
implementation libs.zelory.video.compressor
testImplementation libs.junit
testImplementation libs.mockk
androidTestImplementation platform(libs.androidx.compose.bom)
2024-03-01 15:38:03 +00:00
androidTestImplementation libs.androidx.junit
androidTestImplementation libs.androidx.junit.ktx
androidTestImplementation libs.androidx.espresso.core
debugImplementation platform(libs.androidx.compose.bom)
2024-03-01 15:38:03 +00:00
debugImplementation libs.androidx.ui.tooling
debugImplementation libs.androidx.ui.test.manifest
2023-03-05 21:42:19 +00:00
}
2023-03-07 18:09:26 +00:00
2023-03-15 01:37:57 +00:00
// 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
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, "")
}
}
}
}
}
}
}