DroidFS/app/build.gradle

142 lines
4.7 KiB
Groovy
Raw Normal View History

2020-07-17 16:35:39 +02:00
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
2022-06-18 21:13:16 +02:00
if (hasProperty("disableCryFS")) {
ext.disableCryFS = getProperty("disableCryFS")
} else {
ext.disableCryFS = false
}
if (hasProperty("disableGocryptfs")) {
ext.disableGocryptfs = getProperty("disableGocryptfs")
} else {
ext.disableGocryptfs = false
}
2020-07-17 16:35:39 +02:00
android {
2023-09-08 21:13:24 +02:00
compileSdk 34
2024-06-06 21:08:11 +02:00
ndkVersion '25.2.9519653'
2022-09-23 12:09:22 +02:00
namespace "sushi.hardcore.droidfs"
2020-07-17 16:35:39 +02:00
compileOptions {
2023-09-08 21:13:24 +02:00
targetCompatibility JavaVersion.VERSION_17
sourceCompatibility JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = "17"
}
2024-07-26 13:36:45 +02:00
def abiCodes = [ "x86": 1, "x86_64": 2, "armeabi-v7a": 3, "arm64-v8a": 4]
2020-07-17 16:35:39 +02:00
defaultConfig {
applicationId "sushi.hardcore.droidfs"
minSdkVersion 21
2024-07-22 21:19:12 +02:00
targetSdkVersion 34
2024-07-25 17:18:29 +02:00
versionCode 37
versionName "2.2.0"
2020-07-17 16:35:39 +02:00
splits {
abi {
enable true
reset() // fix unknown bug (https://ru.stackoverflow.com/questions/1557805/abis-armeabi-mips-mips64-riscv64-are-not-supported-for-platform)
if (project.hasProperty("abi")) {
include project.getProperty("abi")
} else {
abiCodes.keySet().each { abi -> include abi }
universalApk !project.hasProperty("nouniversal")
}
}
2021-06-14 14:43:18 +02:00
}
2022-06-18 21:13:16 +02:00
externalNativeBuild.cmake {
if (project.ext.disableGocryptfs) {
arguments "-DGOCRYPTFS=OFF"
}
if (project.ext.disableCryFS) {
arguments "-DCRYFS=OFF"
}
}
2021-06-14 14:43:18 +02:00
}
2023-09-08 21:13:24 +02:00
applicationVariants.configureEach { variant ->
2020-10-15 18:31:49 +02:00
variant.resValue "string", "versionName", variant.versionName
2022-06-18 21:13:16 +02:00
buildConfigField "boolean", "CRYFS_DISABLED", "${project.ext.disableCryFS}"
buildConfigField "boolean", "GOCRYPTFS_DISABLED", "${project.ext.disableGocryptfs}"
variant.outputs.each { output ->
def abi = output.getFilter(com.android.build.OutputFile.ABI)
if (abi == null) { // universal
output.versionCodeOverride = variant.versionCode*10
output.outputFileName = "DroidFS-v${variant.versionName}-${variant.name}-universal.apk"
} else {
output.versionCodeOverride = variant.versionCode*10 + abiCodes[abi]
output.outputFileName = "DroidFS-v${variant.versionName}-${variant.name}-${abi}.apk"
}
}
2020-10-15 18:31:49 +02:00
}
2021-06-11 20:23:54 +02:00
buildFeatures {
viewBinding true
2023-09-08 21:13:24 +02:00
buildConfig true
2021-06-11 20:23:54 +02:00
}
2020-07-17 16:35:39 +02:00
buildTypes {
release {
2022-06-18 21:13:16 +02:00
postprocessing {
removeUnusedCode true
removeUnusedResources true
obfuscate false
optimizeCode true
proguardFiles 'proguard-rules.pro'
}
2020-07-17 16:35:39 +02:00
}
}
externalNativeBuild {
cmake {
path file('CMakeLists.txt')
}
}
2023-04-17 15:52:20 +02:00
sourceSets {
main {
java {
exclude 'androidx/camera/video/originals/**'
}
}
}
2020-07-17 16:35:39 +02:00
}
dependencies {
2022-02-18 15:53:48 +01:00
implementation project(":libpdfviewer:app")
2024-06-03 16:11:27 +02:00
implementation 'androidx.core:core-ktx:1.13.1'
implementation "androidx.appcompat:appcompat:1.7.0"
2022-09-23 12:09:22 +02:00
implementation "androidx.constraintlayout:constraintlayout:2.1.4"
2024-07-22 21:19:12 +02:00
def lifecycle_version = "2.8.3"
2023-03-07 23:25:17 +01:00
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version"
implementation "androidx.lifecycle:lifecycle-process:$lifecycle_version"
2020-08-05 14:06:54 +02:00
2023-09-08 21:13:24 +02:00
implementation "androidx.preference:preference-ktx:1.2.1"
2020-08-05 14:06:54 +02:00
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0"
2024-06-03 16:11:27 +02:00
implementation 'com.google.android.material:material:1.12.0'
2023-09-17 20:01:29 +02:00
implementation 'com.github.bumptech.glide:glide:4.16.0'
2022-09-23 12:09:22 +02:00
implementation "androidx.biometric:biometric-ktx:1.2.0-alpha05"
2020-12-19 19:55:54 +01:00
def media3_version = "1.3.1"
2023-09-10 19:11:45 +02:00
implementation "androidx.media3:media3-exoplayer:$media3_version"
implementation "androidx.media3:media3-ui:$media3_version"
2023-09-10 19:11:45 +02:00
implementation "androidx.media3:media3-datasource:$media3_version"
2021-03-17 21:11:14 +01:00
2024-07-22 21:19:12 +02:00
def camerax_version = "1.3.4"
2022-02-18 16:24:28 +01:00
implementation "androidx.camera:camera-camera2:$camerax_version"
implementation "androidx.camera:camera-lifecycle:$camerax_version"
implementation "androidx.camera:camera-view:$camerax_version"
implementation "androidx.camera:camera-extensions:$camerax_version"
2023-04-17 15:52:20 +02:00
// dependencies needed by CameraX patch
2024-07-22 21:19:12 +02:00
implementation "androidx.concurrent:concurrent-futures:1.2.0"
2023-09-17 20:01:29 +02:00
def autoValueVersion = '1.10.4'
2023-04-17 15:52:20 +02:00
implementation "com.google.auto.value:auto-value-annotations:$autoValueVersion"
annotationProcessor "com.google.auto.value:auto-value:$autoValueVersion"
2020-07-17 16:35:39 +02:00
}