import io.gitlab.arturbosch.detekt.Detekt import io.gitlab.arturbosch.detekt.extensions.DetektExtension.Companion.DEFAULT_SRC_DIR_KOTLIN plugins { alias(aa.plugins.gradle.detekt) alias(aa.plugins.kotlin.jvm) alias(aa.plugins.core) `kotlin-dsl` `maven-publish` } dependencies { implementation(aa.plugin.core) implementation(aa.plugin.detekt) implementation(aa.plugin.ktlint) implementation(aa.plugin.kotlin) } description = "Lulz Common Plugin" group = "ltd.lulz.plugin" version = git.version() detekt { buildUponDefaultConfig = true basePath = projectDir.path source.from(DEFAULT_SRC_DIR_KOTLIN) } java { toolchain.languageVersion = JavaLanguageVersion.of(17) withSourcesJar() } kotlin.compilerOptions.freeCompilerArgs.addAll("-Xjsr305=strict") publishing.repositories.maven { url = uri("https://gitea.lulz.ltd/api/packages/aura-ascend/maven") name = "GiteaPackages" credentials { username = config.find("repository.gitea.user", "REPOSITORY_USER") password = config.find("repository.gitea.token", "REPOSITORY_TOKEN") } } tasks { named("build") { dependsOn("buildInfo") } register("buildInfo") { group = "lulz" description = "Prints the project name and version" doLast { println(info.nameVersion) } } withType { reports { html.required = false md.required = false sarif.required = true txt.required = false xml.required = false } } withType { manifest.attributes.apply { put("Implementation-Title", project.name) put("Implementation-Version", project.version) put("Implementation-Vendor", info.vendorName) put("Built-By", System.getProperty("user.name")) put("Built-Git", "${git.currentBranch()} #${git.currentShortHash()}") put("Built-Gradle", project.gradle.gradleVersion) put("Built-JDK", System.getProperty("java.version")) put("Built-OS", "${System.getProperty("os.name")} v${System.getProperty("os.version")}") put("Built-Time", info.utcTimestamp) } } }