mirror of
https://github.com/jellyfin/jellyfin-androidtv.git
synced 2024-11-30 09:30:54 +00:00
4bb2158cc0
Explicitly mark that we want version 17 of the JDK as the compiler. Previously we implicitly relied on Gradle getting this right. This means devs and CI will all use the same JDK explicitly rather than implicitly. Pin the target JDK version in build.gradle.kts, this should apply to all targets (including Kotlin) to version 1.8 to maintain compatibility with older devices
67 lines
1.4 KiB
Plaintext
67 lines
1.4 KiB
Plaintext
plugins {
|
|
alias(libs.plugins.detekt)
|
|
java
|
|
}
|
|
|
|
buildscript {
|
|
dependencies {
|
|
classpath(libs.android.gradle)
|
|
classpath(libs.kotlin.gradle)
|
|
}
|
|
}
|
|
|
|
java {
|
|
toolchain {
|
|
languageVersion.set(JavaLanguageVersion.of("17"))
|
|
}
|
|
}
|
|
|
|
subprojects {
|
|
// Configure linting
|
|
apply<io.gitlab.arturbosch.detekt.DetektPlugin>()
|
|
detekt {
|
|
buildUponDefaultConfig = true
|
|
ignoreFailures = true
|
|
config = files("$rootDir/detekt.yaml")
|
|
basePath = rootDir.absolutePath
|
|
|
|
reports {
|
|
sarif.enabled = true
|
|
}
|
|
}
|
|
|
|
// Configure default Kotlin compiler options
|
|
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile> {
|
|
kotlinOptions {
|
|
jvmTarget = JavaVersion.VERSION_1_8.toString()
|
|
}
|
|
}
|
|
|
|
// Configure default Android options
|
|
plugins.withType<com.android.build.gradle.BasePlugin> {
|
|
configure<com.android.build.gradle.BaseExtension> {
|
|
compileOptions {
|
|
sourceCompatibility = JavaVersion.VERSION_1_8
|
|
targetCompatibility = JavaVersion.VERSION_1_8
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
tasks.withType<Test> {
|
|
// Ensure Junit emits the full stack trace when a unit test fails through gradle
|
|
useJUnit()
|
|
|
|
testLogging {
|
|
events(
|
|
org.gradle.api.tasks.testing.logging.TestLogEvent.FAILED,
|
|
org.gradle.api.tasks.testing.logging.TestLogEvent.STANDARD_ERROR,
|
|
org.gradle.api.tasks.testing.logging.TestLogEvent.SKIPPED
|
|
)
|
|
exceptionFormat = org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL
|
|
showExceptions = true
|
|
showCauses = true
|
|
showStackTraces = true
|
|
}
|
|
}
|