book-reader/app/build.gradle.kts
Aryan 8366d76dcd
Windows (#291)
* Centralize library management logic and introduce support for plain text and HTML formats

* Centralize library management logic and introduce support for plain text and HTML formats

* Expand unit test coverage for library state management, UI models, and MainViewModel features.

* Add comprehensive unit tests for PDF reader core logic, preferences, and data persistence

* Add unit tests for EPUB parsing, content loading, search functionality, and reader JavaScript bridges.

* Add unit tests for OPDS parsing and Smart Collection engine, and integrate Kover plugin

* Add comprehensive unit tests

* Centralize library snapshot serialization in the `shared` module and improve filtering and sorting logic.

* Implement text selection, highlighting, and reading state persistence for PDF and EPUB engines in desktop version

* Folder import support for desktop app

* Introduce Smart Shelves with rule-based filtering in desktop version

* Implement shared EPUB annotation serialization and highlight rendering

* Centralize file type capabilities and platform-specific support logic

* Refactor reader state management to use a central reducer

* Implement customizable reader toolbar and advanced formatting settings in shared

* Implement locator-based navigation and customizable highlight palette for desktop app

* Enhance reader customization and expand search functionality in desktop app

* Redesign reader settings and tools into a tabbed control panel in desktop app

* Enhance reader navigation and highlight precision in desktop app

* Implement bidirectional position synchronization and dynamic highlights in the desktop reader

* Implement shared state management and enhanced search for the PDF reader in desktop app

* Add vertical scroll support to the desktop PDF reader

* Implement ink, text, and eraser annotation support in desktop PDF viewer

* Implement PDF bookmarks, Table of Contents, and annotation editing in desktop app

* Implement link handling and navigation for PDF and EPUB readers in desktop app

* Implement PDF jump history for navigation in desktop app

* Enhance PDF ink rendering and annotation capabilities in desktop app

* Implement advanced PDF text annotations with inline editing and rich styling in desktop app

* Add move handle and movement logic for PDF text annotations in desktop app

* Implement local folder synchronization and metadata sidecar support in desktop app

* Implement book metadata extraction and drag-and-drop import for Desktop

* Implement dynamic and custom app theme management for desktop

* Introduce canonical PDF annotation codec and support for multi-segment highlights

* Implement rich text editing and pagination support for the PDF reader in desktop app

* Improve PDF rich text pagination, synchronization, and observability in desktop

* Hide trailing structural page breaks in rich text editor

* Implement a unified JVM book loader and expand supported formats on Desktop

* Add comic archive support for Desktop and enhance MOBI parsing

* Implement shared OPDS catalog support and UI for Android and Desktop

* Improve native WebView lifecycle and surface transition management on Desktop

* Enable Compose Swing interop blending and simplify Desktop WebView management

* Integrate BYOK AI features and Cloud TTS for desktop

* Enhance Desktop TTS with streaming audio and improved secure storage for AI key

* Implement scoped Cloud TTS with synchronized highlighting for EPUB and PDF in desktop app

* Implement custom font management and utility screens in desktop app

* Implement PDFium-based PDF annotation export

* Remove PdfBox dependency and standardize PDF export via Pdfium

* Implement local audio caching and playback controls for Gemini Cloud TTS in desktop app

* Implement reader themes and custom texture support in desktop app

* Redesign non-reader UI with responsive navigation and enhanced library management in desktop app

* Introduce ReaderWorkspaceShell to unify EPUB and PDF reader layouts in desktop app

* Exclude manual-only files from automated sync and import

* Implement customizable Text-to-Speech (TTS) word replacements

* Optimize reader performance with persistent layout caching and decoupled theme rendering

* Improve position restoration during reader reconfiguration in epub pagination

* Use independent thickness for eraser tool and stylus override
2026-05-10 10:07:37 +05:30

285 lines
9.4 KiB
Kotlin

@file:Suppress("UnstableApiUsage")
import java.util.Properties
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.kotlin.compose)
id("org.jetbrains.kotlin.plugin.serialization") version "2.1.20"
alias(libs.plugins.kotlin.ksp)
id("com.diffplug.spotless") version "8.2.1"
alias(libs.plugins.kover)
}
val localProperties = Properties()
val localPropertiesFile = rootProject.file("local.properties")
if (localPropertiesFile.exists()) {
localPropertiesFile.inputStream().use { localProperties.load(it) }
}
kotlin {
jvmToolchain(21)
}
android {
namespace = "com.aryan.reader"
compileSdk = 36
defaultConfig {
applicationId = "com.aryan.reader"
minSdk = 26
targetSdk = 35
versionCode = 51
versionName = "1.0.47"
resourceConfigurations += setOf("en", "ar", "de", "tr", "fr", "ru")
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
externalNativeBuild {
cmake {
cppFlags += ""
}
}
buildConfigField("boolean", "IS_PRO", "false")
buildConfigField("boolean", "IS_OFFLINE", "false")
}
flavorDimensions += "version"
productFlavors {
create("oss") {
dimension = "version"
applicationIdSuffix = ".oss"
versionNameSuffix = "-oss"
buildConfigField("String", "AI_WORKER_URL", "\"\"")
buildConfigField("String", "VERIFIER_WORKER_URL", "\"\"")
buildConfigField("String", "FEEDBACK_WORKER_URL", "\"\"")
buildConfigField("boolean", "IS_PRO", "false")
buildConfigField("String", "TTS_WORKER_URL", "\"\"")
}
}
packaging {
resources {
excludes += "/META-INF/{AL2.0,LGPL2.1}"
}
jniLibs {
excludes += "**/libbrotlicommon.so"
excludes += "**/libbrotlidec.so"
excludes += "**/libbrotlienc.so"
}
}
signingConfigs {
create("release") {
val storePath = localProperties.getProperty("MYAPP_RELEASE_STORE_FILE")
if (!storePath.isNullOrEmpty()) {
storeFile = file(storePath)
storePassword = localProperties.getProperty("MYAPP_RELEASE_STORE_PASSWORD")
keyAlias = localProperties.getProperty("MYAPP_RELEASE_KEY_ALIAS")
keyPassword = localProperties.getProperty("MYAPP_RELEASE_KEY_PASSWORD")
}
}
}
buildTypes {
release {
val storePath = localProperties.getProperty("MYAPP_RELEASE_STORE_FILE")
if (!storePath.isNullOrEmpty()) {
signingConfig = signingConfigs.getByName("release")
}
isMinifyEnabled = true
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
create("releaseOffline") {
initWith(getByName("release"))
matchingFallbacks += listOf("release")
buildConfigField("boolean", "IS_OFFLINE", "true")
}
}
applicationVariants.all {
val variant = this
outputs.all {
val output = this as com.android.build.gradle.internal.api.ApkVariantOutputImpl
val flavor = variant.productFlavors.getOrNull(0)?.name ?: ""
val buildType = variant.buildType.name
val version = variant.versionName
output.outputFileName = "Episteme-$flavor-v$version-$buildType.apk"
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
kotlinOptions {
jvmTarget = "21"
}
buildFeatures {
compose = true
buildConfig = true
}
dependenciesInfo {
includeInApk = false
includeInBundle = false
}
publishing {
singleVariant("release") {
}
}
externalNativeBuild {
cmake {
path = file("src/main/cpp/CMakeLists.txt")
version = "3.22.1"
}
}
testOptions {
unitTests.isReturnDefaultValues = true
unitTests.all {
it.jvmArgs("-Xss2m")
}
}
configurations {
named("testImplementation") {
exclude(group = "org.slf4j", module = "slf4j-android")
}
}
}
kover {
reports {
filters {
excludes {
classes(
"*.BuildConfig",
"*.ComposableSingletons*",
"*_Impl",
"*Database_Impl",
"*Dao_Impl"
)
}
}
}
}
//noinspection UseTomlInstead
dependencies {
implementation(project(":shared"))
implementation(libs.androidx.core.ktx)
implementation(libs.androidx.lifecycle.runtime.ktx)
implementation(libs.androidx.activity.compose)
implementation(platform(libs.androidx.compose.bom))
implementation(libs.androidx.ui)
implementation(libs.androidx.ui.graphics)
implementation(libs.androidx.ui.tooling.preview)
implementation(libs.androidx.material3)
implementation(libs.androidx.material3.window.size.class1.android)
implementation(libs.androidx.credentials)
androidTestImplementation(libs.androidx.junit)
androidTestImplementation(libs.androidx.espresso.core)
androidTestImplementation(platform(libs.androidx.compose.bom))
androidTestImplementation(libs.androidx.ui.test.junit4)
androidTestImplementation("androidx.test:rules:1.7.0")
androidTestImplementation("androidx.test.espresso:espresso-web:3.7.0")
androidTestImplementation("com.google.truth:truth:1.4.2")
androidTestImplementation("androidx.navigation:navigation-testing:2.9.6")
androidTestImplementation("io.mockk:mockk-android:1.13.11") {
exclude(group = "org.junit.jupiter")
}
androidTestImplementation(libs.kotlinx.coroutines.test)
debugImplementation(libs.androidx.ui.test.manifest)
implementation(libs.androidx.room.runtime)
implementation(libs.androidx.room.ktx)
ksp(libs.androidx.room.compiler)
implementation("androidx.compose.material:material-icons-extended:1.7.8")
implementation("androidx.appcompat:appcompat:1.7.1")
//noinspection GradleDependency (Updating these might cause the custom toolbox in pagination to break)
implementation("androidx.navigation:navigation-compose:2.9.6")
//noinspection GradleDependency
implementation("androidx.lifecycle:lifecycle-viewmodel-compose:2.9.2")
//noinspection GradleDependency
implementation("androidx.lifecycle:lifecycle-runtime-compose:2.9.2")
//noinspection GradleDependency
implementation("androidx.compose.material3.adaptive:adaptive:1.2.0-alpha11")
implementation("org.jsoup:jsoup:1.17.2")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.7.3")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-protobuf:1.7.3")
implementation("io.coil-kt:coil-compose:2.7.0")
implementation("io.coil-kt:coil-svg:2.6.0")
implementation("androidx.media3:media3-exoplayer:1.8.0")
implementation("androidx.media3:media3-session:1.8.0")
implementation("androidx.media3:media3-ui:1.8.0")
implementation("androidx.work:work-runtime-ktx:2.10.5")
implementation("androidx.compose.runtime:runtime-livedata:1.9.3")
implementation("org.slf4j:slf4j-android:1.7.36")
implementation("org.commonmark:commonmark:0.22.0")
implementation("com.jakewharton.timber:timber:5.0.1")
implementation("me.zhanghai.android.libarchive:library:1.1.6")
implementation("androidx.paging:paging-runtime-ktx:3.3.6")
implementation("androidx.paging:paging-compose:3.3.6")
implementation("androidx.room:room-paging:2.7.1")
// Flexmark for Markdown parsing (MD -> HTML)
implementation("com.vladsch.flexmark:flexmark:0.64.8")
implementation("com.vladsch.flexmark:flexmark-ext-tables:0.64.8")
implementation("com.vladsch.flexmark:flexmark-ext-gfm-strikethrough:0.64.8")
implementation("com.vladsch.flexmark:flexmark-ext-gfm-tasklist:0.64.8")
implementation("com.vladsch.flexmark:flexmark-ext-autolink:0.64.8")
implementation("androidx.documentfile:documentfile:1.0.1")
implementation("androidx.browser:browser:1.8.0")
implementation("io.legere:pdfiumandroid:2.0.0")
implementation("org.zwobble.mammoth:mammoth:1.4.2")
implementation("com.materialkolor:material-kolor:5.0.0-alpha07")
debugImplementation("org.tensorflow:tensorflow-lite:2.17.0")
debugImplementation("org.tensorflow:tensorflow-lite-support:0.5.0")
debugImplementation("org.tensorflow:tensorflow-lite-gpu:2.17.0")
debugImplementation("org.tensorflow:tensorflow-lite-gpu-api:2.17.0")
implementation("androidx.core:core-splashscreen:1.2.0")
testImplementation("junit:junit:4.13.2")
testImplementation("io.mockk:mockk-android:1.14.9")
testImplementation(libs.kotlinx.coroutines.test)
testImplementation("org.json:json:20251224")
testImplementation("org.robolectric:robolectric:4.16.1")
testImplementation("org.slf4j:slf4j-nop:2.0.17")
}
spotless {
kotlin {
target("src/main/java/**/*.kt", "src/main/kotlin/**/*.kt")
licenseHeaderFile(rootProject.file("spotless/copyright.kt"))
}
cpp {
target("src/main/cpp/mobi_jni_bridge.c", "src/main/cpp/Woff2Converter.cpp")
licenseHeaderFile(rootProject.file("spotless/copyright.kt"))
}
}