[skip ci] refactor: Refactor and simplify common libraries (#2807)
This commit is contained in:
16
build-plugins/build.gradle.kts
Normal file
16
build-plugins/build.gradle.kts
Normal file
@ -0,0 +1,16 @@
|
||||
plugins {
|
||||
`kotlin-dsl`
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(libs.gradle.agp)
|
||||
implementation(libs.gradle.kotlin)
|
||||
implementation(libs.gradle.kotlin.serialization)
|
||||
// Workaround: https://github.com/gradle/gradle/issues/15383#issuecomment-779893192
|
||||
implementation(files(libs.javaClass.superclass.protectionDomain.codeSource.location))
|
||||
}
|
||||
|
||||
kotlin {
|
||||
// To access AndroidConfig
|
||||
sourceSets.getByName("main").kotlin.srcDir("../buildSrc/src/main/kotlin")
|
||||
}
|
9
build-plugins/settings.gradle.kts
Normal file
9
build-plugins/settings.gradle.kts
Normal file
@ -0,0 +1,9 @@
|
||||
apply(from = "../repositories.gradle.kts")
|
||||
|
||||
dependencyResolutionManagement {
|
||||
versionCatalogs {
|
||||
create("libs") {
|
||||
from(files("../gradle/libs.versions.toml"))
|
||||
}
|
||||
}
|
||||
}
|
23
build-plugins/src/main/kotlin/lib-android.gradle.kts
Normal file
23
build-plugins/src/main/kotlin/lib-android.gradle.kts
Normal file
@ -0,0 +1,23 @@
|
||||
import org.gradle.accessors.dm.LibrariesForLibs
|
||||
|
||||
plugins {
|
||||
id("com.android.library")
|
||||
kotlin("android")
|
||||
id("kotlinx-serialization")
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdk = AndroidConfig.compileSdk
|
||||
|
||||
defaultConfig {
|
||||
minSdk = AndroidConfig.minSdk
|
||||
}
|
||||
|
||||
namespace = "eu.kanade.tachiyomi.lib.${name.replace("-", "")}"
|
||||
}
|
||||
|
||||
val libs = the<LibrariesForLibs>()
|
||||
|
||||
dependencies {
|
||||
compileOnly(libs.bundles.common)
|
||||
}
|
12
build-plugins/src/main/kotlin/lib-kotlin.gradle.kts
Normal file
12
build-plugins/src/main/kotlin/lib-kotlin.gradle.kts
Normal file
@ -0,0 +1,12 @@
|
||||
import org.gradle.accessors.dm.LibrariesForLibs
|
||||
|
||||
plugins {
|
||||
`java-library`
|
||||
kotlin("jvm")
|
||||
}
|
||||
|
||||
val libs = the<LibrariesForLibs>()
|
||||
|
||||
dependencies {
|
||||
compileOnly(libs.kotlin.stdlib)
|
||||
}
|
Reference in New Issue
Block a user