-
Notifications
You must be signed in to change notification settings - Fork 43
/
Copy pathbuild.gradle.kts
91 lines (74 loc) · 2.38 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
83
84
85
86
87
88
89
90
91
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
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.changelog)
alias(libs.plugins.dokka)
alias(libs.plugins.bcv)
}
group = properties("projectGroup").get()
version = properties("version").get()
description = properties("description").get()
repositories {
mavenCentral()
}
dependencies {
implementation(libs.markdown) {
exclude(group = "org.jetbrains.kotlin")
}
testImplementation(embeddedKotlin("test"))
testImplementation(embeddedKotlin("test-junit"))
}
kotlin {
jvmToolchain(11)
}
@Suppress("UnstableApiUsage")
gradlePlugin {
website = properties("website")
vcsUrl = properties("vcsUrl")
plugins.create("changelog") {
id = properties("pluginId").get()
displayName = properties("name").get()
implementationClass = properties("pluginImplementationClass").get()
description = project.description
tags = properties("tags").map { it.split(',') }
}
}
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)
}
changelog {
groups = emptyList()
repositoryUrl = "https://github.com/JetBrains/gradle-changelog-plugin"
}
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()
}
}