All checks were successful
SonarQube Scan / SonarQube Trigger (push) Successful in 18m19s
This commit introduces a Gitea workflow to trigger SonarQube scans on pushes to the `main` branch and on pull requests.
44 lines
1.4 KiB
Kotlin
44 lines
1.4 KiB
Kotlin
import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
|
|
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
|
import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile
|
|
|
|
plugins {
|
|
// this is necessary to avoid the plugins to be loaded multiple times
|
|
// in each subproject's classloader
|
|
alias(libs.plugins.versions)
|
|
alias(libs.plugins.sonarqube)
|
|
alias(libs.plugins.android.application) apply false
|
|
alias(libs.plugins.android.library) apply false
|
|
alias(libs.plugins.compose) apply false
|
|
alias(libs.plugins.compose.compiler) apply false
|
|
alias(libs.plugins.kotlin.multiplatform) apply false
|
|
alias(libs.plugins.kotlin.jvm) apply false
|
|
alias(libs.plugins.jetbrains.kotlin.android) apply false
|
|
}
|
|
|
|
sonar {
|
|
properties {
|
|
property("sonar.projectKey", "YAEP")
|
|
property("sonar.projectName", "YAEP")
|
|
}
|
|
}
|
|
|
|
tasks.withType<KotlinJvmCompile>().configureEach {
|
|
compilerOptions {
|
|
jvmTarget.set(JvmTarget.fromTarget(libs.versions.jdk.get()))
|
|
}
|
|
}
|
|
|
|
tasks.withType<DependencyUpdatesTask> {
|
|
rejectVersionIf {
|
|
isNonStable(candidate.version) && !isNonStable(currentVersion)
|
|
}
|
|
}
|
|
|
|
fun isNonStable(version: String): Boolean {
|
|
return version.contains("dev", ignoreCase = true)
|
|
|| version.contains("alpha", ignoreCase = true)
|
|
|| version.contains("beta", ignoreCase = true)
|
|
|| version.contains("RC", ignoreCase = true)
|
|
}
|