e-ntfy-android/app/build.gradle

122 lines
3.8 KiB
Groovy
Raw Normal View History

2022-11-18 23:02:22 +01:00
repositories {
mavenCentral()
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
2021-10-30 03:13:58 +02:00
apply plugin: 'kotlin-kapt'
apply plugin: 'com.google.gms.google-services'
android {
2022-11-18 23:07:15 +01:00
compileSdkVersion 33
defaultConfig {
2021-10-25 22:16:23 +02:00
applicationId "io.heckel.ntfy"
minSdkVersion 21
2022-11-18 23:07:15 +01:00
targetSdkVersion 33
2023-03-03 02:55:49 +01:00
versionCode 33
versionName "1.17.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
/* Required for Room schema migrations */
javaCompileOptions {
annotationProcessorOptions {
arguments += ["room.schemaLocation": "$projectDir/schemas".toString()]
}
}
}
buildTypes {
release {
2021-11-01 19:28:57 +01:00
minifyEnabled true
debuggable false
2021-11-21 14:56:24 +01:00
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
2021-11-01 19:28:57 +01:00
}
debug {
minifyEnabled false
2021-11-01 19:28:57 +01:00
debuggable true
2021-11-21 14:56:24 +01:00
}
}
flavorDimensions "store"
productFlavors {
2021-11-24 22:12:51 +01:00
fdroid {
buildConfigField 'boolean', 'INSTALL_PACKAGES_AVAILABLE', 'true'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
2022-11-19 01:54:32 +01:00
freeCompilerArgs += [
'-Xjvm-default=all-compatibility' // https://stackoverflow.com/a/71234042/1440785
]
}
}
// Disables GoogleServices tasks for F-Droid variant
android.applicationVariants.all { variant ->
def shouldProcessGoogleServices = variant.flavorName == "play"
def googleTask = tasks.findByName("process${variant.name.capitalize()}GoogleServices")
googleTask.enabled = shouldProcessGoogleServices
}
// Strips out REQUEST_INSTALL_PACKAGES permission for Google Play variant
android.applicationVariants.all { variant ->
def shouldStripInstallPermission = variant.flavorName == "play"
if (shouldStripInstallPermission) {
variant.outputs.each { output ->
def processManifest = output.getProcessManifestProvider().get()
processManifest.doLast { task ->
def outputDir = task.getMultiApkManifestOutputDirectory().get().asFile
def manifestOutFile = file("$outputDir/AndroidManifest.xml")
def newFileContents = manifestOutFile.collect { s -> s.contains("android.permission.REQUEST_INSTALL_PACKAGES") ? "" : s }.join("\n")
manifestOutFile.write(newFileContents, 'UTF-8')
}
}
}
}
dependencies {
2022-01-21 20:15:53 +01:00
// AndroidX, The Basics
2023-05-20 02:19:19 +02:00
implementation "androidx.appcompat:appcompat:1.6.1"
implementation "androidx.core:core-ktx:1.10.1"
2022-06-18 02:16:49 +02:00
implementation "androidx.constraintlayout:constraintlayout:2.1.4"
2023-05-20 02:19:19 +02:00
implementation "androidx.activity:activity-ktx:1.7.1"
implementation "androidx.fragment:fragment-ktx:1.5.7"
implementation "androidx.work:work-runtime-ktx:2.8.1"
2022-01-28 20:40:09 +01:00
implementation 'androidx.preference:preference-ktx:1.2.0'
2022-01-21 20:15:53 +01:00
// JSON serialization
2022-11-18 23:02:22 +01:00
implementation 'com.google.code.gson:gson:2.10'
2022-01-21 20:15:53 +01:00
2021-11-01 14:57:05 +01:00
// Room (SQLite)
2023-05-20 02:19:19 +02:00
def room_version = "2.5.1"
2022-01-21 20:15:53 +01:00
implementation "androidx.room:room-ktx:$room_version"
kapt "androidx.room:room-compiler:$room_version"
2021-10-30 03:13:58 +02:00
// OkHttp (HTTP library)
2022-11-19 02:08:24 +01:00
implementation 'com.squareup.okhttp3:okhttp:4.10.0'
2021-11-01 14:57:05 +01:00
// RecyclerView
2023-05-20 02:19:19 +02:00
implementation "androidx.recyclerview:recyclerview:1.3.0"
2021-11-14 20:20:30 +01:00
// Swipe down to refresh
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
// Material design
2023-05-20 02:19:19 +02:00
implementation "com.google.android.material:material:1.9.0"
// LiveData
2023-05-20 02:19:19 +02:00
implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.6.1"
2021-10-28 04:25:02 +02:00
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
2022-01-10 21:36:50 +01:00
// Image viewer
implementation 'com.github.stfalcon-studio:StfalconImageViewer:v1.0.1'
}