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 35 targetSdk 30 kotlinOptions { jvmTarget = '17' } vectorDrawables.useSupportLibrary false vectorDrawables.generatedDensities = [] testApplicationId "ac.mdiq.podcini.tests" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" versionCode 3020274 versionName "6.11.4" 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 { implementation libs.androidx.material3.android implementation libs.androidx.material3 // implementation libs.androidx.ui.viewbinding implementation libs.androidx.fragment.compose // implementation libs.androidx.material.icons.extended /** Desugaring for using VistaGuide **/ coreLibraryDesugaring libs.desugar.jdk.libs.nio implementation libs.vistaguide def composeBom = libs.androidx.compose.bom implementation composeBom androidTestImplementation composeBom // 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 implementation libs.androidx.fragment.fragment.ktx 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 // 5.5.0-b01 is newer than 5.5.0-compose01 implementation libs.iconics.core implementation libs.iconics.views implementation libs.google.material.typeface implementation libs.google.material.typeface.outlined implementation libs.fontawesome.typeface // implementation libs.speed.dial implementation libs.searchpreference implementation libs.balloon implementation libs.recyclerviewswipedecorator implementation libs.stream implementation libs.fyydlin implementation libs.readability4j // debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.14' // Non-free dependencies: playImplementation libs.core.ktx compileOnly libs.wearable // this one can not be updated? TODO: need to get an alternative androidTestImplementation libs.nanohttpd 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 // Non-free dependencies: testImplementation libs.androidx.core testImplementation libs.awaitility testImplementation libs.junit testImplementation libs.mockito.inline testImplementation libs.robolectric testImplementation libs.javax.inject playImplementation libs.play.services.base freeImplementation libs.conscrypt.android playApi libs.androidx.mediarouter // playApi "com.google.android.support:wearable:2.9.0" playApi libs.play.services.cast.framework } 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