Podcini-podcast/app/build.gradle

303 lines
9.7 KiB
Groovy
Raw Normal View History

2024-02-05 21:50:43 +01:00
plugins {
2024-05-25 10:42:10 +02:00
id 'com.android.application'
2024-02-14 07:09:48 +01:00
id 'kotlin-android'
2024-05-25 10:42:10 +02:00
id 'org.jetbrains.kotlin.android'
2024-07-28 14:13:01 +02:00
alias(libs.plugins.compose.compiler)
2024-06-23 19:58:04 +02:00
id 'io.realm.kotlin'
2024-08-14 09:10:52 +02:00
id('com.github.triplet.play') version '3.9.0' apply false
2024-02-05 21:50:43 +01:00
}
2024-07-28 14:13:01 +02:00
//apply plugin: 'org.jetbrains.compose'
composeCompiler {
enableStrongSkippingMode = true
reportsDestination = layout.buildDirectory.dir("compose_compiler")
// stabilityConfigurationFile = rootProject.layout.projectDirectory.file("stability_config.conf")
}
2024-03-15 23:03:21 +01:00
// from common.gradle
2024-02-05 21:50:43 +01:00
android {
defaultConfig {
2024-08-31 01:21:28 +02:00
minSdk 24
2024-09-19 23:43:15 +02:00
compileSdk 35
targetSdk 35
kotlinOptions {
jvmTarget = '17'
}
vectorDrawables.useSupportLibrary false
vectorDrawables.generatedDensities = []
testApplicationId "ac.mdiq.podcini.tests"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
2024-09-27 00:31:41 +02:00
versionCode 3020257
versionName "6.8.0"
2024-07-28 14:13:01 +02:00
applicationId "ac.mdiq.podcini.R"
def commit = ""
// try {
// def hashStdOut = new ByteArrayOutputStream()
// exec {
// commandLine "git", "rev-parse", "--short", "HEAD"
// standardOutput = hashStdOut
// }
// commit = hashStdOut.toString().trim()
// } catch (Exception ignore) {
// }
buildConfigField "String", "COMMIT_HASH", ('"' + (commit.isEmpty() ? "Unknown commit" : commit) + '"')
if (project.hasProperty("podcastindexApiKey")) {
buildConfigField "String", "PODCASTINDEX_API_KEY", '"' + podcastindexApiKey + '"'
buildConfigField "String", "PODCASTINDEX_API_SECRET", '"' + podcastindexApiSecret + '"'
} else {
buildConfigField "String", "PODCASTINDEX_API_KEY", '"QT2RYHSUZ3UC9GDJ5MFY"'
buildConfigField "String", "PODCASTINDEX_API_SECRET", '"Zw2NL74ht5aCtx5zFL$#MY$##qdVCX7x37jq95Sz"'
2024-02-15 15:10:16 +01:00
}
}
2024-02-05 21:50:43 +01:00
packagingOptions {
resources {
2024-04-19 12:52:23 +02:00
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
exclude 'META-INF/CHANGES'
exclude 'META-INF/README.md'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/MANIFEST.MF'
}
}
compileOptions {
2024-08-31 01:21:28 +02:00
// Flag to enable support for the new language APIs
coreLibraryDesugaringEnabled true
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
testOptions {
animationsDisabled = true
unitTests {
includeAndroidResources = true
}
}
buildFeatures {
viewBinding true
2024-05-11 18:38:02 +02:00
buildConfig true
2024-07-28 14:13:01 +02:00
compose true
}
2024-09-03 07:58:12 +02:00
splits {
abi {
2024-08-31 01:21:28 +02:00
enable true
reset()
2024-09-15 13:59:37 +02:00
include "arm64-v8a"
universalApk true
2024-08-31 01:21:28 +02:00
}
}
2024-08-26 17:59:29 +02:00
2024-03-15 23:03:21 +01:00
// from playFlavor.gradle
flavorDimensions += ["market"]
productFlavors {
free {
dimension "market"
}
play {
dimension "market"
}
}
// start of the app build.gradle
namespace "ac.mdiq.podcini"
2024-06-24 22:52:25 +02:00
lint {
lintConfig = file("lint.xml")
2024-07-28 14:13:01 +02:00
checkReleaseBuilds false
checkDependencies true
warningsAsErrors true
abortOnError true
checkGeneratedSources = true
disable += ['TypographyDashes', 'TypographyQuotes', 'ObsoleteLintCustomCheck', 'BatteryLife',
'ExportedReceiver', 'VectorDrawableCompat', 'NestedWeights', 'Overdraw', 'TextFields',
'AlwaysShowAction', 'Autofill', 'ClickableViewAccessibility', 'ContentDescription',
2024-08-02 00:13:16 +02:00
'KeyboardInaccessibleWidget', 'LabelFor', 'RelativeOverlap', 'SetTextI18n',
2024-07-28 14:13:01 +02:00
'RtlCompat', 'RtlHardcoded', 'VectorPath', 'RtlEnabled']
2024-03-15 23:03:21 +01:00
}
2024-07-28 14:13:01 +02:00
2024-03-15 23:03:21 +01:00
signingConfigs {
releaseConfig {
enableV1Signing true
enableV2Signing true
storeFile file(project.getProperties().getOrDefault("releaseStoreFile", "keystore"))
storePassword project.getProperties().getOrDefault("releaseStorePassword", "password")
keyAlias project.getProperties().getOrDefault("releaseKeyAlias", "alias")
keyPassword project.getProperties().getOrDefault("releaseKeyPassword", "password")
}
}
2024-07-28 14:13:01 +02:00
2024-03-15 23:03:21 +01:00
buildTypes {
release {
2024-07-28 14:13:01 +02:00
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard.cfg"
2024-06-23 19:58:04 +02:00
resValue "string", "app_name", "Podcini.R"
resValue "string", "provider_authority", "ac.mdiq.podcini.R.provider"
2024-08-10 08:11:37 +02:00
vcsInfo.include false
2024-03-15 23:03:21 +01:00
minifyEnabled true
shrinkResources true
signingConfig signingConfigs.releaseConfig
}
2024-07-28 14:13:01 +02:00
debug {
resValue "string", "app_name", "Podcini.R Debug"
applicationIdSuffix ".debug"
resValue "string", "provider_authority", "ac.mdiq.podcini.R.debug.provider"
}
2024-03-15 23:03:21 +01:00
}
2024-07-28 14:13:01 +02:00
2024-03-15 23:03:21 +01:00
applicationVariants.configureEach { variant ->
variant.outputs.configureEach { output ->
2024-06-23 19:58:04 +02:00
def applicationName = "Podcini.R"
2024-08-31 01:21:28 +02:00
def buildType = variant.buildType.name
def versionName = variant.versionName
def flavorName = variant.flavorName ?: ""
2024-09-03 07:58:12 +02:00
def abiName = output.getFilter(com.android.build.OutputFile.ABI) ?: ""
outputFileName = "${applicationName}_${buildType}_${flavorName}_${versionName}_${abiName}.apk"
2024-03-15 23:03:21 +01:00
}
}
androidResources {
additionalParameters "--no-version-vectors"
}
}
2024-02-05 21:50:43 +01:00
dependencies {
2024-09-25 00:40:12 +02:00
implementation libs.androidx.material3.android
2024-08-31 01:21:28 +02:00
/** Desugaring for using VistaGuide **/
2024-09-25 00:40:12 +02:00
coreLibraryDesugaring libs.desugar.jdk.libs.nio
implementation libs.vistaguide
2024-08-31 01:21:28 +02:00
2024-09-25 00:40:12 +02:00
def composeBom = libs.androidx.compose.bom
2024-07-28 14:13:01 +02:00
implementation composeBom
androidTestImplementation composeBom
2024-09-25 00:40:12 +02:00
implementation libs.androidx.material
implementation libs.androidx.ui.tooling.preview
debugImplementation libs.androidx.ui.tooling
implementation libs.androidx.constraintlayout.compose
implementation libs.androidx.activity.compose
implementation libs.androidx.window
implementation libs.androidx.core.ktx
implementation libs.kotlinx.coroutines.android
implementation libs.androidx.lifecycle.runtime.ktx
implementation libs.androidx.annotation
implementation libs.androidx.appcompat
implementation libs.androidx.coordinatorlayout
//noinspection UseTomlInstead
2024-09-05 23:46:39 +02:00
implementation "androidx.fragment:fragment-ktx:1.8.3"
2024-09-25 00:40:12 +02:00
implementation libs.androidx.gridlayout
implementation libs.androidx.media3.exoplayer
implementation libs.androidx.media3.ui
implementation libs.androidx.media3.media3.datasource.okhttp
implementation libs.media3.common
implementation libs.media3.session
implementation libs.androidx.palette.ktx
implementation libs.androidx.preference.ktx
implementation libs.androidx.recyclerview
implementation libs.androidx.viewpager2
implementation libs.androidx.work.runtime
implementation libs.androidx.core.splashscreen
implementation libs.androidx.documentfile
implementation libs.androidx.webkit
implementation libs.material
implementation libs.library.base
implementation libs.commons.lang3
implementation libs.commons.io
implementation libs.jsoup
implementation libs.coil
implementation libs.coil.compose
implementation libs.okhttp
implementation libs.okhttp3.okhttp.urlconnection
implementation libs.okio
implementation libs.rxjava
implementation libs.rxjava3.rxjava
implementation libs.rxandroid
2024-02-05 21:50:43 +01:00
2024-08-26 16:12:19 +02:00
// 5.5.0-b01 is newer than 5.5.0-compose01
2024-09-25 00:40:12 +02:00
implementation libs.iconics.core
implementation libs.iconics.views
implementation libs.google.material.typeface
implementation libs.google.material.typeface.outlined
implementation libs.fontawesome.typeface
2024-06-23 19:58:04 +02:00
2024-09-25 00:40:12 +02:00
implementation libs.speed.dial
implementation libs.searchpreference
implementation libs.balloon
implementation libs.recyclerviewswipedecorator
implementation libs.stream
2024-02-05 21:50:43 +01:00
2024-09-25 00:40:12 +02:00
implementation libs.fyydlin
2024-06-23 19:58:04 +02:00
2024-09-25 00:40:12 +02:00
implementation libs.readability4j
2024-04-18 23:56:00 +02:00
2024-07-22 14:03:04 +02:00
// debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.14'
2024-02-05 21:50:43 +01:00
// Non-free dependencies:
2024-09-25 00:40:12 +02:00
playImplementation libs.core.ktx
compileOnly libs.wearable
2024-02-05 21:50:43 +01:00
2024-06-23 19:58:04 +02:00
// this one can not be updated? TODO: need to get an alternative
2024-09-25 00:40:12 +02:00
androidTestImplementation libs.nanohttpd
2024-04-18 23:56:00 +02:00
2024-09-25 00:40:12 +02:00
androidTestImplementation libs.androidx.espresso.core
androidTestImplementation libs.androidx.espresso.contrib
androidTestImplementation libs.androidx.espresso.intents
androidTestImplementation libs.androidx.runner
androidTestImplementation libs.androidx.rules
androidTestImplementation libs.androidx.junit
androidTestImplementation libs.awaitility
2024-02-25 11:28:34 +01:00
// Non-free dependencies:
2024-09-25 00:40:12 +02:00
testImplementation libs.androidx.core
testImplementation libs.awaitility
testImplementation libs.junit
testImplementation libs.mockito.inline
testImplementation libs.robolectric
testImplementation libs.javax.inject
2024-02-25 11:28:34 +01:00
2024-09-25 00:40:12 +02:00
playImplementation libs.play.services.base
freeImplementation libs.conscrypt.android
2024-02-25 11:28:34 +01:00
2024-09-25 00:40:12 +02:00
playApi libs.androidx.mediarouter
2024-06-23 19:58:04 +02:00
// playApi "com.google.android.support:wearable:2.9.0"
2024-09-25 00:40:12 +02:00
playApi libs.play.services.cast.framework
2024-02-25 11:28:34 +01:00
}
2024-06-23 19:58:04 +02:00
apply plugin: "io.realm.kotlin"
2024-02-05 21:50:43 +01:00
2024-02-20 11:30:25 +01:00
if (project.hasProperty("podciniPlayPublisherCredentials")) {
2024-02-05 21:50:43 +01:00
apply plugin: 'com.github.triplet.play'
play {
track.set('alpha')
2024-02-20 11:30:25 +01:00
serviceAccountCredentials.set(file(podciniPlayPublisherCredentials))
2024-02-05 21:50:43 +01:00
}
}
2024-02-14 07:09:48 +01:00
tasks.register('copyLicense', Copy) {
2024-02-05 21:50:43 +01:00
from "../LICENSE"
into "src/main/assets/"
rename { String fileName ->
fileName + ".txt"
}
}
preBuild.dependsOn copyLicense