TestPlugins/build.gradle.kts

88 lines
3.0 KiB
Plaintext
Raw Normal View History

2022-08-08 10:13:08 +00:00
import com.lagradost.cloudstream3.gradle.CloudstreamExtension
import com.android.build.gradle.BaseExtension
buildscript {
repositories {
google()
mavenCentral()
2022-11-30 10:02:19 +00:00
// Shitpack repo which contains our tools and dependencies
2022-08-08 10:13:08 +00:00
maven("https://jitpack.io")
}
dependencies {
classpath("com.android.tools.build:gradle:7.0.4")
// Cloudstream gradle plugin which makes everything work and builds plugins
2023-12-13 19:11:14 +00:00
classpath("com.github.recloudstream:gradle:-SNAPSHOT")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.21")
2022-08-08 10:13:08 +00:00
}
}
allprojects {
repositories {
google()
mavenCentral()
maven("https://jitpack.io")
}
}
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
setRepo(System.getenv("GITHUB_REPOSITORY") ?: "user/repo")
}
android {
defaultConfig {
2022-08-10 19:45:26 +00:00
minSdk = 21
compileSdkVersion(33)
targetSdk = 33
2022-08-08 10:13:08 +00:00
}
compileOptions {
2022-08-10 19:50:08 +00:00
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
2022-08-08 10:13:08 +00:00
}
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions {
2022-08-10 19:55:31 +00:00
jvmTarget = "1.8" // Required
2022-08-08 10:13:08 +00:00
// Disables some unnecessary features
freeCompilerArgs = freeCompilerArgs +
"-Xno-call-assertions" +
"-Xno-param-assertions" +
"-Xno-receiver-assertions"
}
}
}
dependencies {
val apk by configurations
val implementation by configurations
// Stubs for all Cloudstream classes
apk("com.lagradost:cloudstream3:pre-release")
// 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
implementation("com.github.Blatzar:NiceHttp:0.4.11") // http library
implementation("org.jsoup:jsoup:1.17.2") // html parser
implementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.16.0")
implementation("com.fasterxml.jackson.core:jackson-databind:2.16.0")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3")
2022-08-08 10:13:08 +00:00
}
}
task<Delete>("clean") {
delete(rootProject.buildDir)
}