ntfy-android/app/build.gradle

132 lines
4.3 KiB
Groovy
Raw Permalink Normal View History

2022-11-19 11:02:22 +13:00
repositories {
mavenCentral()
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
2021-10-30 14:13:58 +13:00
apply plugin: 'kotlin-kapt'
apply plugin: 'com.google.gms.google-services'
android {
2022-11-19 11:07:15 +13:00
compileSdkVersion 33
defaultConfig {
2021-10-26 09:16:23 +13:00
applicationId "io.heckel.ntfy"
minSdkVersion 21
2022-11-19 11:07:15 +13:00
targetSdkVersion 33
2023-03-03 14:55:49 +13: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-02 07:28:57 +13:00
minifyEnabled true
debuggable false
2021-11-22 02:56:24 +13:00
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
2021-11-02 07:28:57 +13:00
}
debug {
minifyEnabled false
2021-11-02 07:28:57 +13:00
debuggable true
2021-11-22 02:56:24 +13:00
}
}
flavorDimensions "store"
productFlavors {
2021-11-25 10:12:51 +13:00
play {
buildConfigField 'boolean', 'FIREBASE_AVAILABLE', 'true'
2022-01-20 17:40:03 +13:00
buildConfigField 'boolean', 'RATE_APP_AVAILABLE', 'true'
buildConfigField 'boolean', 'INSTALL_PACKAGES_AVAILABLE', 'false'
2021-11-22 02:56:24 +13:00
}
2021-11-25 10:12:51 +13:00
fdroid {
buildConfigField 'boolean', 'FIREBASE_AVAILABLE', 'false'
2022-01-20 17:40:03 +13:00
buildConfigField 'boolean', 'RATE_APP_AVAILABLE', 'false'
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 13:54:32 +13: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-22 08:15:53 +13:00
// AndroidX, The Basics
2023-05-20 12:19:19 +12:00
implementation "androidx.appcompat:appcompat:1.6.1"
implementation "androidx.core:core-ktx:1.10.1"
2022-06-18 12:16:49 +12:00
implementation "androidx.constraintlayout:constraintlayout:2.1.4"
2023-05-20 12:19:19 +12: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-29 08:40:09 +13:00
implementation 'androidx.preference:preference-ktx:1.2.0'
2022-01-22 08:15:53 +13:00
// JSON serialization
2022-11-19 11:02:22 +13:00
implementation 'com.google.code.gson:gson:2.10'
2022-01-22 08:15:53 +13:00
2021-11-02 02:57:05 +13:00
// Room (SQLite)
2023-05-20 12:19:19 +12:00
def room_version = "2.5.1"
2022-01-22 08:15:53 +13:00
implementation "androidx.room:room-ktx:$room_version"
kapt "androidx.room:room-compiler:$room_version"
2021-10-30 14:13:58 +13:00
// OkHttp (HTTP library)
2022-11-19 14:08:24 +13:00
implementation 'com.squareup.okhttp3:okhttp:4.10.0'
2021-11-02 02:57:05 +13:00
2021-11-22 02:56:24 +13:00
// Firebase, sigh ... (only Google Play)
2023-05-20 12:19:19 +12:00
playImplementation 'com.google.firebase:firebase-messaging:23.1.2'
2021-10-30 14:13:58 +13:00
// RecyclerView
2023-05-20 12:19:19 +12:00
implementation "androidx.recyclerview:recyclerview:1.3.0"
2021-11-15 08:20:30 +13:00
// Swipe down to refresh
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
// Material design
2023-05-20 12:19:19 +12:00
implementation "com.google.android.material:material:1.9.0"
// LiveData
2023-05-20 12:19:19 +12:00
implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.6.1"
2021-10-28 15:25:02 +13:00
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
2022-01-11 09:36:50 +13:00
// Image viewer
implementation 'com.github.stfalcon-studio:StfalconImageViewer:v1.0.1'
}