/
build.gradle.kts
82 lines (65 loc) · 2.07 KB
/
build.gradle.kts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
@file:Suppress("UnstableApiUsage")
import org.jetbrains.dokka.gradle.DokkaTask
fun properties(key: String) = providers.gradleProperty(key)
fun environment(key: String) = providers.environmentVariable(key)
plugins {
`kotlin-dsl`
`maven-publish`
alias(libs.plugins.pluginPublish)
alias(libs.plugins.dokka)
}
group = properties("projectGroup").get()
version = "${properties("majorVersion").get()}.${properties("buildNumber").get()}"
description = properties("description").get()
repositories {
mavenCentral()
}
dependencies {
testImplementation(gradleTestKit())
testImplementation(kotlin("test"))
testImplementation(kotlin("test-junit"))
}
kotlin {
jvmToolchain(11)
}
val dokkaHtml by tasks.getting(DokkaTask::class)
val javadocJar by tasks.registering(Jar::class) {
dependsOn(dokkaHtml)
archiveClassifier = "javadoc"
from(dokkaHtml.outputDirectory)
}
val sourcesJar = tasks.register<Jar>("sourcesJar") {
archiveClassifier = "sources"
from(sourceSets.main.get().allSource)
}
artifacts {
archives(javadocJar)
archives(sourcesJar)
}
tasks {
test {
val testGradleHome = layout.buildDirectory.asFile.get().resolve("testGradleHome")
doFirst {
testGradleHome.mkdir()
}
systemProperties["test.gradle.home"] = testGradleHome
systemProperties["test.gradle.default"] = properties("gradleVersion").get()
systemProperties["test.gradle.version"] = properties("testGradleVersion").get()
systemProperties["test.gradle.arguments"] = properties("testGradleArguments").get()
outputs.dir(testGradleHome)
}
wrapper {
gradleVersion = properties("gradleVersion").get()
}
}
gradlePlugin {
website = properties("website")
vcsUrl = properties("vcsUrl")
plugins.create("qodana") {
id = properties("pluginId").get()
displayName = properties("name").get()
implementationClass = properties("pluginImplementationClass").get()
description = project.description
tags = properties("tags").map { it.split(',') }
}
}