mirror of
https://github.com/recloudstream/cloudstream.git
synced 2025-05-17 11:15:54 +08:00
Dokka: fix compatibility with multiplatform and configuration cache (#1493)
* Dokka: fix compatibility with multiplatform/modules Fixes many "<Error class: unknown class>" such as with LiveData and RecyclerView as well as potential conflicts in class names between modules
This commit is contained in:
2
.github/workflows/generate_dokka.yml
vendored
2
.github/workflows/generate_dokka.yml
vendored
@ -41,6 +41,8 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
cd $GITHUB_WORKSPACE/dokka/
|
cd $GITHUB_WORKSPACE/dokka/
|
||||||
rm -rf "./-cloudstream"
|
rm -rf "./-cloudstream"
|
||||||
|
rm -rf "./app"
|
||||||
|
rm -rf "./library"
|
||||||
|
|
||||||
- name: Setup JDK 17
|
- name: Setup JDK 17
|
||||||
uses: actions/setup-java@v4
|
uses: actions/setup-java@v4
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
import com.android.build.gradle.internal.cxx.configure.gradleLocalProperties
|
import com.android.build.gradle.internal.cxx.configure.gradleLocalProperties
|
||||||
|
import org.jetbrains.dokka.gradle.engine.parameters.KotlinPlatform
|
||||||
|
import org.jetbrains.dokka.gradle.engine.parameters.VisibilityModifier
|
||||||
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
||||||
import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile
|
import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile
|
||||||
|
|
||||||
@ -266,4 +268,23 @@ tasks.withType<KotlinJvmCompile> {
|
|||||||
jvmTarget.set(javaTarget)
|
jvmTarget.set(javaTarget)
|
||||||
freeCompilerArgs.add("-Xjvm-default=all-compatibility")
|
freeCompilerArgs.add("-Xjvm-default=all-compatibility")
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dokka {
|
||||||
|
moduleName = "App"
|
||||||
|
dokkaSourceSets {
|
||||||
|
main {
|
||||||
|
analysisPlatform = KotlinPlatform.JVM
|
||||||
|
documentedVisibilities(
|
||||||
|
VisibilityModifier.Public,
|
||||||
|
VisibilityModifier.Protected
|
||||||
|
)
|
||||||
|
|
||||||
|
sourceLink {
|
||||||
|
localDirectory = file("..")
|
||||||
|
remoteUrl("https://github.com/recloudstream/cloudstream/tree/master")
|
||||||
|
remoteLineSuffix = "#L"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
@ -1,110 +1,13 @@
|
|||||||
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
|
||||||
import java.net.URI
|
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id("com.android.library")
|
kotlin("jvm")
|
||||||
id("kotlin-android")
|
|
||||||
id("org.jetbrains.dokka")
|
id("org.jetbrains.dokka")
|
||||||
}
|
}
|
||||||
|
|
||||||
val javaTarget = JvmTarget.fromTarget(libs.versions.jvmTarget.get())
|
|
||||||
|
|
||||||
android {
|
|
||||||
compileSdk = libs.versions.compileSdk.get().toInt()
|
|
||||||
sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
|
|
||||||
|
|
||||||
defaultConfig {
|
|
||||||
minSdk = libs.versions.minSdk.get().toInt()
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace = "com.lagradost.api"
|
|
||||||
|
|
||||||
compileOptions {
|
|
||||||
sourceCompatibility = JavaVersion.toVersion(javaTarget.target)
|
|
||||||
targetCompatibility = JavaVersion.toVersion(javaTarget.target)
|
|
||||||
}
|
|
||||||
|
|
||||||
@Suppress("UnstableApiUsage")
|
|
||||||
testOptions {
|
|
||||||
targetSdk = libs.versions.targetSdk.get().toInt()
|
|
||||||
}
|
|
||||||
|
|
||||||
lint {
|
|
||||||
targetSdk = libs.versions.targetSdk.get().toInt()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
val dokkaImplementation: Configuration by configurations.creating {
|
|
||||||
// This ensures you can access artifacts
|
|
||||||
isCanBeResolved = true
|
|
||||||
isTransitive = true
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
dokkaImplementation(libs.junit.ktx)
|
dokka(project(":app:"))
|
||||||
dokkaImplementation(libs.core.ktx)
|
dokka(project(":library:"))
|
||||||
dokkaImplementation(libs.appcompat)
|
|
||||||
dokkaImplementation(libs.navigation.ui.ktx)
|
|
||||||
dokkaImplementation(libs.lifecycle.livedata.ktx)
|
|
||||||
dokkaImplementation(libs.lifecycle.viewmodel.ktx)
|
|
||||||
dokkaImplementation(libs.navigation.fragment.ktx)
|
|
||||||
dokkaImplementation(libs.preference.ktx)
|
|
||||||
dokkaImplementation(libs.material)
|
|
||||||
dokkaImplementation(libs.constraintlayout)
|
|
||||||
dokkaImplementation(libs.swiperefreshlayout)
|
|
||||||
dokkaImplementation(libs.guava)
|
|
||||||
dokkaImplementation(libs.auto.service.ksp)
|
|
||||||
dokkaImplementation(libs.bundles.media3)
|
|
||||||
dokkaImplementation(libs.colorpicker) // Subtitle Color Picker
|
|
||||||
dokkaImplementation(libs.bundles.nextlibMedia3)
|
|
||||||
dokkaImplementation(libs.newpipeextractor)
|
|
||||||
dokkaImplementation(libs.juniversalchardet) // Subtitle Decoding
|
|
||||||
dokkaImplementation(libs.acra.core)
|
|
||||||
dokkaImplementation(libs.acra.toast)
|
|
||||||
dokkaImplementation(libs.shimmer) // Shimmering Effect (Loading Skeleton)
|
|
||||||
dokkaImplementation(libs.palette.ktx) // Palette for Images -> Colors
|
|
||||||
dokkaImplementation(libs.tvprovider)
|
|
||||||
dokkaImplementation(libs.overlappingpanels) // Gestures
|
|
||||||
dokkaImplementation(libs.biometric) // Fingerprint Authentication
|
|
||||||
dokkaImplementation(libs.previewseekbar.media3) // SeekBar Preview
|
|
||||||
dokkaImplementation(libs.qrcode.kotlin) // QR Code for PIN Auth on TV
|
|
||||||
dokkaImplementation(libs.rhino) // Run JavaScript
|
|
||||||
dokkaImplementation(libs.fuzzywuzzy) // Library/Ext Searching with Levenshtein Distance
|
|
||||||
dokkaImplementation(libs.safefile) // To Prevent the URI File Fu*kery
|
|
||||||
dokkaImplementation(libs.conscrypt.android) // To Fix SSL Fu*kery on Android 9
|
|
||||||
dokkaImplementation(libs.tmdb.java) // TMDB API v3 Wrapper Made with RetroFit
|
|
||||||
dokkaImplementation(libs.jackson.module.kotlin) // JSON Parser
|
|
||||||
dokkaImplementation(libs.work.runtime)
|
|
||||||
dokkaImplementation(libs.work.runtime.ktx)
|
|
||||||
dokkaImplementation(libs.nicehttp) // HTTP Lib
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dokka {
|
dokka {
|
||||||
dokkaSourceSets {
|
moduleName = "Cloudstream"
|
||||||
moduleName = "Cloudstream"
|
|
||||||
register("cloudstream") {
|
|
||||||
listOf("androidMain", "commonMain").forEach { srcName ->
|
|
||||||
sourceRoots.from("../library/src/$srcName/kotlin")
|
|
||||||
}
|
|
||||||
sourceRoots.from(file("../app/src/main/java"))
|
|
||||||
|
|
||||||
classpath.from(android.bootClasspath)
|
|
||||||
classpath.from(dokkaImplementation.files)
|
|
||||||
|
|
||||||
sourceLink {
|
|
||||||
localDirectory = file("..")
|
|
||||||
remoteUrl("https://github.com/recloudstream/cloudstream/tree/master")
|
|
||||||
remoteLineSuffix = "#L"
|
|
||||||
}
|
|
||||||
|
|
||||||
externalDocumentationLinks {
|
|
||||||
dokkaImplementation.dependencies.forEach {
|
|
||||||
register(it.name) {
|
|
||||||
url = URI("https://javadoc.io/doc/${it.group}/${it.name}/${it.version}")
|
|
||||||
packageListUrl = URI("https://javadoc.io/doc/${it.group}/${it.name}/${it.version}/package-list")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
@ -1,7 +1,6 @@
|
|||||||
[versions]
|
[versions]
|
||||||
acraCore = "5.11.3"
|
acraCore = "5.11.3"
|
||||||
appcompat = "1.7.0"
|
appcompat = "1.7.0"
|
||||||
autoServiceKsp = "1.2.0"
|
|
||||||
biometric = "1.2.0-alpha05"
|
biometric = "1.2.0-alpha05"
|
||||||
buildkonfigGradlePlugin = "0.15.2"
|
buildkonfigGradlePlugin = "0.15.2"
|
||||||
coil = "3.0.4"
|
coil = "3.0.4"
|
||||||
@ -14,7 +13,6 @@ dokkaGradlePlugin = "2.0.0"
|
|||||||
espressoCore = "3.6.1"
|
espressoCore = "3.6.1"
|
||||||
fuzzywuzzy = "1.4.0"
|
fuzzywuzzy = "1.4.0"
|
||||||
gradle = "8.8.0"
|
gradle = "8.8.0"
|
||||||
guava = "33.3.1-android"
|
|
||||||
jacksonModuleKotlin = "2.13.1"
|
jacksonModuleKotlin = "2.13.1"
|
||||||
json = "20240303"
|
json = "20240303"
|
||||||
junit = "4.13.2"
|
junit = "4.13.2"
|
||||||
@ -58,7 +56,6 @@ torrentserver-aniyomi = { module = "com.github.Diegopyl1209:torrentserver-aniyom
|
|||||||
acra-core = { module = "ch.acra:acra-core", version.ref = "acraCore" }
|
acra-core = { module = "ch.acra:acra-core", version.ref = "acraCore" }
|
||||||
acra-toast = { module = "ch.acra:acra-toast", version.ref = "acraCore" }
|
acra-toast = { module = "ch.acra:acra-toast", version.ref = "acraCore" }
|
||||||
appcompat = { module = "androidx.appcompat:appcompat", version.ref = "appcompat" }
|
appcompat = { module = "androidx.appcompat:appcompat", version.ref = "appcompat" }
|
||||||
auto-service-ksp = { module = "dev.zacsweers.autoservice:auto-service-ksp", version.ref = "autoServiceKsp" }
|
|
||||||
biometric = { module = "androidx.biometric:biometric", version.ref = "biometric" }
|
biometric = { module = "androidx.biometric:biometric", version.ref = "biometric" }
|
||||||
buildkonfig-gradle-plugin = { module = "com.codingfeline.buildkonfig:buildkonfig-gradle-plugin", version.ref = "buildkonfigGradlePlugin" }
|
buildkonfig-gradle-plugin = { module = "com.codingfeline.buildkonfig:buildkonfig-gradle-plugin", version.ref = "buildkonfigGradlePlugin" }
|
||||||
coil = { module = "io.coil-kt.coil3:coil", version.ref = "coil" }
|
coil = { module = "io.coil-kt.coil3:coil", version.ref = "coil" }
|
||||||
@ -74,7 +71,6 @@ espresso-core = { module = "androidx.test.espresso:espresso-core", version.ref =
|
|||||||
ext-junit = { module = "androidx.test.ext:junit", version.ref = "junitVersion" }
|
ext-junit = { module = "androidx.test.ext:junit", version.ref = "junitVersion" }
|
||||||
fuzzywuzzy = { module = "me.xdrop:fuzzywuzzy", version.ref = "fuzzywuzzy" }
|
fuzzywuzzy = { module = "me.xdrop:fuzzywuzzy", version.ref = "fuzzywuzzy" }
|
||||||
gradle = { module = "com.android.tools.build:gradle", version.ref = "gradle" }
|
gradle = { module = "com.android.tools.build:gradle", version.ref = "gradle" }
|
||||||
guava = { module = "com.google.guava:guava", version.ref = "guava" }
|
|
||||||
jackson-module-kotlin = { module = "com.fasterxml.jackson.module:jackson-module-kotlin", version.ref = "jacksonModuleKotlin" }
|
jackson-module-kotlin = { module = "com.fasterxml.jackson.module:jackson-module-kotlin", version.ref = "jacksonModuleKotlin" }
|
||||||
jetbrains-kotlin-gradle-plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlinGradlePluginVersion" }
|
jetbrains-kotlin-gradle-plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlinGradlePluginVersion" }
|
||||||
json = { module = "org.json:json", version.ref = "json" }
|
json = { module = "org.json:json", version.ref = "json" }
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
import com.codingfeline.buildkonfig.compiler.FieldSpec
|
import com.codingfeline.buildkonfig.compiler.FieldSpec
|
||||||
|
import org.jetbrains.dokka.gradle.engine.parameters.KotlinPlatform
|
||||||
|
import org.jetbrains.dokka.gradle.engine.parameters.VisibilityModifier
|
||||||
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
||||||
import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile
|
import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile
|
||||||
|
|
||||||
@ -7,6 +9,7 @@ plugins {
|
|||||||
id("maven-publish")
|
id("maven-publish")
|
||||||
id("com.android.library")
|
id("com.android.library")
|
||||||
id("com.codingfeline.buildkonfig")
|
id("com.codingfeline.buildkonfig")
|
||||||
|
id("org.jetbrains.dokka")
|
||||||
}
|
}
|
||||||
|
|
||||||
val javaTarget = JvmTarget.fromTarget(libs.versions.jvmTarget.get())
|
val javaTarget = JvmTarget.fromTarget(libs.versions.jvmTarget.get())
|
||||||
@ -85,4 +88,23 @@ publishing {
|
|||||||
groupId = "com.lagradost.api"
|
groupId = "com.lagradost.api"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dokka {
|
||||||
|
moduleName = "Library"
|
||||||
|
dokkaSourceSets {
|
||||||
|
configureEach {
|
||||||
|
analysisPlatform = KotlinPlatform.AndroidJVM
|
||||||
|
documentedVisibilities(
|
||||||
|
VisibilityModifier.Public,
|
||||||
|
VisibilityModifier.Protected
|
||||||
|
)
|
||||||
|
|
||||||
|
sourceLink {
|
||||||
|
localDirectory = file("..")
|
||||||
|
remoteUrl("https://github.com/recloudstream/cloudstream/tree/master")
|
||||||
|
remoteLineSuffix = "#L"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
Reference in New Issue
Block a user