add common, common-build, common-ktlint, common-detekt, and common-project
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
plugins {
|
||||
id("ltd.lulz.plugin.core-plugin")
|
||||
}
|
||||
|
||||
tasks {
|
||||
named("build") {
|
||||
dependsOn("buildInfo")
|
||||
}
|
||||
register("buildInfo") {
|
||||
group = "lulz"
|
||||
description = "Prints the project name and version"
|
||||
|
||||
doLast {
|
||||
println(info.nameVersion)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
import io.gitlab.arturbosch.detekt.Detekt
|
||||
import io.gitlab.arturbosch.detekt.extensions.DetektExtension.Companion.DEFAULT_SRC_DIR_KOTLIN
|
||||
import io.gitlab.arturbosch.detekt.extensions.DetektExtension.Companion.DEFAULT_TEST_SRC_DIR_KOTLIN
|
||||
|
||||
plugins {
|
||||
id("io.gitlab.arturbosch.detekt")
|
||||
}
|
||||
|
||||
detekt {
|
||||
buildUponDefaultConfig = true
|
||||
basePath = projectDir.path
|
||||
source.from(
|
||||
DEFAULT_SRC_DIR_KOTLIN,
|
||||
DEFAULT_TEST_SRC_DIR_KOTLIN,
|
||||
)
|
||||
}
|
||||
|
||||
tasks.withType<Detekt> {
|
||||
reports {
|
||||
html.required = false
|
||||
md.required = false
|
||||
sarif.required = true
|
||||
txt.required = false
|
||||
xml.required = false
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
import org.jlleitschuh.gradle.ktlint.reporter.ReporterType.SARIF
|
||||
|
||||
plugins {
|
||||
id("org.jlleitschuh.gradle.ktlint")
|
||||
}
|
||||
|
||||
ktlint {
|
||||
verbose = true
|
||||
filter {
|
||||
exclude("**/generated/**")
|
||||
include("**/kotlin/**")
|
||||
}
|
||||
kotlinScriptAdditionalPaths {
|
||||
include(fileTree("scripts/*"))
|
||||
}
|
||||
reporters {
|
||||
reporter(SARIF)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
import org.gradle.kotlin.dsl.kotlin
|
||||
|
||||
plugins {
|
||||
id("ltd.lulz.plugin.core-plugin")
|
||||
kotlin("jvm")
|
||||
}
|
||||
|
||||
tasks.register("projectInfo") {
|
||||
group = "lulz"
|
||||
description = "Prints project information"
|
||||
|
||||
val groupValue = project.group.toString()
|
||||
val nameValue = project.name
|
||||
val versionValue = project.version.toString()
|
||||
val descriptionValue = project.description ?: "N/A"
|
||||
|
||||
doLast {
|
||||
println()
|
||||
println("UTC Time: ${info.utcTimestamp}")
|
||||
println()
|
||||
println("Project group: $groupValue")
|
||||
println("Project name: $nameValue\"")
|
||||
println("Project version: $versionValue")
|
||||
println("Project description: $descriptionValue")
|
||||
println()
|
||||
println("Gradle version: ${GradleVersion.current().version}")
|
||||
println("Java JVM version: ${JavaVersion.current()}")
|
||||
println("Java toolchain version: ${java.toolchain.languageVersion.orNull ?: "N/A"}")
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
plugins {
|
||||
id("ltd.lulz.plugin.common-plugin.common-build")
|
||||
id("ltd.lulz.plugin.common-plugin.common-detekt")
|
||||
id("ltd.lulz.plugin.common-plugin.common-ktlint")
|
||||
id("ltd.lulz.plugin.common-plugin.common-project")
|
||||
|
||||
id("ltd.lulz.plugin.core-plugin")
|
||||
|
||||
kotlin("jvm")
|
||||
}
|
||||
|
||||
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
|
||||
|
||||
kotlin.compilerOptions.freeCompilerArgs.addAll("-Xjsr305=strict")
|
||||
|
||||
tasks.withType<Test> {
|
||||
useJUnitPlatform()
|
||||
}
|
||||
|
||||
version = git.version()
|
||||
Reference in New Issue
Block a user