2025-01-13 14:41:14 -05:00
|
|
|
import com.lagradost.cloudstream3.gradle.CloudstreamExtension
|
2023-02-15 01:54:28 -05:00
|
|
|
import com.android.build.gradle.BaseExtension
|
|
|
|
|
|
|
|
buildscript {
|
|
|
|
dependencies {
|
2025-02-14 18:11:46 -05:00
|
|
|
classpath(libs.recloudstream.gradle)
|
2023-02-15 01:54:28 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2025-02-14 18:11:46 -05:00
|
|
|
plugins {
|
|
|
|
alias(libs.plugins.android.application) apply false
|
|
|
|
alias(libs.plugins.android.library) apply false
|
|
|
|
alias(libs.plugins.kotlin) apply false
|
2023-02-15 01:54:28 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fun Project.cloudstream(configuration: CloudstreamExtension.() -> Unit) = extensions.getByName<CloudstreamExtension>("cloudstream").configuration()
|
|
|
|
|
|
|
|
fun Project.android(configuration: BaseExtension.() -> Unit) = extensions.getByName<BaseExtension>("android").configuration()
|
|
|
|
|
|
|
|
subprojects {
|
|
|
|
apply(plugin = "com.android.library")
|
|
|
|
apply(plugin = "kotlin-android")
|
|
|
|
apply(plugin = "com.lagradost.cloudstream3.gradle")
|
|
|
|
|
|
|
|
cloudstream {
|
|
|
|
// when running through github workflow, GITHUB_REPOSITORY should contain current repository name
|
|
|
|
// you can modify it to use other git hosting services, like gitlab
|
2024-07-30 14:29:24 -04:00
|
|
|
setRepo("CakesTwix", "cloudstream-extensions-uk", "gitea-git.cakestwix.com")
|
2025-01-13 14:41:14 -05:00
|
|
|
authors = listOf("CakesTwix")
|
2023-02-15 01:54:28 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
android {
|
2025-01-13 14:41:14 -05:00
|
|
|
namespace = "ua.CakesTwix"
|
|
|
|
|
|
|
|
defaultConfig {
|
|
|
|
minSdk = 21
|
|
|
|
compileSdkVersion(35)
|
|
|
|
targetSdk = 35
|
|
|
|
|
|
|
|
}
|
2023-02-15 01:54:28 -05:00
|
|
|
|
|
|
|
compileOptions {
|
|
|
|
sourceCompatibility = JavaVersion.VERSION_1_8
|
|
|
|
targetCompatibility = JavaVersion.VERSION_1_8
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
|
|
|
|
kotlinOptions {
|
|
|
|
jvmTarget = "1.8" // Required
|
|
|
|
// Disables some unnecessary features
|
|
|
|
freeCompilerArgs = freeCompilerArgs +
|
2025-01-13 14:41:14 -05:00
|
|
|
"-Xno-call-assertions" +
|
|
|
|
"-Xno-param-assertions" +
|
|
|
|
"-Xno-receiver-assertions"
|
2023-02-15 01:54:28 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
2025-02-14 18:11:46 -05:00
|
|
|
val apk by configurations
|
2023-02-15 01:54:28 -05:00
|
|
|
val implementation by configurations
|
2025-02-14 18:11:46 -05:00
|
|
|
val libs = rootProject.libs
|
2025-02-15 11:14:54 -05:00
|
|
|
val apkTasks = listOf("deployWithAdb", "build", "makePluginsJson")
|
2025-02-14 18:11:46 -05:00
|
|
|
val useApk = gradle.startParameter.taskNames.any { taskName ->
|
|
|
|
apkTasks.any { apkTask ->
|
|
|
|
taskName.contains(apkTask, ignoreCase = true)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// If the task is specifically to compile the app then use the stubs, otherwise us the library.
|
|
|
|
if (useApk) {
|
|
|
|
// Stubs for all Cloudstream classes
|
|
|
|
apk(libs.cloudstream3)
|
|
|
|
} else {
|
|
|
|
// For running locally
|
|
|
|
implementation(libs.cloudstreamapi)
|
|
|
|
}
|
2023-02-15 01:54:28 -05:00
|
|
|
|
|
|
|
// these dependencies can include any of those which are added by the app,
|
|
|
|
// but you dont need to include any of them if you dont need them
|
|
|
|
// https://github.com/recloudstream/cloudstream/blob/master/app/build.gradle
|
|
|
|
implementation(kotlin("stdlib")) // adds standard kotlin features, like listOf, mapOf etc
|
2025-02-14 18:11:46 -05:00
|
|
|
implementation(libs.nicehttp) // http library
|
|
|
|
implementation(libs.jsoup) // html parser
|
2023-02-15 01:54:28 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2025-02-14 18:11:46 -05:00
|
|
|
tasks.register<Delete>("clean") {
|
2025-02-15 04:30:56 -05:00
|
|
|
delete(getLayout().buildDirectory)
|
2023-02-15 01:54:28 -05:00
|
|
|
}
|