Podcini-podcast/app/build.gradle

298 lines
11 KiB
Groovy

plugins {
id 'com.android.application'
id 'kotlin-android'
id 'org.jetbrains.kotlin.android'
alias(libs.plugins.compose.compiler)
id 'io.realm.kotlin'
id('com.github.triplet.play') version '3.9.0' apply false
}
//apply plugin: 'org.jetbrains.compose'
composeCompiler {
enableStrongSkippingMode = true
reportsDestination = layout.buildDirectory.dir("compose_compiler")
// stabilityConfigurationFile = rootProject.layout.projectDirectory.file("stability_config.conf")
}
// from common.gradle
android {
defaultConfig {
minSdk 24
compileSdk 34
targetSdk 34
kotlinOptions {
jvmTarget = '17'
}
vectorDrawables.useSupportLibrary false
vectorDrawables.generatedDensities = []
testApplicationId "ac.mdiq.podcini.tests"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
versionCode 3020251
versionName "6.6.6"
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"'
}
}
packagingOptions {
resources {
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 {
// 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
buildConfig true
compose true
}
splits {
abi {
enable true
reset()
include "arm64-v8a"
universalApk true
}
}
// from playFlavor.gradle
flavorDimensions += ["market"]
productFlavors {
free {
dimension "market"
}
play {
dimension "market"
}
}
// start of the app build.gradle
namespace "ac.mdiq.podcini"
lint {
lintConfig = file("lint.xml")
checkReleaseBuilds false
checkDependencies true
warningsAsErrors true
abortOnError true
checkGeneratedSources = true
disable += ['TypographyDashes', 'TypographyQuotes', 'ObsoleteLintCustomCheck', 'BatteryLife',
'ExportedReceiver', 'VectorDrawableCompat', 'NestedWeights', 'Overdraw', 'TextFields',
'AlwaysShowAction', 'Autofill', 'ClickableViewAccessibility', 'ContentDescription',
'KeyboardInaccessibleWidget', 'LabelFor', 'RelativeOverlap', 'SetTextI18n',
'RtlCompat', 'RtlHardcoded', 'VectorPath', 'RtlEnabled']
}
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")
}
}
buildTypes {
release {
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard.cfg"
resValue "string", "app_name", "Podcini.R"
resValue "string", "provider_authority", "ac.mdiq.podcini.R.provider"
vcsInfo.include false
minifyEnabled true
shrinkResources true
signingConfig signingConfigs.releaseConfig
}
debug {
resValue "string", "app_name", "Podcini.R Debug"
applicationIdSuffix ".debug"
resValue "string", "provider_authority", "ac.mdiq.podcini.R.debug.provider"
}
}
applicationVariants.configureEach { variant ->
variant.outputs.configureEach { output ->
def applicationName = "Podcini.R"
def buildType = variant.buildType.name
def versionName = variant.versionName
def flavorName = variant.flavorName ?: ""
def abiName = output.getFilter(com.android.build.OutputFile.ABI) ?: ""
outputFileName = "${applicationName}_${buildType}_${flavorName}_${versionName}_${abiName}.apk"
}
}
androidResources {
additionalParameters "--no-version-vectors"
}
}
dependencies {
/** Desugaring for using VistaGuide **/
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs_nio:2.1.2'
implementation 'com.github.XilinJia.vistaguide:VistaGuide:lv0.24.2.6'
def composeBom = platform('androidx.compose:compose-bom:2024.09.01')
implementation composeBom
androidTestImplementation composeBom
implementation 'androidx.compose.material:material:1.7.1'
implementation 'androidx.compose.ui:ui-tooling-preview:1.7.1'
debugImplementation 'androidx.compose.ui:ui-tooling:1.7.1'
implementation 'androidx.activity:activity-compose:1.9.2'
implementation 'androidx.window:window:1.3.0'
implementation "androidx.core:core-ktx:1.13.1"
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.8.1'
implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.8.5"
implementation "androidx.annotation:annotation:1.8.2"
implementation 'androidx.appcompat:appcompat:1.7.0'
implementation 'androidx.coordinatorlayout:coordinatorlayout:1.2.0'
implementation "androidx.fragment:fragment-ktx:1.8.3"
implementation 'androidx.gridlayout:gridlayout:1.0.0'
implementation "androidx.media3:media3-exoplayer:1.4.1"
implementation "androidx.media3:media3-ui:1.4.1"
implementation "androidx.media3:media3-datasource-okhttp:1.4.1"
implementation "androidx.media3:media3-common:1.4.1"
implementation "androidx.media3:media3-session:1.4.1"
implementation "androidx.palette:palette-ktx:1.0.0"
implementation "androidx.preference:preference-ktx:1.2.1"
implementation "androidx.recyclerview:recyclerview:1.3.2"
implementation "androidx.viewpager2:viewpager2:1.1.0"
implementation "androidx.work:work-runtime:2.9.1"
implementation "androidx.core:core-splashscreen:1.0.1"
implementation 'androidx.documentfile:documentfile:1.0.1'
implementation 'androidx.webkit:webkit:1.11.0'
implementation "com.google.android.material:material:1.12.0"
implementation 'io.realm.kotlin:library-base:2.1.0'
implementation 'org.apache.commons:commons-lang3:3.15.0'
implementation 'commons-io:commons-io:2.16.1'
implementation 'org.jsoup:jsoup:1.18.1'
implementation 'io.coil-kt:coil:2.7.0'
implementation "com.squareup.okhttp3:okhttp:4.12.0"
implementation "com.squareup.okhttp3:okhttp-urlconnection:4.12.0"
implementation 'com.squareup.okio:okio:3.9.0'
implementation "io.reactivex.rxjava2:rxjava:2.2.21"
implementation "io.reactivex.rxjava3:rxjava:3.1.8"
implementation "io.reactivex.rxjava3:rxandroid:3.0.2"
// 5.5.0-b01 is newer than 5.5.0-compose01
implementation 'com.mikepenz:iconics-core:5.5.0-b01'
implementation 'com.mikepenz:iconics-views:5.5.0-b01'
implementation 'com.mikepenz:google-material-typeface:4.0.0.3-kotlin@aar'
implementation 'com.mikepenz:google-material-typeface-outlined:4.0.0.2-kotlin@aar'
implementation 'com.mikepenz:fontawesome-typeface:5.13.3.0-kotlin@aar'
implementation 'com.leinardi.android:speed-dial:3.3.0'
implementation 'com.github.ByteHamster:SearchPreference:v2.5.0'
implementation 'com.github.skydoves:balloon:1.6.6'
implementation 'com.github.xabaras:RecyclerViewSwipeDecorator:1.3'
implementation "com.annimon:stream:1.2.2"
implementation 'com.github.mfietz:fyydlin:v0.5.0'
implementation "net.dankito.readability4j:readability4j:1.0.8"
// debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.14'
// Non-free dependencies:
playImplementation 'com.google.android.play:core-ktx:1.8.1'
compileOnly "com.google.android.wearable:wearable:2.9.0"
// this one can not be updated? TODO: need to get an alternative
androidTestImplementation 'com.nanohttpd:nanohttpd:2.1.1'
androidTestImplementation "androidx.test.espresso:espresso-core:3.6.1"
androidTestImplementation "androidx.test.espresso:espresso-contrib:3.6.1"
androidTestImplementation "androidx.test.espresso:espresso-intents:3.6.1"
androidTestImplementation "androidx.test:runner:1.6.2"
androidTestImplementation "androidx.test:rules:1.6.1"
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
androidTestImplementation 'org.awaitility:awaitility:4.2.1'
// Non-free dependencies:
testImplementation "androidx.test:core:1.6.1"
testImplementation 'org.awaitility:awaitility:4.2.1'
testImplementation "junit:junit:4.13.2"
testImplementation 'org.mockito:mockito-inline:5.2.0'
testImplementation 'org.robolectric:robolectric:4.13'
testImplementation 'javax.inject:javax.inject:1'
playImplementation 'com.google.android.gms:play-services-base:18.5.0'
freeImplementation 'org.conscrypt:conscrypt-android:2.5.2'
playApi 'androidx.mediarouter:mediarouter:1.7.0'
// playApi "com.google.android.support:wearable:2.9.0"
playApi 'com.google.android.gms:play-services-cast-framework:21.5.0'
}
apply plugin: "io.realm.kotlin"
if (project.hasProperty("podciniPlayPublisherCredentials")) {
apply plugin: 'com.github.triplet.play'
play {
track.set('alpha')
serviceAccountCredentials.set(file(podciniPlayPublisherCredentials))
}
}
tasks.register('copyLicense', Copy) {
from "../LICENSE"
into "src/main/assets/"
rename { String fileName ->
fileName + ".txt"
}
}
preBuild.dependsOn copyLicense