amethyst/app/build.gradle

248 wiersze
8.7 KiB
Groovy
Czysty Zwykły widok Historia

2023-01-11 18:31:20 +00:00
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
2023-10-15 19:41:24 +00:00
id 'org.jlleitschuh.gradle.ktlint' version "11.6.1"
id 'com.google.gms.google-services'
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
2023-10-30 21:31:50 +00:00
versionCode 327
versionName "0.80.4"
2023-01-11 18:31:20 +00:00
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
useSupportLibrary true
}
2023-09-08 03:38:05 +00:00
resourceConfigurations += ['ar', 'cs', 'de', 'eo', 'es', 'fa', 'fr', 'hu', 'in', 'ja', 'night', 'nl', 'pt-rBR', 'ru', 'sv-rSE', 'ta', 'th', 'tr', 'uk', 'zh', 'sh-rHK', 'zh-rTW']
2023-01-11 18:31:20 +00:00
}
buildTypes {
release {
2023-08-05 00:57:21 +00:00
//signingConfig signingConfigs.debug
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
}
}
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-01-11 18:31:20 +00:00
composeOptions {
2023-07-30 22:10:23 +00:00
kotlinCompilerExtensionVersion "1.5.1"
2023-01-11 18:31:20 +00:00
}
2023-01-11 18:31:20 +00:00
packagingOptions {
resources {
excludes += '/META-INF/{AL2.0,LGPL2.1}'
}
}
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 project(path: ':quartz')
2023-08-22 15:05:17 +00:00
implementation "androidx.core:core-ktx:$core_ktx_version"
2023-10-15 19:41:24 +00:00
implementation 'androidx.activity:activity-compose:1.8.0'
2023-01-11 18:31:20 +00:00
implementation "androidx.compose.ui:ui:$compose_ui_version"
implementation "androidx.compose.ui:ui-tooling-preview:$compose_ui_version"
2023-03-05 01:55:52 +00:00
// Needs this to open gallery / image upload
implementation "androidx.fragment:fragment-ktx:$fragment_version"
2023-01-11 18:31:20 +00:00
// Navigation
2023-07-30 22:10:23 +00:00
implementation "androidx.navigation:navigation-compose:$nav_version"
// Observe Live data as State
2023-03-13 21:36:47 +00:00
implementation "androidx.compose.runtime:runtime-livedata:$compose_ui_version"
2023-01-11 18:31:20 +00:00
// Material 3 Design
2023-09-29 17:57:10 +00:00
implementation "androidx.compose.material3:material3:${material3_version}"
2023-03-13 21:36:47 +00:00
implementation "androidx.compose.material:material-icons-extended:$compose_ui_version"
// Adaptive Layout / Two Pane
implementation "androidx.compose.material3:material3-window-size-class:${material3_version}"
2023-10-22 03:52:50 +00:00
implementation "com.google.accompanist:accompanist-adaptive:0.32.0"
// Lifecycle
2023-02-25 21:18:31 +00:00
implementation "androidx.lifecycle:lifecycle-runtime-compose:$lifecycle_version"
implementation "androidx.lifecycle:lifecycle-viewmodel-compose:$lifecycle_version"
implementation "androidx.lifecycle:lifecycle-runtime-ktx:$lifecycle_version"
2023-07-30 22:10:23 +00:00
implementation "androidx.lifecycle:lifecycle-livedata-ktx:$lifecycle_version"
2023-01-11 18:31:20 +00:00
// Zoomable images
2023-09-12 21:53:18 +00:00
implementation 'net.engawapg.lib:zoomable:1.5.1'
// Biometrics
implementation "androidx.biometric:biometric-ktx:1.2.0-alpha05"
2023-01-11 18:31:20 +00:00
// Websockets API
2023-01-18 14:18:34 +00:00
implementation 'com.squareup.okhttp3:okhttp:5.0.0-alpha.11'
2023-01-11 18:31:20 +00:00
// HTML Parsing for Link Preview
2023-10-21 15:33:20 +00:00
implementation 'org.jsoup:jsoup:1.16.2'
2023-02-25 21:18:31 +00:00
// Encrypted Key Storage
2023-04-27 20:23:30 +00:00
implementation 'androidx.security:security-crypto-ktx:1.1.0-alpha06'
2023-01-13 03:40:39 +00:00
// view videos
implementation "androidx.media3:media3-exoplayer:${exoplayer_version}"
// important for proxy / tor
implementation "androidx.media3:media3-datasource-okhttp:${exoplayer_version}"
2023-01-13 03:40:39 +00:00
// Load images from the web.
2023-03-30 20:53:13 +00:00
implementation "io.coil-kt:coil-compose:$coil_version"
2023-01-16 17:57:23 +00:00
// view gifs
2023-03-30 20:53:13 +00:00
implementation "io.coil-kt:coil-gif:$coil_version"
2023-01-16 17:57:23 +00:00
// view svgs
2023-03-30 20:53:13 +00:00
implementation "io.coil-kt:coil-svg:$coil_version"
2023-01-16 17:57:23 +00:00
2023-04-21 21:01:42 +00:00
// create blurhash
implementation group: 'io.trbl', name: 'blurhash', version: '1.0.0'
// Permission to upload pictures:
implementation "com.google.accompanist:accompanist-permissions:$accompanist_version"
// For QR generation
2023-07-30 22:10:23 +00:00
implementation 'com.google.zxing:core:3.5.2'
2023-03-10 14:06:15 +00:00
implementation 'com.journeyapps:zxing-android-embedded:4.3.0'
// 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)
implementation('com.github.vitorpamplona.compose-richtext:richtext-ui:a0954aba63')
2023-09-29 17:57:10 +00:00
implementation('com.github.vitorpamplona.compose-richtext:richtext-ui-material3:a0954aba63')
implementation('com.github.vitorpamplona.compose-richtext:richtext-commonmark:a0954aba63')
// Language picker and Theme chooser
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation "androidx.media3:media3-exoplayer-hls:$media3_version"
implementation "androidx.media3:media3-ui:$media3_version"
implementation "androidx.media3:media3-session:$media3_version"
// Local model for language identification
playImplementation 'com.google.mlkit:language-id:17.0.4'
// Google services model the translate text
playImplementation 'com.google.mlkit:translate:17.0.1'
// PushNotifications
2023-10-28 14:22:01 +00:00
playImplementation platform('com.google.firebase:firebase-bom:32.4.1')
playImplementation 'com.google.firebase:firebase-messaging-ktx'
2023-10-12 17:36:59 +00:00
//PushNotifications(FDroid)
fdroidImplementation 'com.github.UnifiedPush:android-connector:2.2.0'
2023-05-17 02:41:47 +00:00
// Charts
implementation "com.patrykandpatrick.vico:core:${vico_version}"
implementation "com.patrykandpatrick.vico:compose:${vico_version}"
implementation "com.patrykandpatrick.vico:views:${vico_version}"
implementation "com.patrykandpatrick.vico:compose-m2:${vico_version}"
// GeoHash
implementation 'com.github.drfonfon:android-kotlin-geohash:1.0'
2023-08-19 03:42:24 +00:00
// Waveform visualizer
implementation 'com.github.lincollincol:compose-audiowaveform:1.1.1'
2023-06-08 16:14:26 +00:00
// Video compression lib
2023-07-17 17:42:17 +00:00
implementation 'com.github.AbedElazizShe:LightCompressor:1.3.1'
2023-06-08 16:14:26 +00:00
// Image compression lib
implementation 'id.zelory:compressor:3.0.1'
2023-01-11 18:31:20 +00:00
testImplementation 'junit:junit:4.13.2'
2023-09-25 13:54:58 +00:00
testImplementation 'io.mockk:mockk:1.13.8'
2023-04-27 20:23:30 +00:00
androidTestImplementation 'androidx.test.ext:junit:1.2.0-alpha01'
2023-01-11 18:31:20 +00:00
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_ui_version"
debugImplementation "androidx.compose.ui:ui-tooling:$compose_ui_version"
debugImplementation "androidx.compose.ui:ui-test-manifest:$compose_ui_version"
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, "")
}
}
}
}
}
}
}