Implement Android RSS/Atom feed parser

- Add FeedParser.kt with automatic feed type detection
- Add RSSParser.kt for RSS 2.0 feeds
- Add AtomParser.kt for Atom 1.0 feeds
- Add comprehensive unit tests for both parsers
- Support iTunes namespace and enclosures
- Fix pre-existing compilation issues in the codebase
- Update build.gradle.kts with proper dependencies and AGP 8.5.0
This commit is contained in:
2026-03-30 09:01:49 -04:00
parent ac5250b2af
commit d84b8ff4e8
19 changed files with 1555 additions and 18 deletions

View File

@@ -1,8 +1,8 @@
plugins {
id("com.android.library")
id("org.jetbrains.kotlin.android")
id("kotlin-parcelize")
id("kotlin-kapt")
id("com.android.library") version "8.5.0"
id("org.jetbrains.kotlin.android") version "1.9.22"
id("org.jetbrains.kotlin.plugin.parcelize") version "1.9.22"
id("org.jetbrains.kotlin.kapt") version "1.9.22"
}
android {
@@ -23,29 +23,40 @@ android {
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
isCoreLibraryDesugaringEnabled = true
}
kotlinOptions {
jvmTarget = "17"
}
sourceSets {
getByName("main") {
java.srcDirs("src/main/java")
}
}
}
dependencies {
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.0.4")
// AndroidX
implementation("androidx.core:core-ktx:1.12.0")
// XML Parsing - built-in XmlPullParser
implementation("androidx.room:room-runtime:2.6.1")
implementation("androidx.room:room-ktx:2.6.1")
kapt("androidx.room:room-compiler:2.6.1")
// Moshi for JSON serialization
implementation("com.squareup.moshi:moshi-kotlin:1.15.1")
kapt("com.squareup.moshi:moshi-kotlin-codegen:1.15.1")
implementation("com.squareup.moshi:moshi-kotlin-reflect:1.15.1")
implementation("com.squareup.moshi:moshi:1.15.0")
kapt("com.squareup.moshi:moshi-kotlin-codegen:1.15.0")
implementation("com.squareup.moshi:moshi-kotlin:1.15.0")
// Testing
testImplementation("junit:junit:4.13.2")
testImplementation("com.squareup.moshi:moshi-kotlin:1.15.1")
testImplementation("com.squareup.moshi:moshi-kotlin-reflect:1.15.1")
testImplementation("com.squareup.moshi:moshi:1.15.0")
testImplementation("com.squareup.moshi:moshi-kotlin:1.15.0")
testImplementation("org.mockito:mockito-core:5.7.0")
testImplementation("org.mockito:mockito-inline:5.2.0")
testImplementation("androidx.room:room-testing:2.6.1")
@@ -54,4 +65,5 @@ dependencies {
testImplementation("androidx.test:core:1.5.0")
testImplementation("androidx.test.ext:junit:1.1.5")
testImplementation("androidx.test:runner:1.5.2")
testImplementation("org.robolectric:robolectric:4.11.1")
}