Skip to content

Commit

Permalink
Cleanup Gradle and Version files, fix Dokka (#456)
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenzeck authored Feb 5, 2024
1 parent 6246f10 commit 2a3fbfe
Show file tree
Hide file tree
Showing 20 changed files with 37 additions and 44 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
run: echo "READIUM_VERSION=`git describe --tag --match [0-9]* --abbrev=0`" >> $GITHUB_ENV

- name: Run Dokka
run: ./gradlew dokkaGfmMultiModule
run: ./gradlew :dokkaGfmMultiModule

- name: Copy README.md into docs to replace Dokka index.md
run: cp README.md index.md
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ A [Test App](test-app) demonstrates how to integrate the Readium Kotlin toolkit

| Readium | Android min SDK | Android compile SDK | Kotlin compiler (✻) | Gradle (✻) |
|---------|-----------------|---------------------|---------------------|------------|
| 3.0.0 | 21 | 34 | 1.9.22 | 8.2.0 |
| 3.0.0 | 21 | 34 | 1.9.22 | 8.2.2 |
| 2.3.0 | 21 | 33 | 1.7.10 | 6.9.3 |

✻ Only required if you integrate Readium as a submodule instead of using Maven Central.
Expand Down
7 changes: 3 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,16 @@ plugins {
}

subprojects {
if (name != "test-app") {
apply(plugin = "org.jetbrains.dokka")
}
apply(plugin = "org.jlleitschuh.gradle.ktlint")

ktlint {
android.set(true)
}
}

tasks.register("clean", Delete::class).configure {
delete(rootProject.buildDir)
}

tasks.register("cleanDocs", Delete::class).configure {
delete("${project.rootDir}/docs/readium", "${project.rootDir}/docs/index.md", "${project.rootDir}/site")
}
Expand Down
2 changes: 1 addition & 1 deletion docs/migration-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ First of all, upgrade to version 2.4.0 and resolve any deprecation notices. This

### Minimum requirements

If you integrate Readium 3.0 as a submodule, it requires Kotlin 1.9.22 and Gradle 8.2.0. You should start by updating these dependencies in your application.
If you integrate Readium 3.0 as a submodule, it requires Kotlin 1.9.22 and Gradle 8.2.2. You should start by updating these dependencies in your application.

#### Targeting Android SDK 34

Expand Down
34 changes: 16 additions & 18 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[versions]

kotlin = "1.9.22"
agp = "8.2.1"
agp = "8.2.2"
gradle-maven-publish-plugin = "0.27.0"

accompanist = "0.32.0"
accompanist = "0.34.0"

androidx-activity = "1.8.2"
androidx-appcompat = "1.6.1"
Expand All @@ -13,12 +13,12 @@ androidx-cardview = "1.0.0"
# Make sure to align with the Kotlin version
# https://developer.android.com/jetpack/androidx/releases/compose-kotlin
androidx-compose-compiler = "1.5.8"
androidx-compose-animation = "1.5.4"
androidx-compose-foundation = "1.5.4"
androidx-compose-material = "1.5.4"
androidx-compose-animation = "1.6.0"
androidx-compose-foundation = "1.6.0"
androidx-compose-material = "1.6.0"
androidx-compose-material3 = "1.1.2"
androidx-compose-runtime = "1.5.4"
androidx-compose-ui = "1.5.4"
androidx-compose-runtime = "1.6.0"
androidx-compose-ui = "1.6.0"
androidx-constraintlayout = "2.1.4"
androidx-core = "1.12.0"
androidx-datastore = "1.0.0"
Expand All @@ -30,15 +30,15 @@ androidx-lifecycle = "2.7.0"
androidx-lifecycle-extensions = "2.2.0"
androidx-media = "1.7.0"
androidx-media2 = "1.3.0"
androidx-media3 = "1.2.0"
androidx-media3 = "1.2.1"
androidx-navigation = "2.7.6"
androidx-paging = "3.2.1"
androidx-recyclerview = "1.3.2"
androidx-room = "2.6.1"
androidx-viewpager2 = "1.0.0"
androidx-webkit = "1.9.0"
androidx-webkit = "1.10.0"

assertj = "3.25.1"
assertj = "3.25.2"

dokka = "1.9.10"

Expand Down Expand Up @@ -83,6 +83,7 @@ androidx-compose-foundation = { group = "androidx.compose.foundation", name = "f
androidx-compose-material = { group = "androidx.compose.material", name = "material", version.ref = "androidx-compose-material" }
androidx-compose-material3 = { group = "androidx.compose.material3", name = "material3", version.ref = "androidx-compose-material3" }
androidx-compose-material-icons = { group = "androidx.compose.material", name = "material-icons-extended", version.ref = "androidx-compose-material" }
androidx-compose-runtime = { group = "androidx.compose.runtime", name = "runtime", version.ref = "androidx-compose-runtime" }
androidx-compose-ui = { group = "androidx.compose.ui", name = "ui", version.ref = "androidx-compose-ui" }
androidx-compose-ui-tooling = { group = "androidx.compose.ui", name = "ui-tooling", version.ref = "androidx-compose-ui" }
androidx-constraintlayout = { group = "androidx.constraintlayout", name = "constraintlayout", version.ref = "androidx-constraintlayout" }
Expand Down Expand Up @@ -118,8 +119,6 @@ androidx-webkit = { group = "androidx.webkit", name = "webkit", version.ref = "a

assertj = { group = "org.assertj", name = "assertj-core", version.ref = "assertj" }

dokka-gradle = { group = "org.jetbrains.dokka", name = "dokka-gradle-plugin", version.ref = "dokka" }

google-exoplayer-core = { group = "com.google.android.exoplayer", name = "exoplayer-core", version.ref = "google-exoplayer" }
google-exoplayer-extension-media2 = { group = "com.google.android.exoplayer", name = "extension-media2", version.ref = "google-exoplayer" }
google-exoplayer-mediasession = { group = "com.google.android.exoplayer", name = "extension-mediasession", version.ref = "google-exoplayer" }
Expand All @@ -131,13 +130,11 @@ joda-time = { group = "joda-time", name = "joda-time", version.ref = "joda-time"
jsoup = { group = "org.jsoup", name = "jsoup", version.ref = "jsoup" }
junit = { group = "junit", name = "junit", version.ref = "junit" }

kotlin-gradle = { group = "org.jetbrains.kotlin", name = "kotlin-gradle-plugin", version.ref = "kotlin" }
kotlin-junit = { group = "org.jetbrains.kotlin", name = "kotlin-test-junit", version.ref = "kotlin" }
kotlin-reflect = { group = "org.jetbrains.kotlin", name = "kotlin-reflect", version.ref = "kotlin" }
kotlin-stdlib = { group = "org.jetbrains.kotlin", name = "kotlin-stdlib", version.ref = "kotlin" }

kotlinx-coroutines-android = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-android", version.ref = "kotlinx-coroutines" }
kotlinx-coroutines-core = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-core", version.ref = "kotlinx-coroutines" }
kotlinx-coroutines-test = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-test", version.ref = "kotlinx-coroutines-test" }
kotlinx-serialization-json = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-json", version.ref = "kotlinx-serialization-json" }

Expand All @@ -155,17 +152,18 @@ plugin-kotlin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.
plugin-maven-publish = { module = "com.vanniktech:gradle-maven-publish-plugin", version.ref = "gradle-maven-publish-plugin" }

[plugins]

kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" }
ktlint = { id = "org.jlleitschuh.gradle.ktlint", version.ref = "ktlint" }
ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" }
ktlint = { id = "org.jlleitschuh.gradle.ktlint", version.ref = "ktlint" }

[bundles]
compose = ["androidx-compose-activity", "androidx-compose-animation", "androidx-compose-foundation", "androidx-compose-material", "androidx-compose-material3", "androidx-compose-material-icons", "androidx-compose-ui", "androidx-compose-ui-tooling"]
coroutines = ["kotlinx-coroutines-core", "kotlinx-coroutines-android"]

compose = ["androidx-compose-activity", "androidx-compose-animation", "androidx-compose-foundation", "androidx-compose-material", "androidx-compose-material3", "androidx-compose-material-icons", "androidx-compose-runtime", "androidx-compose-ui", "androidx-compose-ui-tooling"]
exoplayer = ["google-exoplayer-core", "google-exoplayer-ui", "google-exoplayer-mediasession", "google-exoplayer-workmanager", "google-exoplayer-extension-media2"]
lifecycle = ["androidx-lifecycle-common", "androidx-lifecycle-extensions", "androidx-lifecycle-livedata", "androidx-lifecycle-runtime", "androidx-lifecycle-viewmodel", "androidx-lifecycle-vmsavedstate", "androidx-lifecycle-viewmodel-compose"]
media2 = ["androidx-media2-session", "androidx-media2-player"]
media2 = ["androidx-media2-session", "androidx-media2-player", "google-exoplayer-core", "google-exoplayer-extension-media2"]
media3 = ["androidx-media3-session", "androidx-media3-common", "androidx-media3-exoplayer"]
navigation = ["androidx-navigation-fragment", "androidx-navigation-ui"]
room = ["androidx-room-runtime", "androidx-room-ktx"]
Expand Down
2 changes: 1 addition & 1 deletion readium/adapters/exoplayer/audio/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ dependencies {
implementation(libs.androidx.media3.common)
implementation(libs.androidx.media3.exoplayer)
implementation(libs.timber)
implementation(libs.bundles.coroutines)
implementation(libs.kotlinx.coroutines.android)
implementation(libs.kotlinx.serialization.json)

// Tests
Expand Down
2 changes: 1 addition & 1 deletion readium/adapters/pdfium/document/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ dependencies {
implementation(libs.androidx.core)
implementation(libs.pdfium)
implementation(libs.timber)
implementation(libs.bundles.coroutines)
implementation(libs.kotlinx.coroutines.android)

testImplementation(libs.junit)

Expand Down
2 changes: 1 addition & 1 deletion readium/adapters/pdfium/navigator/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ dependencies {
api(libs.pdf.viewer)
implementation(libs.androidx.fragment.ktx)
implementation(libs.timber)
implementation(libs.bundles.coroutines)
implementation(libs.kotlinx.coroutines.android)
implementation(libs.kotlinx.serialization.json)

testImplementation(libs.junit)
Expand Down
2 changes: 1 addition & 1 deletion readium/adapters/pspdfkit/document/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ dependencies {
implementation(libs.androidx.core)
implementation(libs.timber)
implementation(libs.pspdfkit)
implementation(libs.bundles.coroutines)
implementation(libs.kotlinx.coroutines.android)

testImplementation(libs.junit)

Expand Down
2 changes: 1 addition & 1 deletion readium/adapters/pspdfkit/navigator/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ dependencies {
implementation(libs.androidx.fragment.ktx)
implementation(libs.timber)
implementation(libs.pspdfkit)
implementation(libs.bundles.coroutines)
implementation(libs.kotlinx.coroutines.android)
implementation(libs.kotlinx.serialization.json)

testImplementation(libs.junit)
Expand Down
2 changes: 1 addition & 1 deletion readium/lcp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ android {
}

dependencies {
implementation(libs.kotlinx.coroutines.core)
implementation(libs.kotlinx.coroutines.android)

api(project(":readium:readium-shared"))

Expand Down
5 changes: 1 addition & 4 deletions readium/navigator-media2/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,12 @@ dependencies {
api(project(":readium:readium-shared"))
api(project(":readium:readium-navigator"))

implementation(libs.bundles.coroutines)
implementation(libs.kotlinx.coroutines.android)

implementation(libs.timber)

implementation(libs.bundles.media2)

implementation(libs.google.exoplayer.core)
implementation(libs.google.exoplayer.extension.media2)

testImplementation(libs.junit)

androidTestImplementation(libs.androidx.ext.junit)
Expand Down
2 changes: 1 addition & 1 deletion readium/navigator/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ dependencies {
implementation(libs.google.material)
implementation(libs.timber)
implementation(libs.joda.time)
implementation(libs.bundles.coroutines)
implementation(libs.kotlinx.coroutines.android)
implementation(libs.kotlinx.serialization.json)
implementation(libs.jsoup)

Expand Down
2 changes: 1 addition & 1 deletion readium/navigators/media/audio/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ dependencies {

implementation(libs.androidx.core)
implementation(libs.timber)
implementation(libs.bundles.coroutines)
implementation(libs.kotlinx.coroutines.android)
}
2 changes: 1 addition & 1 deletion readium/navigators/media/common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ dependencies {

implementation(libs.androidx.media3.common)
implementation(libs.timber)
implementation(libs.bundles.coroutines)
implementation(libs.kotlinx.coroutines.android)
}
2 changes: 1 addition & 1 deletion readium/navigators/media/tts/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ dependencies {
implementation(libs.androidx.media3.session)

implementation(libs.timber)
implementation(libs.bundles.coroutines)
implementation(libs.kotlinx.coroutines.android)
implementation(libs.kotlinx.serialization.json)
}
2 changes: 1 addition & 1 deletion readium/opds/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ dependencies {
implementation(libs.androidx.appcompat)
implementation(libs.timber)
implementation(libs.joda.time)
implementation(libs.kotlinx.coroutines.core)
implementation(libs.kotlinx.coroutines.android)

// Tests
testImplementation(libs.junit)
Expand Down
2 changes: 1 addition & 1 deletion readium/shared/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ dependencies {
implementation(libs.timber)
implementation(libs.joda.time)
implementation(libs.kotlin.reflect)
implementation(libs.kotlinx.coroutines.core)
implementation(libs.kotlinx.coroutines.android)
implementation(libs.kotlinx.serialization.json)
implementation(libs.jsoup)

Expand Down
2 changes: 1 addition & 1 deletion readium/streamer/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ dependencies {
exclude(module = "support-v4")
}
implementation(libs.joda.time)
implementation(libs.kotlinx.coroutines.core)
implementation(libs.kotlinx.coroutines.android)

// Tests
testImplementation(libs.junit)
Expand Down
3 changes: 1 addition & 2 deletions test-app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ dependencies {

implementation(libs.accompanist.themeadapter.material)

implementation(libs.androidx.compose.activity)
implementation(libs.androidx.activity.ktx)
implementation(libs.androidx.appcompat)
implementation(libs.androidx.browser)
Expand All @@ -107,7 +106,7 @@ dependencies {
implementation(libs.timber)
implementation(libs.picasso)
implementation(libs.joda.time)
implementation(libs.kotlinx.coroutines.core)
implementation(libs.kotlinx.coroutines.android)
implementation(libs.jsoup)

implementation(libs.bundles.media3)
Expand Down

0 comments on commit 2a3fbfe

Please sign in to comment.