mirror of
https://github.com/null2264/yokai.git
synced 2025-06-20 18:24:42 +00:00
87 lines
2.5 KiB
Kotlin
87 lines
2.5 KiB
Kotlin
import com.android.build.gradle.BaseExtension
|
|
import com.android.build.gradle.BasePlugin
|
|
import org.gradle.api.tasks.testing.logging.TestLogEvent
|
|
import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile
|
|
import java.util.*
|
|
|
|
plugins {
|
|
alias(libs.plugins.kotlinter)
|
|
alias(libs.plugins.gradle.versions)
|
|
alias(kotlinx.plugins.android) apply false
|
|
}
|
|
|
|
buildscript {
|
|
dependencies {
|
|
classpath(libs.gradle)
|
|
classpath(libs.google.services)
|
|
classpath(kotlinx.gradle)
|
|
classpath(libs.oss.licenses.plugin)
|
|
classpath(kotlinx.serialization.gradle)
|
|
classpath(libs.firebase.crashlytics.gradle)
|
|
classpath(libs.sqldelight.gradle)
|
|
classpath(libs.moko.generator)
|
|
}
|
|
repositories {
|
|
gradlePluginPortal()
|
|
google()
|
|
mavenCentral()
|
|
}
|
|
}
|
|
|
|
subprojects {
|
|
tasks.withType<KotlinJvmCompile> {
|
|
kotlinOptions {
|
|
jvmTarget = JavaVersion.VERSION_17.toString()
|
|
}
|
|
}
|
|
|
|
tasks.withType<Test> {
|
|
useJUnitPlatform()
|
|
testLogging {
|
|
events(TestLogEvent.PASSED, TestLogEvent.SKIPPED, TestLogEvent.FAILED)
|
|
}
|
|
}
|
|
|
|
plugins.withType<BasePlugin> {
|
|
configure<BaseExtension> {
|
|
compileSdkVersion(AndroidConfig.compileSdk)
|
|
ndkVersion = AndroidConfig.ndk
|
|
|
|
defaultConfig {
|
|
minSdk = AndroidConfig.minSdk
|
|
targetSdk = AndroidConfig.targetSdk
|
|
ndk {
|
|
version = AndroidConfig.ndk
|
|
}
|
|
}
|
|
|
|
compileOptions {
|
|
sourceCompatibility = JavaVersion.VERSION_17
|
|
targetCompatibility = JavaVersion.VERSION_17
|
|
isCoreLibraryDesugaringEnabled = true
|
|
}
|
|
|
|
dependencies {
|
|
add("coreLibraryDesugaring", libs.desugar)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
tasks.named("dependencyUpdates", com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask::class.java).configure {
|
|
rejectVersionIf {
|
|
val stableKeyword = listOf("RELEASE", "FINAL", "GA").any { candidate.version.uppercase(Locale.ROOT).contains(it) }
|
|
val regex = "^[0-9,.v-]+(-r)?$".toRegex()
|
|
val isStable = stableKeyword || regex.matches(candidate.version)
|
|
isStable.not()
|
|
}
|
|
// optional parameters
|
|
checkForGradleUpdate = true
|
|
outputFormatter = "json"
|
|
outputDir = "build/dependencyUpdates"
|
|
reportfileName = "report"
|
|
}
|
|
|
|
tasks.register("clean", Delete::class) {
|
|
delete(rootProject.layout.buildDirectory)
|
|
}
|